Commit 63c0ce0
IMPALA-11382: Produce log for unauthorized SELECT on non-existing table
This patch revised the logic of Ranger audit log generation such that
unauthorized SELECT operation on non-existing tables would be produced
as well. Note that after this change, in the case of an unauthorized
SELECT operation on an existing table, Impala will produce a table event
instead of the first failing column event because we do not filter out
the table event for an unauthorized SELECT operation like what we did
before.
In addition, this patch fixed a subtle bug where an authorized table
event could be produced even though the authorization failed due to a
deny policy on a column in the same table.
The code comment in RangerAuthorizationChecker#authorizeTableAccess()
was also updated to reflect Impala's current behavior with respect to
Ranger audit log generation.
Testing:
- Added a test case to verify the log corresponding to an unauthorized
SELECT operation on a non-existing table is produced.
- Manually verified that an authorized table event won't be produced
when the requesting user is granted the SELECT privilege on a table
but is denied access to a column in the same table.
Change-Id: I92b2a6acc920de1d2d14b991c374a4550e742f7b
Reviewed-on: http://gerrit.cloudera.org:8080/18656
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>1 parent 00db9a2 commit 63c0ce0
2 files changed
Lines changed: 43 additions & 21 deletions
File tree
- fe/src
- main/java/org/apache/impala/authorization/ranger
- test/java/org/apache/impala/authorization/ranger
Lines changed: 26 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
263 | 269 | | |
264 | 270 | | |
265 | 271 | | |
| 272 | + | |
266 | 273 | | |
267 | 274 | | |
268 | 275 | | |
| 276 | + | |
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
273 | 281 | | |
274 | | - | |
275 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
276 | 286 | | |
277 | 287 | | |
278 | 288 | | |
279 | 289 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
286 | 301 | | |
287 | 302 | | |
288 | 303 | | |
| |||
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
| 320 | + | |
322 | 321 | | |
323 | | - | |
| 322 | + | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
| |||
496 | 504 | | |
497 | 505 | | |
498 | 506 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 507 | + | |
| 508 | + | |
502 | 509 | | |
503 | 510 | | |
504 | 511 | | |
505 | 512 | | |
506 | 513 | | |
507 | | - | |
| 514 | + | |
508 | 515 | | |
509 | 516 | | |
510 | 517 | | |
| |||
714 | 721 | | |
715 | 722 | | |
716 | 723 | | |
717 | | - | |
718 | | - | |
| 724 | + | |
| 725 | + | |
719 | 726 | | |
720 | 727 | | |
721 | 728 | | |
722 | 729 | | |
723 | | - | |
| 730 | + | |
724 | 731 | | |
725 | 732 | | |
726 | 733 | | |
| |||
0 commit comments