Filter condition not removing offending security group rule when another rule already satisfies the condition #7427
Replies: 3 comments
-
Thanks for this issue report, the level of detail really helps follow what's going on in your policy! That If I'm reading your intent properly, one option might be building on the
Where the intent is "Allow 443 for most groups, but 443 & 80 for the apache case". |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation. I understood the filter to match on each individual SG rule, but instead it's actually matching the whole SG (all rules) instead. Is there a way for each SG rule to be evaluated separately? I did try that policy above however, but it didn't seem to work unfortunately. See trace below.
|
Beta Was this translation helpful? Give feedback.
-
The filters match at the resource level (whole SG in this case), but they also collect individual matching rules in a
Testing that policy locally I see this in my output:
So the whole group matches this collection of filters, but only the 9999 rule shows up in |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I have the following filter configured that is split into two parts.
Rule:
What did you expect to happen?
What should happen
When the SG is tagged correctly, I expect the rule with port 80 to be allowed and any other rule to be removed.
What is happening:
When adding multiple rules to a correctly tagged SG, and one of those rules is port 80 & 0.0.0.0/0 both rules are being allowed, when in actual fact the rule that allows a port that is not port 80 should be removed.
For example:
I add the following two rules:
Both rules are allowed to stay, however I expected the Port 9999 rule to be removed.
Cloud Provider
Amazon Web Services (AWS)
Cloud Custodian version and dependency information
Policy
Relevant log/traceback output
Extra information or context
No response
Beta Was this translation helpful? Give feedback.
All reactions