Skip to content

SPLAT-2452: Add SetSecurityGroups IAM permission to master nodes for BYO SG support for AWS NLBs#10512

Open
mfbonfigli wants to merge 2 commits intoopenshift:mainfrom
mfbonfigli:SPLAT-2452_add-set-security-groups-iam-permissions
Open

SPLAT-2452: Add SetSecurityGroups IAM permission to master nodes for BYO SG support for AWS NLBs#10512
mfbonfigli wants to merge 2 commits intoopenshift:mainfrom
mfbonfigli:SPLAT-2452_add-set-security-groups-iam-permissions

Conversation

@mfbonfigli
Copy link
Copy Markdown

@mfbonfigli mfbonfigli commented Apr 22, 2026

Context

As part of the new Bring Your Own Security Groups (BYO SG) for AWS Network Load Balancers (NLBs) feature currently under review in upstream, it is required to add a new elasticloadbalancing:SetSecurityGroups permission to the role used by AWS CCM to interact with AWS APIs.

The elasticloadbalancing:SetSecurityGroups permission is required to enable AWS CCM to change the security groups associated with Network Load Balancers without deleting and recreating the NLB, which is not viable.

Without this permission, the following operations are not possible:

  • Changing BYO security groups
  • Transition from managed to BYO Security Group
  • Transition from BYO Security Group to managed

The new permission is similar to elasticloadbalancing:ApplySecurityGroupsToLoadBalancer which is already present and required to edit BYO Security Groups associated with Classic Load Balancers (CLBs).

The upstream kOps Kubernetes infrastructure provisioning tool has been already updated to add the required permission: kubernetes/kops#18211

References:

Summary by CodeRabbit

  • Bug Fixes
    • Restored missing AWS load balancer security group management permission for cluster master nodes, resolving failures when updating or assigning security groups to load balancers and improving reliability of cluster load balancer operations.

Adds the elasticloadbalancing:SetSecurityGroups IAM permission
to master nodes, which is required for the BYO Security Groups
feature for AWS Network Load Balancers on AWS CCM.
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 22, 2026

@mfbonfigli: This pull request references SPLAT-2452 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Do Not Merge / Work In Progress

This PR adds the elasticloadbalancing:SetSecurityGroups IAM permission to master nodes, which is required for the BYO Security Groups feature for AWS Network Load Balancers on AWS CCM.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 22, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 22, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 129c3355-2f53-4dc3-ba47-8402afb2f1dc

📥 Commits

Reviewing files that changed from the base of the PR and between f0c7b3e and 1a7476b.

📒 Files selected for processing (1)
  • upi/aws/cloudformation/03_cluster_security.yaml
✅ Files skipped from review due to trivial changes (1)
  • upi/aws/cloudformation/03_cluster_security.yaml

Walkthrough

Updated the inline IAM policy for the AWS cluster API master role to add the ELB permission elasticloadbalancing:SetSecurityGroups. No other logic, control flow, resources, or role selection were modified.

Changes

Cohort / File(s) Summary
IAM Policy — Go
pkg/infrastructure/aws/clusterapi/iam.go
Added elasticloadbalancing:SetSecurityGroups to the master role's inline IAM policy Action list.
IAM Policy — CloudFormation
upi/aws/cloudformation/03_cluster_security.yaml
Added elasticloadbalancing:SetSecurityGroups to the MasterIamRole policy document's ELB-related actions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding the SetSecurityGroups IAM permission to master nodes for AWS NLB support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR modifies infrastructure and IAM configuration files only, not test files. No Ginkgo test declarations are present in the modified code.
Test Structure And Quality ✅ Passed The custom check for "Test Structure and Quality" is not applicable to this PR as it contains no Ginkgo test code changes.
Microshift Test Compatibility ✅ Passed PR does not add any new Ginkgo e2e tests, only modifies IAM policy configurations. Custom check applies only when new tests are introduced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any Ginkgo e2e tests. The changes are purely infrastructure configuration files: one Go source file and one CloudFormation template that add the elasticloadbalancing:SetSecurityGroups action to existing IAM policy documents.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only IAM policy documents for AWS master node roles by adding elasticloadbalancing:SetSecurityGroups permission. No Kubernetes manifests, scheduling constraints, or topology-related configurations present.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is not applicable to this PR; changes are only in infrastructure configuration files with no stdout-writing operations.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests found in this PR. Changes are limited to infrastructure configuration files adding IAM permissions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@mtulio mtulio left a comment

Choose a reason for hiding this comment

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

