gravitational / predicate-lang

Predicate - Access Control System
Apache License 2.0
3 stars 2 forks source link

RFD for Linter #62

Closed flyinghermit closed 1 year ago

flyinghermit commented 1 year ago

RFD 2 - Linter

(Reserving RFD 1 for https://github.com/gravitational/predicate-lang/issues/53)

Rendered file

xacrimon commented 1 year ago

This looks good to me but I also haven't yet worked out any strong opinion on how this should work precisely. So at least wait for input from @klizhentas too as he may have a somewhat more fleshed out opinion on this.

flyinghermit commented 1 year ago

@klizhentas friendly ping for review 👀

flyinghermit commented 1 year ago

@klizhentas, currently, the no_allow rule describing AccessNode(User.name == "root") will not match AccessNode(User.name == "root" | User.name == "alice") because we are using the z3 equivalent query.

The pros of equivalent query are:

But down the line, I think to support direct match (like search in string?) as well as this will let to forbid usage of certain usernames or groups altogether, no matter how the rule is defined. E.g. given the rule User.name == "root", match AccessNode(User.name == "root" | User.name == "alice").