-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
aws - cloudfront - wafv2-enabled fix to find resources which are associated with waf-classic acl #7986
aws - cloudfront - wafv2-enabled fix to find resources which are associated with waf-classic acl #7986
Conversation
@harishachappa , |
@cahn1 wafv2-enabled should return resources which are either not associated with any waf or associated with waf-classic but not wafv2. |
@harishachappa,
This policy checks if CF's web-acl is NOT '.FMManagedWebACLV2-?FMS-.’, then it will add to results. After reviewing the current code, this is my suggestion to support WAFv1 use cases. |
@cahn1
|
@harishachappa ,
=> This will return resources which are not associated with wafv2.
=> This will return resources which are not associated with specific wafv2 acl. |
I think part of the problem here is with the lack of documentation and the inconsistent behavior of the From what I understand,
Now to further filter things down, we should be able to use
The problem with this PR is that it doesn't work with scenario 4. What the code will do is that it will just return true if the specified web-acl does not exist. It doesn't even care about the resource we're trying to filter. To handle scenario 4, we would have to invert the filter and use the @ajkerrigan @kapilt @thisisshi thoughts on this? |
@darrendao, @cahn1, |
@harishachappa , I tested all combinations with the change and all working good! |
I think if that's the intended behavior @darrendao, it would probably be helpful to add those 4 sample cases as example policies to the docstring so it's clear to folks who try to use this. Case 4 wouldn't have been obvious to me for example - @harishachappa 's example with the One other thing that is probably worth an explicit mention in the docstring is how |
@ajkerrigan Updated examples to include more usecases |
@ajkerrigan, @kapilt, |
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.
This looks good to me. Thanks for the doc/example additions, I think they'll help a lot! 👍
@ajkerrigan @kapilt |
This change will fix #7985
for wafv2-enabled with state: False, check if resource has web_acl_id and if associated, check if that web_acl_id is from wafv2 or not.
web-acl for state: False should not be included in filter