-
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
Conversation
|
Thanks for great contribution. Tested working nicely. Can 'Note Permissions' have white background? like 'interpreter binding' ? If you need help, me or maybe Damien can help on styling. Another one is - actually i should ask earlier - recently there were discussion about notebook file portability regarding interpreter selection. Current design save permission information into notebook file. But notebook can be exported and imported into the Zeppelin instance that has different set of user/group exists. (either using import/export feature or copying notebook file into file system) So, do you have good idea to make note permission feature gracefully aware notebook portability? |
| data-ng-model="permissions"> | ||
| <p>Owners : <input ng-list ng-model="permissions.owners"> Owners can change permissions, read and write the note. </p> | ||
| <p>Readers : <input ng-list ng-model="permissions.readers"> Readers can only read the note.</p> | ||
| <p>Writers : <input ng-list ng-model="permissions.writers"> Writers can read and write the note.</p> |
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.
When each 'Owners', 'Readers', 'Writers' is empty, default behavior is allowing all.
But some people may confuse default behavior is deny all. So how about make user quickly catch the default behavior?
For example adding whildcard(*) at placeholder or any other way.
<input ng-model ..... placeholder="*"> ....
|
Hi Prasad, I also have similar opinion like Moon on the storing the permission. However your design so far looks reasonably good though. Here are my few comments/suggestions -
Hope this helps. Regards, |
|
@Leemoonsoo and @sourav-mazumder, I really appreciate your feedback. @Leemoonsoo,
I am not sure how to gracefully deal with permissions when notebooks are ported to a different Zeppelin server with different user and groups. One option is to delete permission information when we port so notes are accessible to anyone (the default case). We could save permissions information in a separate file. I have created https://issues.apache.org/jira/browse/ZEPPELIN-666 to track this issue. @sourav-mazumder, Regarding comment 2, it is not clear to me why user and group names allowed to access notebooks should be encrypted. We are not storing any credentials and only the zeppelin process can modify note permissions when a request is made by one of the note's owners. Btw, we have deployed Zeppelin with authentication and notebook authorization at Twitter and it is working well. We are using it mainly to access Vertica, Presto and Mysql databases. The top priority now is to authenticate users to these databases. We are implementing this by asking users for their database credentials and storing them in a secure way on the Zeppelin server. |
| </li> | ||
| <li> | ||
| <a href="#" data-toggle="dropdown" class="dropdown-toggle">Security<b class="caret"></b></a> | ||
| <ul class="dropdown-menu"> |
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.
| <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> |
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.
I think "#html" next to the {{BASE_PATH}}/security/authentication.html is not necessary.
|
Hi @prasadwagle : ) After applying this PR, I wanted to leave some comments about the documentation.
The above comments are just my personal opinion. So, please let me know if it's different with yours : ) |
|
Thanks for this great work. May I suggest a different design making Zeppelin Authorization much more fine grained and independent of the notebook structure. This design is described here https://gist.github.com/hayssams/0360288c715878aa43c2 |
|
Hi Prasad, This id to clarify little more on my original comment #2 to address your question. If you are storing authorization data in a plain text anyone (who has access to the file storing the note permission) can access that permission file through the OS and change it. Now in your design approach you can assume that the file containing the permissions for all notebooks would be stored in a folder that can be accessed only by an administrator (essentially the same person who has the permission to start/stop the zeppelin process). That approach is fine too and you don't need encryption in that case. However, key point is you need to have note permission stored in a separate file not in the actual notebook data. In either approach this is the prerequisite. Hope this helps. Regards, |
|
Hi Hayssams, I liked your approach. That is something very similar to what my initial comment was to Prasad's design. The points you have mentioned at the end of your document are the key considerations. Especially separating the permission of a notebook from actual content of the notebooks. My only suggestion would be that along with the option of storing the permissions in a database (using JDBC) one should also have the options of storing the same in a PAM file or LDAP. User should be able to pick and choose. This PR does not need to implement all of those options right now. May be starting with PAM file based approach would be good enough as long as that file is either encrypyted or stored in a folder which can be only accessed by Zeppelin admin (the person who can start and stop zeppelin). Regards, |
|
@sourav-mazumder |
|
Regarding portability of notebook authorization permission, Regarding authorizing interpreter, it is a good idea. Regarding independent notebook structure per user, |
|
@prasadwagle |
|
I just pushed the code that implement support for shiro authorization on websocket messages at hayssams@df43fb7 Please let me know if it makes sense before I push more code. |
|
@AhyoungRyu - I have fixed the documentation issues you reported. Thanks! @hayssams - Your design allows for fine-grained controls and is elegant. I am trying to figure out how I would make it work in my company where we have a homegrown authentication scheme described below. The LDAP server is locked down tight and I am not sure if the security team would allow Zeppelin to write to it.
We have made the implementation in this pull request work in my company environment by setting userAndRoles in the NotebookSocket constructor using the information in the authentication cookie.
It does not. We are mostly concerned with preventing users from viewing results in notes for which they don't have read permissions. We can create a separate issue to prevent users from viewing queries in notes for which they don't have read permissions. @Leemoonsoo's - I understand your concern regarding notebook portability and agree we should resolve ZEPPELIN-666 before the next release. |
|
Hi Prasad, In your organization if writing to enterprise level LDAP is not possible (though that is the right approach from Enterprise Architecture stand point), you can always use other options supported by Shiro (as described by hayssams) like storing that info in JDBC sink (to store the permission in a dedicated RDBMS) or in protected PAM file based. Regards, |
|
@prasadwagle Shiro already support permissions stored in an Ini file format and Properties file format on top on which you can base you implementation. |
|
Got it. Your suggestion to save notebook authorization information in a .ini file makes sense. In our company, we have an LDAP server with users and groups and we get user and group information for a connection in an authentication cookie. Let's say, we have a note "RevenueNote" with the following authorization information (finance-dev, finance and executives are groups with many users):
What is the best way to translate these permissions to the ini file format and make Shiro permission checks work with the users and group information I get from the authentication cookie? |
|
Okay, If i summarize my understanding, Then the next step would be change location of permission information from notebook to Shiro and it'll resolve https://issues.apache.org/jira/browse/ZEPPELIN-666. Right? And ci test failure need to be investigated and fixed to merge this PR. |
|
|
ZEPPELIN-666 is going to handle portability of notebook authorization permissions stored in note file. While we agree to resolve ZEPPELIN-666 and new issue related to search service before the next release, Looks good to me and merge if there're no more discussions. Thanks @prasadwagle for great work. |
|
i just want config someone can create/delete notebook ,someone can not see the interpreter page,how config the shiro.ini file |
Regarding this, please refer to Notebook Authorization setting document. But AFAIK, currently you can't control
Regarding this one, please see Shiro authentication#Secure your Zeppelin information section. I attached related docs links what you wondered. But please note that the docs link is for Hope this helps :) |
|
thanks @AhyoungRyu , I don't want analyst role can create/delete notebook |

What is this PR for?
The goal of the PR is to add authorization for notebooks according to the design document here.
The PR uses Shiro authentication.
What type of PR is it?
Feature
Todos
Is there a relevant Jira issue?
ZEPPELIN-549
How should this be tested?
Screenshots (if appropriate)
Screenshot
Questions: