-
Notifications
You must be signed in to change notification settings - Fork 4k
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-ec2): restrictDefaultSecurityGroup does not remove IPv6 egress rule #29709
Comments
Regardless of the Lines 27 to 37 in fff9cf6
|
I have also observed this.
I think that routine needs to do 2 things:
In the second case there, if it's not dual stack, then it should not add |
Thanks @jpickwell for bringing up this issue and thanks @mwebber and @nmussy for the suggestions. For VPCs that are not with I think we should handle this with another new feature flag to remove the IPv6 egress rule in DUAL_STACK VPC, since making this change directly in the existing flag would be a breaking change - some customers may be relying on the default security group's IPv6 egress rule in their applications. Please feel free to raise a PR. |
I don't think that's strictly true. Some of our VPCs were created before The "correct" solution to this is for CloudFormation to add support for creating the default security group as empty. |
Hi @mwebber,
Yes you are right. The presence of IPv6 ::/0 rules in the default security group is tied to whether the VPC has an IPv6 CIDR block associated with it, regardless of how that association was made (whether through DUAL_STACK or other methods).
I agree that having native CloudFormation support would be the ideal solution. However, since we don't have visibility into when/if this might be supported by the service team, and we already have a custom resource handling the behavior, extending with a feature flag seems like a practical easier solution. |
Describe the bug
Setting restrictDefaultSecurityGroup to true for a dual-stack VPC will not remove the IPv6 egress rule.
Expected Behavior
For a dual-stack VPC with restrictDefaultSecurityGroup set to true, all (IPv4 and IPv6) ingress and egress rules should be removed.
Current Behavior
For a dual-stack VPC with restrictDefaultSecurityGroup set to true, only IPv4 ingress and egress rules are removed.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.135.0 (build d46c474)
Framework Version
No response
Node.js Version
v20.12.0
OS
macOS Sonoma 14.4.1 (23E224)
Language
TypeScript
Language Version
TypeScript (5.4.3)
Other information
No response
The text was updated successfully, but these errors were encountered: