You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Fang-Yu Rao (Code Review)" <ge...@cloudera.org> on 2020/09/06 23:08:38 UTC
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Fang-Yu Rao has uploaded this change for review. ( http://gerrit.cloudera.org:8080/16423
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
IMPALA-10122 (Part 1): Deny access to views not authorized at creation
After HIVE-24026, a non-superuser is allowed to create, alter, and drop
a view directly in the HiveMetaStore via a Spark client without the
Impala FE or the HiveServer2 being involved to perform the corresponding
authorization checks to see if the non-superuser possesses the required
privileges on the underlying tables. This opens up the possibility that
a non-superuser is able to replace the underlying tables referenced in a
view with some other tables even though this non-superuser does not
possess the necessary privileges on those tables substituting for the
tables originally referenced in the view.
Recall that currently when a user is requesting to select a view in
Impala, the Impala FE only requires that there is a Ranger policy
granting the requesting user the SELECT privilege on the view but not
the SELECT privileges on the underlying tables of the view. Therefore,
with the change of HIVE-24026, a non-superuser is able to access the
data in tables for which the permission was not granted through either
i) an ALTER VIEW statement, or ii) a CREATE VIEW statement followed by a
DROP VIEW statement given that there is already a Ranger policy allowing
this user to select this view.
To prevent a user from accessing the data in tables on which the user
does not possess the required privileges, we could employ the Boolean
table property of 'Authorized' that was introduced in HIVE-24026.
Specifically, after HIVE-24026, if a view was created without the
corresponding privileges on the underlying tables being checked, the
HiveMetaStore would set this property to false and the property will not
be added if the view was authorized at creation time for backward
compatibility. Based on this table property, it is possible for the
Impala FE to determine whether or not it should additionally check for
the requesting user's privileges on the underlying tables of a view
after HIVE-24026 at selection time, but it would require a more thorough
investigation regarding how to revise the way the Impala FE registers
the authorization requests given a query.
To mitigate this potential security breach before we figure out how to
perform authorization for a view whose creation was not authorized, in
this patch, we introduce a temporary field of 'viewCreatedWithoutAuthz_'
in the class of AuthorizableTable that indicates whether or not a given
table corresponds a view that was not authorized at creation time,
allowing the Impala FE to deny the SELECT access to a view
whose creation was not authorized in
BaseAuthorizationChecker#authorizeTableAccess().
Testing:
- Manually verified that after using beeline to set the table property
of 'Authorized' corresponding to a view to false, no user is able to
select data from this view. Recall that Impala does not support the
ALTER VIEW SET TBLPROPERTIES statement.
- Verified that the patch could pass the exhaustive tests in the DEBUG
build.
Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/DescribeTableStmt.java
M fe/src/main/java/org/apache/impala/analysis/DropTableOrViewStmt.java
M fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableTable.java
M fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java
M fe/src/main/java/org/apache/impala/authorization/DefaultAuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
9 files changed, 156 insertions(+), 23 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/23/16423/1
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Quanlong Huang (Code Review)" <ge...@cloudera.org>.
Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Wed, 09 Sep 2020 23:05:58 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Fang-Yu Rao (Code Review)" <ge...@cloudera.org>.
Fang-Yu Rao has uploaded a new patch set (#5). ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
IMPALA-10122 (Part 1): Deny access to views not authorized at creation
After HIVE-24026, a non-superuser is allowed to create, alter, and drop
a view directly in the HiveMetaStore via a Spark client without the
Impala FE or the HiveServer2 being involved to perform the corresponding
authorization checks to see if the non-superuser possesses the required
privileges on the underlying tables. This opens up the possibility that
a non-superuser is able to replace the underlying tables referenced in a
view with some other tables even though this non-superuser does not
possess the necessary privileges on those tables substituting for the
tables originally referenced in the view.
Recall that currently when a user is requesting to select a view in
Impala, the Impala FE only requires that there is a Ranger policy
granting the requesting user the SELECT privilege on the view but not
the SELECT privileges on the underlying tables of the view. Therefore,
with the change of HIVE-24026, a non-superuser is able to access the
data in tables for which the permission was not granted through either
i) an ALTER VIEW statement, or ii) a DROP VIEW statement followed by a
CREATE VIEW statement given that there is already a Ranger policy
allowing this user to select this view.
To prevent a user from accessing the data in tables on which the user
does not possess the required privileges, we could employ the Boolean
table property of 'Authorized' that was introduced in HIVE-24026.
Specifically, after HIVE-24026, if a view was created without the
corresponding privileges on the underlying tables being checked, the
HiveMetaStore would set this property to false and the property will not
be added if the view was authorized at creation time for backward
compatibility. Based on this table property, it is possible for the
Impala FE to determine whether or not it should additionally check for
the requesting user's privileges on the underlying tables of a view
after HIVE-24026 at selection time, but it would require a more thorough
investigation regarding how to revise the way the Impala FE registers
the authorization requests given a query.
To mitigate this potential security breach before we figure out how to
perform authorization for a view whose creation was not authorized, in
this patch, we introduce a temporary field of 'viewCreatedWithoutAuthz_'
in the class of AuthorizableTable that indicates whether or not a given
table corresponds to a view that was not authorized at creation time,
allowing the Impala FE to deny the SELECT access to a view
whose creation was not authorized in
BaseAuthorizationChecker#authorizeTableAccess().
Testing:
- Manually verified that after using beeline to set to false the table
property of 'Authorized' corresponding to a view, no user is able to
select data from this view or describe this view. Recall that Impala
does not support the ALTER VIEW SET TBLPROPERTIES statement.
- Verified that the patch could pass the exhaustive tests in the DEBUG
build.
Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/DropTableOrViewStmt.java
M fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableTable.java
M fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java
M fe/src/main/java/org/apache/impala/authorization/DefaultAuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
M fe/src/main/java/org/apache/impala/service/Frontend.java
9 files changed, 143 insertions(+), 15 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/23/16423/5
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 5
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Quanlong Huang (Code Review)" <ge...@cloudera.org>.
Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 5:
(3 comments)
The patch looks good to me now. Will give +2 after resolving some minor comments.
http://gerrit.cloudera.org:8080/#/c/16423/5//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/16423/5//COMMIT_MSG@55
PS5, Line 55: Recall that Impala
: does not support the ALTER VIEW SET TBLPROPERTIES statement.
What about the supported ALTER VIEW statements? https://impala.apache.org/docs/build/html/topics/impala_alter_view.html
Are they denied as well for such kind of views?
http://gerrit.cloudera.org:8080/#/c/16423/3/fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java
File fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java:
http://gerrit.cloudera.org:8080/#/c/16423/3/fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java@241
PS3, Line 241: hen config_.isEnabl
> Thanks Quanlong! I added this check because this method (authorizeTableAcce
Thanks for the explanation!
http://gerrit.cloudera.org:8080/#/c/16423/5/fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
File fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java:
http://gerrit.cloudera.org:8080/#/c/16423/5/fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java@83
PS5, Line 83: table == null ||
nit: don't need this since (null instanceof View) is false.
https://stackoverflow.com/questions/2950319/is-null-check-needed-before-calling-instanceof
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 5
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Wed, 09 Sep 2020 01:34:11 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/7141/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Wed, 09 Sep 2020 17:09:19 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/6418/ DRY_RUN=false
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Wed, 09 Sep 2020 23:06:45 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Sep 2020 11:57:39 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
IMPALA-10122 (Part 1): Deny access to views not authorized at creation
After HIVE-24026, a non-superuser is allowed to create, alter, and drop
a view directly in the HiveMetaStore via a Spark client without the
Impala FE or the HiveServer2 being involved to perform the corresponding
authorization checks to see if the non-superuser possesses the required
privileges on the underlying tables. This opens up the possibility that
a non-superuser is able to replace the underlying tables referenced in a
view with some other tables even though this non-superuser does not
possess the necessary privileges on those tables substituting for the
tables originally referenced in the view.
Recall that currently when a user is requesting to select a view in
Impala, the Impala FE only requires that there is a Ranger policy
granting the requesting user the SELECT privilege on the view but not
the SELECT privileges on the underlying tables of the view. Therefore,
with the change of HIVE-24026, a non-superuser is able to access the
data in tables for which the permission was not granted through either
i) an ALTER VIEW statement, or ii) a DROP VIEW statement followed by a
CREATE VIEW statement given that there is already a Ranger policy
allowing this user to select this view.
To prevent a user from accessing the data in tables on which the user
does not possess the required privileges, we could employ the Boolean
table property of 'Authorized' that was introduced in HIVE-24026.
Specifically, after HIVE-24026, if a view was created without the
corresponding privileges on the underlying tables being checked, the
HiveMetaStore would set this property to false and the property will not
be added if the view was authorized at creation time for backward
compatibility. Based on this table property, it is possible for the
Impala FE to determine whether or not it should additionally check for
the requesting user's privileges on the underlying tables of a view
after HIVE-24026 at selection time, but it would require a more thorough
investigation regarding how to revise the way the Impala FE registers
the authorization requests given a query.
To mitigate this potential security breach before we figure out how to
perform authorization for a view whose creation was not authorized, in
this patch, we introduce a temporary field of 'viewCreatedWithoutAuthz_'
in the class of AuthorizableTable that indicates whether or not a given
table corresponds to a view that was not authorized at creation time,
allowing the Impala FE to deny the SELECT, ALTER, and DESCRIBE access to
a view whose creation was not authorized.
Testing:
- Manually verified that after using beeline to set to false the table
property of 'Authorized' corresponding to a view, no user is able to
select data from this view, or to alter or describe this view. Recall
that currently Impala does not support the ALTER VIEW SET
TBLPROPERTIES statement and thus we need to use beeline to create
such a view.
- Verified that the patch could pass the exhaustive tests in the DEBUG
build.
Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Reviewed-on: http://gerrit.cloudera.org:8080/16423
Reviewed-by: Quanlong Huang <hu...@gmail.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/DropTableOrViewStmt.java
M fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableTable.java
M fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java
M fe/src/main/java/org/apache/impala/authorization/DefaultAuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
M fe/src/main/java/org/apache/impala/service/Frontend.java
9 files changed, 143 insertions(+), 15 deletions(-)
Approvals:
Quanlong Huang: Looks good to me, approved
Impala Public Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 8
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Fang-Yu Rao (Code Review)" <ge...@cloudera.org>.
Fang-Yu Rao has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7:
> Patch Set 7: Verified-1
>
> Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/6418/
It looks like we hit IMPALA-9923 (Data loading of TPC-DS ORC fails with "Fail to get checksum").
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Sep 2020 03:22:10 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 5:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/7136/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 5
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Tue, 08 Sep 2020 23:16:59 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7: Verified-1
Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/6418/
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Sep 2020 03:04:23 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 1:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/7120/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Sun, 06 Sep 2020 23:29:52 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 7:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/6420/ DRY_RUN=false
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Thu, 10 Sep 2020 06:46:51 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
Patch Set 1:
(8 comments)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/Analyzer.java
File fe/src/main/java/org/apache/impala/analysis/Analyzer.java:
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/Analyzer.java@3078
PS1, Line 3078: // When 'table' is null, we also assume that 'table' does not correspond to a view whose
line too long (96 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/Analyzer.java@3091
PS1, Line 3091: // When 'table' is null, we also assume that 'table' does not correspond to a view whose
line too long (96 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java
File fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java:
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java@179
PS1, Line 179: // 'viewCreatedWithoutAuthz' once we can properly process a PrivilegeRequest for
line too long (92 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java@185
PS1, Line 185: // TODO(IMPALA-10122): Remove the need for computing 'isViewCreatedWithoutAuthz'
line too long (92 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java@186
PS1, Line 186: // once we can properly process a PrivilegeRequest for a view whose creation was
line too long (92 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java@193
PS1, Line 193: // We assume that 'table' is not a view whose creation was not authorized if we
line too long (93 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java@199
PS1, Line 199: tbl.getOwnerUser(), isViewCreatedWithoutAuthz).allOf(Privilege.REFRESH)
line too long (91 > 90)
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
File fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java:
http://gerrit.cloudera.org:8080/#/c/16423/1/fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java@121
PS1, Line 121: String dbName, String tableName, String ownerUser, boolean viewCreatedWithoutAuthz) {
line too long (91 > 90)
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>
Gerrit-Comment-Date: Sun, 06 Sep 2020 23:09:23 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-10122 (Part 1): Deny access to views not authorized at creation
Posted by "Fang-Yu Rao (Code Review)" <ge...@cloudera.org>.
Fang-Yu Rao has uploaded a new patch set (#7). ( http://gerrit.cloudera.org:8080/16423 )
Change subject: IMPALA-10122 (Part 1): Deny access to views not authorized at creation
......................................................................
IMPALA-10122 (Part 1): Deny access to views not authorized at creation
After HIVE-24026, a non-superuser is allowed to create, alter, and drop
a view directly in the HiveMetaStore via a Spark client without the
Impala FE or the HiveServer2 being involved to perform the corresponding
authorization checks to see if the non-superuser possesses the required
privileges on the underlying tables. This opens up the possibility that
a non-superuser is able to replace the underlying tables referenced in a
view with some other tables even though this non-superuser does not
possess the necessary privileges on those tables substituting for the
tables originally referenced in the view.
Recall that currently when a user is requesting to select a view in
Impala, the Impala FE only requires that there is a Ranger policy
granting the requesting user the SELECT privilege on the view but not
the SELECT privileges on the underlying tables of the view. Therefore,
with the change of HIVE-24026, a non-superuser is able to access the
data in tables for which the permission was not granted through either
i) an ALTER VIEW statement, or ii) a DROP VIEW statement followed by a
CREATE VIEW statement given that there is already a Ranger policy
allowing this user to select this view.
To prevent a user from accessing the data in tables on which the user
does not possess the required privileges, we could employ the Boolean
table property of 'Authorized' that was introduced in HIVE-24026.
Specifically, after HIVE-24026, if a view was created without the
corresponding privileges on the underlying tables being checked, the
HiveMetaStore would set this property to false and the property will not
be added if the view was authorized at creation time for backward
compatibility. Based on this table property, it is possible for the
Impala FE to determine whether or not it should additionally check for
the requesting user's privileges on the underlying tables of a view
after HIVE-24026 at selection time, but it would require a more thorough
investigation regarding how to revise the way the Impala FE registers
the authorization requests given a query.
To mitigate this potential security breach before we figure out how to
perform authorization for a view whose creation was not authorized, in
this patch, we introduce a temporary field of 'viewCreatedWithoutAuthz_'
in the class of AuthorizableTable that indicates whether or not a given
table corresponds to a view that was not authorized at creation time,
allowing the Impala FE to deny the SELECT, ALTER, and DESCRIBE access to
a view whose creation was not authorized.
Testing:
- Manually verified that after using beeline to set to false the table
property of 'Authorized' corresponding to a view, no user is able to
select data from this view, or to alter or describe this view. Recall
that currently Impala does not support the ALTER VIEW SET
TBLPROPERTIES statement and thus we need to use beeline to create
such a view.
- Verified that the patch could pass the exhaustive tests in the DEBUG
build.
Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/DropTableOrViewStmt.java
M fe/src/main/java/org/apache/impala/analysis/ResetMetadataStmt.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizableTable.java
M fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java
M fe/src/main/java/org/apache/impala/authorization/DefaultAuthorizableFactory.java
M fe/src/main/java/org/apache/impala/authorization/PrivilegeRequestBuilder.java
M fe/src/main/java/org/apache/impala/service/Frontend.java
9 files changed, 143 insertions(+), 15 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/23/16423/7
--
To view, visit http://gerrit.cloudera.org:8080/16423
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I73965e05586771de85fa6f73c452e3de4f312034
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 7
Gerrit-Owner: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fa...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Vihang Karajgaonkar <vi...@cloudera.com>