-
Notifications
You must be signed in to change notification settings - Fork 75
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
Security #145
Security #145
Conversation
The first pass at security is in. Looking at how to incorporate this into yokozuna, whatever that may mean. |
What is a "default type index"? Is that a bucket type or security type? Also, if I'm reading this correctly. Where we currently use the name "bucket" in security it will actually stand for "index" when granted one of the
I'm not sure I understand this fully. Are you saying that, if we add an "index" type to security that we should prevent a user from creating a bucket type with the name "index" because that would just confused things? |
Bucket type. There's no such thing as a security type.
I'm not sure what other example you're asking for. This is standard command line:
This is an example for adding search permission to the
Or for all indexes
Yep. |
So "index" is a bucket type? I think I still fundamentally don't understand bucket types. To me a bucket type is a way for many buckets to share the same properties in an efficient manner. I don't see the usefulness or sense in having an index bucket type because that assumes all buckets want to use the same index. I.e. if you had the In the security example, |
You're way overthinking this. Security operates on 2-tuples, of riak_core_security doesn't know about bucket types, or anything, it is So if you used something like "yz_index" as 'ThingOne', and made the GRANT riak_search.get ON yz_index TO andrew So I can read ANY index, but I can only edit the schema on the 'myindex' Point is, this actually has nothing to do with bucket types. Andrew |
Sorry @Vagabond, as you were typing this, we had taken this conversation into mumble. I think everything is getting cleared up. |
#rpbyokozunaschemaputreq{} -> | ||
{ok, Msg, {"yokozuna.schema", ?YZ_SECURITY_THING_ONE}}; | ||
#rpbyokozunaschemagetreq{} -> | ||
{ok, Msg, {"yokozuna.schema", {?YZ_SECURITY_THING_ONE}}}; |
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.
These should not be wrapped in a tuple. it should be like #rpbyokozunaschemaputreq{} and #rpbyokozunaindexdeletereq{}
See an example:
https://github.com/basho/riak_kv/blob/develop/src/riak_kv_pb_bucket.erl#L71
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, typo
If you want to just fix the typo (which maybe the test should have caught?) I can live with the permission structure you've chosen. |
The tests pass (I tested against this branch with a fresh merge of develop), that's a good sign. Still need to run benchmarks and run through the code. This will not make the tech preview.
|
Is this output from
Here is after I add the search grant. It seems like maybe that second column should have a more generic title. But I'm not sure what that is.
|
I plan to have something like letting applications register permissions with an associated 'granularity', so kv could use 'buckets' and yz could use 'indexes' and we could print seperate tables for seperate granularities. |
Benchmark results are in. In general indexing performance drops by about 3% with security enabled. Query by about 6%. And the patch itself doesn't seem to add any overhead. I only benchmarked protocol buffers but I would hope HTTP isn't much different. Most of the cost should be in connection establishment. Which, by the way, takes much longer now. Long lived connections will be vital with security enabled. Indexing Results
Query Results
Before/After PatchI wanted to make sure that the patch itself didn't incur any overhead. These results show that before the patch and with the patch with security off the results are the same. This is good.
|
So I've been looking at the grants for Yokozuna and I'm not sure they really make sense to me. E.g. granting the permission Here's the break down of Type (Thing-1) and associated grants that make sense to me. Thing-2 is used as a specific instance of the type. For most grants it probably only makes sense for that to be
Here are some examples that I had in mind.
I realize that this may not be feasible at the moment given implementation details but I really think it should look like something above. Now, if the permission need to be namespaced, e.g. |
After another tea-party gab session, we've agreed to change the index/schema permission names to one permission
|
After some discussion in backchannel with @coderoshi we came to the following solution.
The The This would produce the following examples.
|
Previously, permissions were search,index,schema. Search remains the same, but now admin is a permission for either the index or schema type.
Conflicts: src/yz_app.erl
+1 to merge. |
Added two new permissions:
The first permission is read access for an index. Currently it does not support types, only bucket name which represent an index. After speaking with @Vagabond I'm going to expand this to support a default type
index
, so you could grant a user search access like this:riak-admin security grant yokozuna.search ON index indexName TO userName
We may wish to make this a reserved word for bucket types.
The admin permissions are universal per type index or schema. Meaning, you have access to index, you can read, list, create and delete them. For example:
riak-admin security grant yokozuna.admin ON index TO userName
riak-admin security grant yokozuna.admin ON schema TO userName
We may find a need to break these up later into more fine-grained permissions, but that seems a bit overzealous at this point in time, because it would potentially turn yokozuna's 3 permissions into 7.