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

[ec2] allow_to for IPv6 has no effect on connections #9017

Closed
gergnz opened this issue Jul 11, 2020 · 2 comments
Closed

[ec2] allow_to for IPv6 has no effect on connections #9017

gergnz opened this issue Jul 11, 2020 · 2 comments
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud guidance Question that needs advice or information.

Comments

@gergnz
Copy link
Contributor

gergnz commented Jul 11, 2020

Unable to allow all outbound/egress traffic for IPv6 on a connection class.

Reproduction Steps

asg = asg.AutoScalingGroup(self, "asg",
                vpc=vpc,
                instance_type=ec2.InstanceType('t3a.nano'),            
                machine_image=ec2.MachineImage.latest_amazon_linux(generation=ec2.AmazonLinuxGeneration('AMAZON_LINUX_2')))

asg.connections.allow_to(ec2.Peer.any_ipv6(),ec2.Port.all_traffic())

Error Log

No error is produced.

Environment

  • **CLI Version: 1.51.0 (build 8c2d53c)
  • **Framework Version: aws-cdk.aws-ec2 1.51.0
  • **Node.js Version: v12.8.0
  • **OS : MacOS 10.15.5 (19F101)
  • **Language (Version): Python 3.7.7

Other

Expected Result:

        "SecurityGroupEgress": [
          {
            "CidrIp": "0.0.0.0/0",
            "Description": "Allow all outbound traffic by default",
            "IpProtocol": "-1"
          },
          {
            "CidrIp": "::/0",
            "IpProtocol": "-1"
          }
        ],

Actual Result:

        "SecurityGroupEgress": [
          {
            "CidrIp": "0.0.0.0/0",
            "Description": "Allow all outbound traffic by default",
            "IpProtocol": "-1"
          }
        ],

This is 🐛 Bug Report

@gergnz gergnz added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 11, 2020
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jul 11, 2020
@SomayaB SomayaB assigned ericzbeard and unassigned rix0rrr Jul 13, 2020
@ericzbeard ericzbeard added p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 15, 2020
@ericzbeard ericzbeard assigned NetaNir and rix0rrr and unassigned ericzbeard Jul 15, 2020
@NetaNir NetaNir added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 15, 2020
@NetaNir
Copy link
Contributor

NetaNir commented Jul 15, 2020

The SecurityGroupEgress resource is created by the configuration set on the AutoScalingGroup default SecurityGroup, which is created when no SecurityGroup is provided to the AutoScalingGroup constructor. By default, all IPV4 traffic is allowed (we have an issue #7094 to change the default behavior to allow IPV6 & IPV4 by default). You can set custom rules by providing a SecurityGroup to the AutoScalingGroup:

const securityGroup = new ec2.SecurityGroup(stack, 'Resource-Security-Group', { vpc,
  allowAllOutbound: false
})
securityGroup.addEgressRule(Peer.anyIpv6(), Port.allTraffic())

new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO),
  machineImage: new ec2.AmazonLinuxImage(),
  securityGroup,
});

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 16, 2020
@NetaNir NetaNir added guidance Question that needs advice or information. and removed bug This issue is a bug. p1 labels Jul 16, 2020
@NetaNir
Copy link
Contributor

NetaNir commented Jul 16, 2020

Im closing this as duplicate of #7094 as it will prevent the need to actually add the "allow traffic from Ipv6"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

4 participants