-
Notifications
You must be signed in to change notification settings - Fork 10
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
EB Managed security groups for ALB's have ALL (0.0.0.0/0) addresses allowed instead of instance security groups as target. #328
Comments
Hello @CmhDevFor ,
The following .ebextensions configuration files was tested in my own environment. I would ask you to update the
Overall, I would like to note that the Hope it helps! References: |
When I originally told it to use my own supplied security group, it properly attached mine, but also added the managed one with full outbound for the first environment. I have not tried again since so maybe this bug was corrected. Would it not be possible to add a second managed group for those that have 60+ environments? Forcing people to either have it fully open OR figure out the bootstrapping and remember to remove the default one that is attached seems the least desirable outcome considering I imagine there are more people who have < 60 environments, rather than just
Having any default behavior be full allow connected to a resource which is allowed traffic in from the internet is a recipe for mistakes even when you have customizations that can mitigate it. Edit: Thank you for the surprisingly thorough answer. I appreciate it. |
Hello @CmhDevFor , Thanks for your understanding! I try my best to provide some assistance when possible and hope to bring clarification as I enjoy using this service but there is always room for good ideas and/or solutions to uncover! Question # 1: "When I originally told it to use my own supplied security group, it properly attached mine, but also added the managed one with full outbound for the first environment. I have not tried again since so maybe this bug was corrected." Response:
Question # 2:
Having any default behavior be full allow connected to a resource which is allowed traffic in from the internet is a recipe for mistakes even when you have customizations that can mitigate it." Response: Since the Shared Application Load Balancer has to be created first in order for it to be used with an environment. The responsibility falls on the user to ensure all proper components or properties meet their desired requirements or specifications. The managed security group ( In addition, it avoids encountering the "Chicken or the egg" dilemma as when a user does supply their own security group.. they are unaware of the environments EC2 security group as it has not been created or does not exists yet. Hence, the .ebextensions configuration file solution come into the picture to circumvent the managed security group being added. However, I agree there is room for improvement with the documentation to provide guidance and insight on this topic. Lastly, an Application Load Balancer resource is limited up to 5 security groups. As a result, adding a specific managed security group for each environment or creating a secondary managed security group to over come the quota limit to the load balancer would quickly reach a limitation in this aspect. Also, it opens additional complexity such as a user may not want all of their available/open security groups spots to be used by the service for various reasons so accommodation for all use-cases needs to be considered. Overall, I hope the above is helpful and it assists others as well! |
Community Note
Tell us about your request
When creating an elastic beanstalk environment configured with a shared application load balancer, the environment creates a managed security group (SG_LB) on the load balancer with the below rules and a second security group for the instances (SG_IN)
The current SG_LB rules allow all traffic from the load balancer to go anywhere. For an internet facing load balancer this is unacceptable. See AWS guidelines (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-update-security-groups.html)
Current Generated Rules
SG_LB
Inbound Rules: None (It rightly assumes a shared load balancer has a default group with ingress port rules already)
Outbound Rules:
SG_IN
Inbound Rules:
What SG_LB should be
Outbound Rules (Example has an elastic beanstalk instance port 80 set, but this should be an entry for each port specified in the environment configuration for instances):
Is this request specific to an Elastic Beanstalk platform?
If so, which one(s)? Any environment with a shared load balancer configuration
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now? What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem.
This is a default configuration issue. It can be manually corrected but should be fixed in EB.
Are you currently working around this issue?
How are you currently solving this problem?
Manually editing rules.
Additional context
Anything else we should know?
Attachments
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)
The text was updated successfully, but these errors were encountered: