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

fix(elasticloadbalancingv2): open, dual-stack-without-public-ipv4 ALB does not allow IPv6 inbound traffic (under feature flag) #32765

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gracelu0
Copy link
Contributor

@gracelu0 gracelu0 commented Jan 7, 2025

Issue # (if applicable)

Closes #32197 .

Reason for this change

Default generated security group ingress rules for open, dual-stack-without-public-ipv4 ALB does not allow IPv6 traffic. Only a rule for IPv4 ingress traffic is added to the security group rules currently.

Description of changes

Introduced a new feature flag which is enabled by default so that default generated security group ingress rules now have an additional rule that allows IPv6 ingress from anywhere.

Describe any new or updated permissions being added

No new IAM permissions. Added IPv6 security group ingress rules for open, internet-facing ALBs if IP address type is dual-stack-without-public-ipv4 and feature flag is set to true (default).

Description of how you validated changes

Added unit test which checks the security group rules for both cases where feature flag is enabled/disabled. Updated integration test snapshot.

Checklist


Co-authored-by: Clare Liguori [email protected]

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Jan 7, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team January 7, 2025 00:47
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 7, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@@ -218,7 +220,8 @@ Here is an example of a `cdk.json` file that restores v1 behavior for these flag
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false,
"@aws-cdk/pipelines:reduceAssetRoleTrustScope": false,
"@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": false,
"@aws-cdk/core:aspectStabilization": false
"@aws-cdk/core:aspectStabilization": false,
"@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature flags with recommended value and default value set to true are getting added here even though they should not be. This section is for v1 feature flags where the behaviour changed. Will open a separate PR to fix this.

@gracelu0 gracelu0 requested a review from samson-keung January 7, 2025 00:50
@gracelu0 gracelu0 added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jan 7, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 7, 2025 00:51

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@gracelu0
Copy link
Contributor Author

gracelu0 commented Jan 7, 2025

@Mergifyio update

Copy link
Contributor

mergify bot commented Jan 7, 2025

update

✅ Branch has been successfully updated

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.37%. Comparing base (946b748) to head (7c5dc35).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32765   +/-   ##
=======================================
  Coverage   81.37%   81.37%           
=======================================
  Files         222      222           
  Lines       13693    13693           
  Branches     2412     2412           
=======================================
  Hits        11143    11143           
  Misses       2271     2271           
  Partials      279      279           
Flag Coverage Δ
suite.unit 81.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 80.68% <ø> (ø)
packages/aws-cdk-lib/core 82.09% <ø> (ø)

@gracelu0 gracelu0 force-pushed the dual-stack-ipv6-feature-flag branch from 9e01387 to 7c5dc35 Compare January 7, 2025 01:43
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 7c5dc35
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 7, 2025
@samson-keung samson-keung self-assigned this Jan 7, 2025
@@ -303,7 +303,9 @@ export class ApplicationListener extends BaseListener implements IApplicationLis

if (props.open !== false) {
this.connections.allowDefaultPortFrom(ec2.Peer.anyIpv4(), `Allow from anyone on port ${port}`);
if (this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK) {
if (this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK ||
(this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend updating the doc for IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 to mention how it behaves differently depending on the feature flag.

Using a feature flag to make sure existing customers who might be relying
on the overly restrictive permissions are not broken.`,
introducedIn: { v2: 'V2NEXT' },
defaults: { v2: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe setting the default to true means existing projects will automatically have this feature flag as true, which means they will get the new behaviour automatically, which is a breaking change. Can you double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Samson, you're correct that they would automatically get the new ingress rules upon re-deploying. I set the default to true thinking we would want new projects to setup the ingress rules to allow IPv6 by default, but it looks like that is what the recommended value is for. Will update.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
3 participants