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

Creating ENI and security group attachments separately leaves the default security group on the ENI #9323

Open
ghost opened this issue Jul 12, 2019 · 3 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@ghost
Copy link

ghost commented Jul 12, 2019

This issue was originally opened by @dead10ck as hashicorp/terraform#22051. It was migrated here as a result of the provider split. The original body of the issue is below.


When you define a aws_network_interface and its security group attachments separately in aws_network_interface_sg_attachments, it first creates the ENI with no security groups, which causes the AWS API to add the VPC's default security group. Then it attaches the other security groups to the existing ENI, but it leaves the default security group in place.

This can lead to a situation where the user thinks they have defined all the exact security groups they wanted attached to the ENI, but in fact, there is one more.

What's worse is that the default security group essentially says "allow all traffic on any port for anything else in the default security group," which means all EC2 nodes created with this pattern will inadvertently have full network access to each other.

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 12, 2019
@aeschright aeschright added the service/ec2 Issues and PRs that pertain to the ec2 service. label Aug 2, 2019
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jul 23, 2021
@dead10ck
Copy link

Has this issue been fixed? Just because no dev has triaged or looked into the bug does not mean it doesn't exist or isn't important. I can appreciate that this project probably gets a lot of issues that can be difficult to keep up with, but automatically closing issues because there has been no activity is a very counterproductive way to comb the backlog.

@github-actions github-actions bot removed the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jul 24, 2021
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 17, 2021
@based3
Copy link

based3 commented Jan 26, 2022

Also facing the issue with TF 1.1.4 and AWS prov 3.73.0:
The default SG is added with the expected customized SG on an ENI EC2 case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

4 participants