You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Alex Behm (Code Review)" <ge...@cloudera.org> on 2016/07/26 23:48:39 UTC
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Alex Behm has uploaded a new change for review.
http://gerrit.cloudera.org:8080/3783
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 133 insertions(+), 95 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/3783/1
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Dimitris Tsirogiannis (Code Review)" <ge...@cloudera.org>.
Dimitris Tsirogiannis has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 2:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
File fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java:
PS2, Line 505: Adds audit events and privilege requests for
: * the database and/or table.
Is this comment accurate now?
PS2, Line 2534: The given table must be a base table or a catalog view
What else could it be?
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
File fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java:
Line 46: * unresolved table ref. Sets the explicit alias and the join-related attributes
Maybe you want to comment where 'resolvedPath' is coming from.
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
File fe/src/main/java/com/cloudera/impala/analysis/FromClause.java:
PS2, Line 21: import com.cloudera.impala.catalog.View;
I don't think this is used anywhere.
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has uploaded a new patch set (#3).
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 133 insertions(+), 101 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/3783/3
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Dimitris Tsirogiannis (Code Review)" <ge...@cloudera.org>.
Dimitris Tsirogiannis has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 2:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
File fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java:
PS2, Line 505: Adds audit events and privilege requests for
: * the database and/or table.
> Is this comment accurate now?
Fixed.
PS2, Line 2534: The given table must be a base table or a catalog view
> What else could it be?
Added comment.
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
File fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java:
Line 46: * unresolved table ref. Sets the explicit alias and the join-related attributes
> Maybe you want to comment where 'resolvedPath' is coming from.
Done
http://gerrit.cloudera.org:8080/#/c/3783/2/fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
File fe/src/main/java/com/cloudera/impala/analysis/FromClause.java:
PS2, Line 21: import com.cloudera.impala.catalog.View;
> I don't think this is used anywhere.
Correct. Done.
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/3783/3//COMMIT_MSG
Commit Message:
PS3, Line 16: but since an InlineViewRef is
: considered to be resolved, we never call TableRef.analyze(), and hence
: never register an authorization event for the view.
> dump = dumb :)
An InlineViewRef is still considered to be resolved (anything that is not an "abstract" TableRef is resolved). InlineViewRefs actually don't use the resolvedPath because they don't really have a path (an inline view is an inline query stmt - not a path).
We could change what it means to be resolved, but I think the current definition with inline views makes sense (they have no path to be resolved).
http://gerrit.cloudera.org:8080/#/c/3783/3/fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
File fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java:
PS3, Line 2537: The given table must be a base table or a catalog view (not
: * a local view).
> How is this enforced in this function?
Preconditions check in line 2544
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Hello Internal Jenkins, Dimitris Tsirogiannis,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/3783
to look at the new patch set (#6).
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 136 insertions(+), 104 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/3783/6
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Dimitris Tsirogiannis (Code Review)" <ge...@cloudera.org>.
Dimitris Tsirogiannis has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/3783/3//COMMIT_MSG
Commit Message:
PS3, Line 16: but since an InlineViewRef is
: considered to be resolved, we never call TableRef.analyze(), and hence
: never register an authorization event for the view.
Maybe a dump idea but wouldn't it work if we just reset the resolvedPath of InliveViewRef, thereby forcing it to re-resolve the path and add the necessary priv checks?
http://gerrit.cloudera.org:8080/#/c/3783/3/fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
File fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java:
PS3, Line 2537: The given table must be a base table or a catalog view (not
: * a local view).
How is this enforced in this function?
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has submitted this change and it was merged.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Reviewed-on: http://gerrit.cloudera.org:8080/3783
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Internal Jenkins
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 136 insertions(+), 104 deletions(-)
Approvals:
Internal Jenkins: Verified
Alex Behm: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 6: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Hello Internal Jenkins, Dimitris Tsirogiannis,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/3783
to look at the new patch set (#5).
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 138 insertions(+), 104 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/3783/5
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 4: Verified-1
Build failed: http://sandbox.jenkins.cloudera.com/job/impala-external-gerrit-verify-merge-ASF/26/
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has uploaded a new patch set (#2).
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
The bug: We used to register privilege requests for table refs in TableRef.analyze()
which only got called for unresolved TableRefs. As a result, a reference to a view that
contains a subquery did not get properly authorized, explained as follows.
1. In the first analysis pass the view is replaced by a an InlineViewRef and we
correctly register an authorizarion request.
2. We rewrite the subquery via the StmtRewriter and wipe the analysis state, but
preserve the InlineViewRef that replaces the view reference.
3. The rewritten statement is analyzed again, but since an InlineViewRef is
considered to be resolved, we never call TableRef.analyze(), and hence
never register an authorization event for the view.
The fix: We now register authorization and auditing events when calling analyze() on a
resolved TableRef (BaseTableRef, InlineViewRef, CollectionTableRef).
Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
---
M fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java
M fe/src/main/java/com/cloudera/impala/analysis/BaseTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/CollectionTableRef.java
M fe/src/main/java/com/cloudera/impala/analysis/FromClause.java
M fe/src/main/java/com/cloudera/impala/analysis/InlineViewRef.java
M fe/src/main/java/com/cloudera/impala/analysis/TableRef.java
M fe/src/test/java/com/cloudera/impala/analysis/AuditingTest.java
M fe/src/test/java/com/cloudera/impala/analysis/AuthorizationTest.java
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
10 files changed, 120 insertions(+), 96 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/3783/2
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
Posted by "Dimitris Tsirogiannis (Code Review)" <ge...@cloudera.org>.
Dimitris Tsirogiannis has posted comments on this change.
Change subject: IMPALA-3915: Register privilege and audit requests when analyzing resolved table refs.
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/3783/3//COMMIT_MSG
Commit Message:
PS3, Line 16: but since an InlineViewRef is
: considered to be resolved, we never call TableRef.analyze(), and hence
: never register an authorization event for the view.
> Maybe a dump idea but wouldn't it work if we just reset the resolvedPath of
dump = dumb :)
--
To view, visit http://gerrit.cloudera.org:8080/3783
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18fa8af9a94ce190c5a3c29c3221c659a2ace659
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dt...@cloudera.com>
Gerrit-HasComments: Yes