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

Changing handling of StringNotLike in Conditions #163

Open
tweedge opened this issue Oct 10, 2022 · 0 comments
Open

Changing handling of StringNotLike in Conditions #163

tweedge opened this issue Oct 10, 2022 · 0 comments

Comments

@tweedge
Copy link
Contributor

tweedge commented Oct 10, 2022

From Policy Universe's statement.py, there's a lengthy comment on StringNotLike et al:

Extracts any ARNs, Account Numbers, UserIDs, Usernames, CIDRs, VPCs, and VPC Endpoints from a condition block. Ignores any negated condition operators like StringNotLike. Ignores weak condition keys like referer, date, etc. Reason: A condition is meant to limit the principal in a statement. Often, resource policies use a wildcard principal and rely exclusively on the Condition block to limit access. We would want to alert if the Condition had no limitations (like a non-existent Condition block), or very weak limitations. Any negation would be weak, and largely equivalent to having no condition block whatsoever.

My personal opinion is that this is worth avoiding, but in the interest of guiding people from poor to better practices (and explaining why along the way), I believe it would also be worthwhile to expose this opinion more directly. For example, this could take several forms:

  • Exposing some sort of "Policy Uses Bad Practices" check, or
  • Modulating internet accessibility results with a boolean to allow/disallow bad practices (leaving the default as "disallow bad practices"), or
  • Other currently unknown solutions?

If I created a PR for any of the above, would Policy Universe team support its inclusion? If so, let me know which ones!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant