Skip to content
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

Compile action list down to the smallest possible pattern #3

Closed
udondan opened this issue Jun 21, 2020 · 3 comments · Fixed by #48
Closed

Compile action list down to the smallest possible pattern #3

udondan opened this issue Jun 21, 2020 · 3 comments · Fixed by #48
Labels
effort: large enhancement New feature or request

Comments

@udondan
Copy link
Owner

udondan commented Jun 21, 2020

While it is great to automatically list all actions when working with access levels, it would be great to have an option to compile the list down to a pattern.

This should be implemented as an optional method call. It's a nice feature to reduce the policy size, but might have security related implications if new actions are added in the future.

Example:

new statement.S3()
  .allow()
  .allActions(statement.AccessLevel.READ)
  .condense();

Should result in actions ['s3:List*', 's3:Describe*', 's3:Get*']

@udondan udondan added this to the v1.0.0 milestone Jun 21, 2020
@udondan udondan added the enhancement New feature or request label Jun 21, 2020
@udondan udondan removed this from the v1.0.0 milestone Jul 2, 2020
@udondan
Copy link
Owner Author

udondan commented Jul 2, 2020

This seems to be a quite complex problem. There are a couple of libraries finding the longest common subtrings see:

Though what we need is to find:

  • the smallest common substrings of list A (actions we selected)
  • that do not match any items of list B (actions we did not select)
  • logically split list A into multiple lists if no common patterns could be found in A, that don't match anything in B

Other interesting tools:

Due to the complexity of this problem, I removed it form the v1.0.0 milestone.

@skorfmann
Copy link

This would be fantastic! Still plans to tackle that?

@skorfmann skorfmann mentioned this issue Dec 6, 2020
@udondan
Copy link
Owner Author

udondan commented Dec 6, 2020

Yeah, but I haven't had a good idea so far. 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: large enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants