question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When creating a security group, allowAllOutbound parameter seems to be ignored

See original GitHub issue

When I create a security group and specify allowAllOutbound=false, a security group with the default egress rule that allows all ports is created anyway. It is called …InstanceSecurityGroup… I can’t find a way to change that.

const securityGroup = new ec2.SecurityGroup(parent, 'SecurityGroup', {
            vpc,
            description: 'xxxx',
            allowAllOutbound: false
        });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
areedtomlinsoncommented, Aug 18, 2020

@varunshaji @moehlone The outbound rule you’re seeing (ICMP 252, port 86, destination 255.255.255.255/32) is intentionally set here: https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/aws-ec2/lib/security-group.ts#L509 From the comments:

This is used in order to disable the "all traffic" default of Security Groups.

No machine can ever actually have the 255.255.255.255 IP address, but
in order to lock it down even more we'll restrict to a nonexistent
ICMP traffic type.

Apparently there has to be some rule set to override the “allow all” default. Same net effect as having no outbound rules, just more confusing when you first notice it.

1reaction
fabiopaivacommented, Apr 28, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

When creating a security group, allowAllOutbound parameter ...
When I create a security group and specify allowAllOutbound=false, a security group with the default egress rule that allows all ports is ...
Read more >
Security Group Examples in AWS CDK - Complete Guide
A complete example of how to create a Security Group in AWS CDK, and edit its inbound and outbound rules.
Read more >
CDK EC2 SecurityGroup - AWS Documentation - Amazon.com
No information is available for this page.
Read more >
Amazon EC2 instance can't update or use yum - Stack Overflow
Looks like the host is having trouble contacting the yum server. Make sure the instance has outbound internet access (check security groups etc)....
Read more >
Cdk use existing vpc - Seba Online
The build and deployment of the application if fully automated using AWS CDK. ... Create a VPC; Create a security group and add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found