-
Notifications
You must be signed in to change notification settings - Fork 172
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
Update ACL config format to support AND/OR logic between subjects #1200
Update ACL config format to support AND/OR logic between subjects #1200
Conversation
@Mallets This is ready for review. |
In SOTA, the access control policy (singular) is the set of rules applied to subjects, so calling it |
@gabrik |
I'm against implicit things, because if that applies for But I'm fine that to have this behavior for 1.0.0 and change for the next 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.
I would rename "declare_subscriber" to "subscriber_declaration", "declare_queryable" to "queryable_declaration", "put" to "publication" and "get" to "query".
The idea is to use nouns instead of verbs now that we think of these as data and not actions.
This is more a matter of opinion so overall this LGTM 🚀
If we move to |
@Mallets If we're talking about the API names then let's not forget that It is not enough for the message names to reflect the API of the subject impacted by If I was a user it would be immediately clear to me that a rule with on message The message names cannot match the API calls of subjects on both ingress and egress sides. If they match either one, then the naming is misleading for the other. Thus the names ought to be abstracted over both. |
The mapping has nothing to do with Rust types but with the Zenoh API and semantics. Here we are defining a config that can be loaded by a C/C++/Python/Java/Kotlin application. All those languages consistently define |
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.
with reserve to improve the semantic in the future.
i.e, split between get
and query
reply
You mean |
Yup |
@Mallets My argument wasn't centered around the Rust API names, I was just giving examples. Consider the following ACL rule: {
"id": "deny-get-egress",
"flows": ["egress"],
"messages": ["get"],
"permission": "deny",
"key_exprs": ["test/1"]
} If What are the semantics of denying "get" messages1 from reaching S? The word "get" refers to the Zenoh API operation Here we are trying to configure whether or not queries can reach S, the semantics are more clearly expressed in terms of data in this case, not API operations. Thus "operations" do not capture the semantics of Footnotes
|
This PR reworks the ACL config to support boolean combinations of subjects. An examples of the new config format is the following:
Within each subject, a cartesian product is performed to produce the
(interface, cert_common_name, username)
combinations. Each combination is a logicalAND
between its components, and different combinations within the same subject in thesubjects
list represent a logicalOR
between them.Rules are declared seperately, and applied to these subject logical combinations in the
policies
list. Unique identifiers (id
fields) are used to represent the subjects and rules in thepolicies
.