Thanks for submitting PR, I think it makes sense as CCM uses CP instance profile.

PTAL to the detected policies by SREP-3643 and if it would be required too here, looks like some are not included to the master profile as well.

Also for follow up:

@mfbonfigli mfbonfigli changed the title DNM/SPLAT-2452: Add SetSecurityGroups IAM permission to master nodes SPLAT-2452: Add SetSecurityGroups IAM permission to master nodes for BYO SG support for AWS NLBs Apr 29, 2026
Adds the elasticloadbalancing:SetSecurityGroups permissions to the UPI
cloudformation template, required for the AWS CCM BYO Security Group
feature for AWS Network Load Balancers.
@mfbonfigli
Copy link
Copy Markdown
Author

mfbonfigli commented Apr 29, 2026

Thanks for submitting PR, I think it makes sense as CCM uses CP instance profile.

PTAL to the detected policies by SREP-3643 and if it would be required too here, looks like some are not included to the master profile as well.

Also for follow up:

* We need to make sure OCP docs is updated with new set of permissions (follow up card from your Epic)

* review/update the UPI assets: https://github.com/openshift/installer/blob/0bd82bcf655ac45ef86432b5370d6dbf9e9fedcf/upi/aws/cloudformation/03_cluster_security.yaml#L489

* I think we need to review the CAPA IAM too: https://github.com/openshift/installer/blob/0bd82bcf655ac45ef86432b5370d6dbf9e9fedcf/pkg/infrastructure/aws/clusterapi/iam.go#L98-L99

Thanks for submitting PR, I think it makes sense as CCM uses CP instance profile.

PTAL to the detected policies by SREP-3643 and if it would be required too here, looks like some are not included to the master profile as well.

Also for follow up:

* We need to make sure OCP docs is updated with new set of permissions (follow up card from your Epic)

* review/update the UPI assets: https://github.com/openshift/installer/blob/0bd82bcf655ac45ef86432b5370d6dbf9e9fedcf/upi/aws/cloudformation/03_cluster_security.yaml#L489

* I think we need to review the CAPA IAM too: https://github.com/openshift/installer/blob/0bd82bcf655ac45ef86432b5370d6dbf9e9fedcf/pkg/infrastructure/aws/clusterapi/iam.go#L98-L99

Thanks @mtulio , I updated the PR to include the UPI template. Will work on updating the openshift documentation as a separate task.

@mfbonfigli mfbonfigli marked this pull request as ready for review April 29, 2026 14:12
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 29, 2026
@openshift-ci openshift-ci Bot requested review from mtulio and patrickdillon April 29, 2026 14:15
Copy link
Copy Markdown
Contributor

@mtulio mtulio left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments.

/lgtm

@mfbonfigli can we trigger e2e-aws workflow with /testwith PRs on downstream?

/hold

Hey Patrick and Thuan, would you mind taking a look? Thanks
FWIW as mentioned in the PR description, this change is required by CCM, which currently is still using the IAM Role/Profile's policy of Control Plane, as this is a core component, and feature is enabled by default when shipped, we can't evaluate conditionals on install-config to group it.

/assign @tthvo @patrickdillon

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2026
@mfbonfigli
Copy link
Copy Markdown
Author

/retest

@mfbonfigli
Copy link
Copy Markdown
Author

/test e2e-aws-ovn-heterogeneous

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

@mfbonfigli: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-heterogeneous 1a7476b link false /test e2e-aws-ovn-heterogeneous

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Copy Markdown
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

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

/approve

Since the feature is enabled in Default clusters, this change looks good to me 👍 I also cross-referenced with permissions required by CAPA to call ApplySecurityGroupsToLoadBalancer 👇

"elasticloadbalancing:SetSecurityGroups",

As Marco said, we definitely should ensure openshift docs reflect this new permission, especially if the users bring their own IAM roles/profiles to control plane machine pool.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tthvo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2026
@tthvo
Copy link
Copy Markdown
Member

tthvo commented May 4, 2026

@mfbonfigli @mtulio maybe you guys can add the verified label? I'll leave the hold for Patrick to have a look :D

@mfbonfigli
Copy link
Copy Markdown
Author

Thanks for the review @tthvo! will work on a separate PR to update the Openshift Documentation and will coordinate with @mtulio about the label!

@mtulio
Copy link
Copy Markdown
Contributor

mtulio commented May 7, 2026

/testwith openshift/installer/main/e2e-aws-ovn openshift/cloud-provider-aws#152 openshift/cluster-cloud-controller-manager-operator#460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants