-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Notebook Authorization #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6e85730
Notebook Authorization
a8d0ecb
Add security documentation
6b9e274
Add unit test for note permissions
06c5e07
Update navigation.html for security docs
fbbd04b
Make insufficient privileges error message easier to read
3a5e5c0
Check if user has permissions to modify note permissions
2554315
Use user and roles for checking note permissions
6c89dbe
Implement Moon's suggestions on note permissions background and wildc…
1ac076e
Fixed typo in _navigation.html and updated interpreter_authorization.md
28ea697
Fixed issues with security documentation reported by @AhyoungRyu
733530f
Minor doc fix
52f4914
Check whether roles is non-empty before adding to userAndRoles
29ebf48
Merge with master
24e8de4
Remove duplicate imports
e7cffd8
Restore anon default in shiro.ini
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,15 @@ | |
| <li><a href="{{BASE_PATH}}/pleasecontribute.html">Tajo</a></li> | ||
| </ul> | ||
| </li> | ||
| <li> | ||
| <a href="#" data-toggle="dropdown" class="dropdown-toggle">Security<b class="caret"></b></a> | ||
| <ul class="dropdown-menu"> | ||
| <li><a href="{{BASE_PATH}}/security/overviwe.html">Overview</a></li> | ||
| <li><a href="{{BASE_PATH}}/security/authentication.html#html">Authentication</a></li> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think "#html" next to the |
||
| <li><a href="{{BASE_PATH}}/security/notebook_authorization.html">Notebook Authorization</a></li> | ||
| <li><a href="{{BASE_PATH}}/security/interpreter_authorization.html">Interpreter Authorization</a></li> | ||
| </ul> | ||
| </li> | ||
| <li> | ||
| <a href="#" data-toggle="dropdown" class="dropdown-toggle">Display System <b class="caret"></b></a> | ||
| <ul class="dropdown-menu"> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| layout: page | ||
| title: "Authentication" | ||
| description: "Authentication" | ||
| group: security | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| # Zeppelin Authentication | ||
|
|
||
| Authentication is company-specific. | ||
|
|
||
| One option is to use [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) | ||
|
|
||
| Anoteher is to have an authentication server that can verify user credentials in an LDAP server. | ||
| If an incoming request to the Zeppelin server does not have a cookie with user information encrypted with the authentication server public key, the user | ||
| is redirected to the authentication server. Once the user is verified, the authentication server redirects the browser to a specific | ||
| URL in the Zeppelin server which sets the authentication cookie in the browser. | ||
| The end result is that all requests to the Zeppelin | ||
| web server have the authentication cookie which contains user and groups information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| layout: page | ||
| title: "Notebook Authorization" | ||
| description: "Notebook Authorization" | ||
| group: security | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| # Zeppelin Interpreter Authorization | ||
|
|
||
| The Interpreter authorization problem is more complex. Different interpreters require different strategies. | ||
|
|
||
| For the Hive interpreter, we need to maintain per-user connection pools. | ||
| The interpreter method takes the user string as parameter and executes the jdbc call using a connection in the user's connection pool. | ||
|
|
||
| In case of Presto, we don't need password if the Presto DB server runs backend code using HDFS authorization for the user. | ||
| For databases like Vertica and Mysql we would have to store password information for users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| layout: page | ||
| title: "Notebook Authorization" | ||
| description: "Notebook Authorization" | ||
| group: security | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| # Zeppelin Notebook Authorization | ||
|
|
||
| ## Overview | ||
| There are different aspects to Zeppelin security: | ||
|
|
||
| * Authentication: is the user who they say they are? | ||
| * Notebook authorization: does the user have permissions to read or write to a note? | ||
| * Interpreter authorization: does the user have permissions to perform interpreter operations e.g. access data source objects? | ||
|
|
||
|
|
||
| ## Authentication | ||
|
|
||
| Authentication is company-specific. One option is to have an authentication server that can verify user credentials in an LDAP server. | ||
| If an incoming request to the Zeppelin server does not have a cookie with user information encrypted with the authentication server public key, the user | ||
| is redirected to the authentication server. Once the user is verified, the authentication server redirects the browser to a specific | ||
| URL in the Zeppelin server which sets the authentication cookie in the browser. | ||
| The end result is that all requests to the Zeppelin | ||
| web server have the authentication cookie which contains user and groups information. | ||
|
|
||
|
|
||
| ## Notebook Authorization | ||
|
|
||
| We assume that there is an authentication component that associates a user string and a set of group strings with every NotebookSocket. | ||
|
|
||
| Each note has the following: | ||
| * set of owner entities (users or groups) | ||
| * set of reader entities (users or groups) | ||
| * set of writer entities (users or groups) | ||
|
|
||
| If a set is empty, it means that any user can perform that operation. | ||
|
|
||
| The NotebookServer classifies every Note operation into three categories: read, write, manage. | ||
| Before executing a Note operation, it checks if the user and the groups associated with the NotebookSocket have permissions. For example, before executing an read | ||
| operation, it checks if the user and the groups have at least one entity that belongs to the reader entities. | ||
|
|
||
| To initialize and modify note permissions, we provide UI like "Interpreter binding". The user inputs comma separated entities for owners, readers and writers. | ||
| We execute a rest api call with this information. In the backend we get the user information for the connection and allow the operation if the user and groups | ||
| associated with the current user have at least one entity that belongs to owner entities for the note. | ||
|
|
||
| ## Interpreter Authorization | ||
| The Interpreter authorization problem is more complex. Different interpreters require different strategies. | ||
|
|
||
| For the Hive interpreter, we need to maintain per-user connection pools. | ||
| The interpreter method takes the user string as parameter and executes the jdbc call using a connection in the user's connection pool. | ||
|
|
||
| In case of Presto, we don't need password if the Presto DB server runs backend code using HDFS authorization for the user. | ||
| For databases like Vertica and Mysql we would have to store password information for users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| layout: page | ||
| title: "Security Overview" | ||
| description: "Security Overview" | ||
| group: security | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| {% include JB/setup %} | ||
|
|
||
| # Security Overview | ||
|
|
||
| There are three aspects to Zeppelin security: | ||
|
|
||
| * Authentication: is the user who they say they are? [More](overview.html) | ||
| * Notebook authorization: does the user have permissions to read or write to a note? [More](notebook_authorization.html) | ||
| * Interpreter authorization: does the user have permissions to perform interpreter operations e.g. access data source objects? [More](interpreter_authorization.html) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @prasadwagle : )
There is a typo : overviwe.html -> overview.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AhyoungRyu! I fixed the typo. I am having trouble installing jekyll to test the docs. Please let me know if you see any other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prasadwagle Thx for your quick response!
I left some comments again in this PR just a moment ago.