-
Notifications
You must be signed in to change notification settings - Fork 17
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
Could we leverage an AST to pinpoint generation of RBAC rules #1214
Comments
Pretty much everything I know about ASTs (which, admittedly, is very little) comes from wikipedia but from what it looks like to me, ASTs are mostly applied within a single, known domain -- like, used to parse a single code language into an abstract representation for a compiler to massage into a different more computer-y shape. Meaning the AST has to understand the syntax of what it's being loaded to rep, right? At least well enough to represent it in full (if abstract) detail, and... that feels pretty different than the challenge we're facing here. While a module author is required to use ts to write their module, they're not restricted in what they can do with it -- it's really easy for them to escape the scope of what a simple (or any single?) AST could represent. Examples of escaping would include:
All of those scenarios (and I'm sure many more), would lead to the situation where we're somehow trying to interpret what kinds of activity (API call or otherwise) an (essentially) opaque, external process is going to perform, before they perform it, so that we can generate rules about what we'll allow them to do in-cluster. And... I kinda don't think that's gonna be achievable, ASTs or not, given the scope of the challenge. |
As for other options, things that come to mind include:
^-- all of which would require custom development on our part, make the module author dev flow harder/longer, and/or would restrict freedom of action for a module author pretty severely (at least, compared to what's available now). |
Is your feature request related to a problem? Please describe.
npx pepr build --rbac-mode=scoped
will generate RBAC based on the bindings. What happens in the callbacks however is a blind spot. The question is if we can build a parser assuming only the use of KFC to parse through API calls to generate rules that include the callbacksDescribe the solution you'd like
--rbac-mode=scoped
ClusterRoles
andRoles
based on that. (Doesn't necessarily have to use an AST if there is another way)Describe alternatives you've considered
not sure, maybe eslint is a starting point to see how they do it
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: