Skip to content

Inject AWS IAM SetSecurityGroups perm on upgrades to 4.23 - #82862

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
mfbonfigli:OCPBUGS-98763_fix-aws-iam-permission-step-on-4.23-upgrades
Aug 4, 2026
Merged

Inject AWS IAM SetSecurityGroups perm on upgrades to 4.23#82862
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
mfbonfigli:OCPBUGS-98763_fix-aws-iam-permission-step-on-4.23-upgrades

Conversation

@mfbonfigli

@mfbonfigli mfbonfigli commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Context

PR #81974 added the openshift-upgrade-aws-patch-master-iam step to work around OCPBUGS-98763: the OpenShift installer didn't include elasticloadbalancing:SetSecurityGroups in the master IAM role policy until 5.0.

Clusters installed before that and upgraded to a release whose CCM expects the permission hit AccessDenied when calling SetSecurityGroups on NLBs, since the master role is never updated during an in-place upgrade.

That fix only patched the role for 4.x → 5.x upgrades, but some jobs upgrade the cluster from 4.x → 4.23 which is effectively equivalent to 5.0, so they hit the same AccessDenied failure.

Change

This PR extends the version check in openshift-upgrade-aws-patch-master-iam-commands.sh so the inline policy is also applied when the target version is 4.23.*, in addition to the existing 4.x → 5.x case. No job/workflow wiring changes are needed since the step is already wired into the shared AWS upgrade workflows and self-gates based on source/target version.

Summary by CodeRabbit

The AWS upgrade IAM patch in OpenShift CI now applies elasticloadbalancing:SetSecurityGroups when upgrading from 4.x through 4.22 to 4.23.* or 5.x. This prevents AccessDenied failures for older clusters that lack the permission in the master IAM role policy.

@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 Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/test all

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The upgrade detection script now extracts source and target minor versions. It permits patching from 4.x versions through 4.22 to 4.23 or 5.x. Other upgrade combinations remain skipped with updated messages.

Changes

Upgrade eligibility detection

Layer / File(s) Summary
Version eligibility checks
ci-operator/step-registry/openshift/upgrade/aws/patch-master-iam/openshift-upgrade-aws-patch-master-iam-commands.sh
The script extracts source and target minor versions. It permits patching from 4.x versions through 4.22 to 4.23 or 5.x. It updates detection and skip messages for unsupported upgrades.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
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 changes only a shell script; no Ginkgo test declarations or test titles were added, and the scan found no dynamic test-name content.
Test Structure And Quality ✅ Passed The patch changes only one shell script; it adds no Ginkgo tests or cluster test operations, so these test-quality requirements are not applicable.
Microshift Test Compatibility ✅ Passed The PR changes only one Bash IAM patch script; it adds no Ginkgo tests or test references to MicroShift-incompatible APIs or features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit changes only one shell script and adds no Ginkgo e2e tests or test paths, so SNO test compatibility is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only an AWS IAM upgrade shell script; it adds no manifests, operators, controllers, replicas, affinity, selectors, tolerations, or other scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only an AWS upgrade shell step; it adds no OTE binary or process-level Go/suite code, so the stdout JSON contract does not apply.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The pull request changes only an AWS IAM patch shell script; it adds no Ginkgo tests, IPv4 assumptions, or test external-connectivity requirements.
No-Weak-Crypto ✅ Passed The only changes add version parsing and eligibility checks; no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons are introduced.
Container-Privileges ✅ Passed The PR changes only version logic in a shell script; added lines and the step manifest contain no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or escalation settings.
No-Sensitive-Data-In-Logs ✅ Passed Changed logging emits only source/target versions and derived IAM role/policy identifiers; no passwords, tokens, keys, PII, hostnames, or customer data are logged.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions injecting AWS IAM SetSecurityGroups permission on upgrades to 4.23, which directly aligns with the PR objective to extend AWS upgrade IAM patch logic for 4.x-to-4.23.* upgrades.
✨ 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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/openshift/upgrade/aws/patch-master-iam/openshift-upgrade-aws-patch-master-iam-commands.sh`:
- Around line 20-27: Update the upgrade guard in the patch-master-IAM command
flow to prevent downgrades from 4.24+ to 4.23 from entering the 4.23 path. Use
the existing source and target version components to require a non-decreasing
minor version for same-major 4.x upgrades, while preserving the existing
4.x-to-5.x behavior and skip message.
- Around line 22-27: The IAM policy granting
elasticloadbalancing:SetSecurityGroups must stop using Resource "*" and be
restricted to the upgrade cluster’s managed load balancer ARNs, or an equivalent
condition targeting only that cluster’s load balancers. Update the policy
configuration in the patch-master-IAM flow while preserving the existing
upgrade-version gating and required action.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 76b1bf5c-523f-4e87-b573-bda063103416

📥 Commits

Reviewing files that changed from the base of the PR and between eb0bfe8 and 61ec5fc.

📒 Files selected for processing (1)
  • ci-operator/step-registry/openshift/upgrade/aws/patch-master-iam/openshift-upgrade-aws-patch-master-iam-commands.sh

@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-ci-4.23-upgrade-from-stable-4.22-e2e-aws-ovn-upgrade

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@mfbonfigli: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

Fix to make sure to inject the missing
elasticloadbalancing:SetSecurityGroups permission also on cluster
upgrades from 4.x to 4.23 as the new feature requiring the permission
is present on 5.0/4.23.
@mfbonfigli
mfbonfigli force-pushed the OCPBUGS-98763_fix-aws-iam-permission-step-on-4.23-upgrades branch from 61ec5fc to f0f0516 Compare August 4, 2026 07:52
@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/test all

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@mfbonfigli: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-route-controller-manager-main-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-5.1-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-5.0-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.23-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.22-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.21-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.20-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.19-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.18-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.17-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.16-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.15-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.14-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.13-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-route-controller-manager-release-4.12-e2e-aws-upgrade openshift/route-controller-manager presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-main-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-5.1-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-5.0-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.23-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.22-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.21-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.20-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.19-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-monitoring-plugin-release-4.18-e2e-aws-ovn-upgrade openshift/monitoring-plugin presubmit Registry content changed
pull-ci-openshift-sdn-release-4.11-e2e-aws-upgrade openshift/sdn presubmit Registry content changed

A total of 1636 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-ci-4.23-upgrade-from-stable-4.22-e2e-aws-ovn-upgrade

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@mfbonfigli: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-ci-5.0-upgrade-from-stable-4.22-e2e-aws-ovn-upgrade

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@mfbonfigli: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@mfbonfigli
mfbonfigli marked this pull request as ready for review August 4, 2026 09:16
@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 Aug 4, 2026
@openshift-ci
openshift-ci Bot requested review from dgoodwin and petr-muller August 4, 2026 09:16
@vr4manta

vr4manta commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2026
@mtulio

mtulio commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfbonfigli, mtulio, vr4manta

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 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@mfbonfigli: all tests passed!

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.

@mfbonfigli

Copy link
Copy Markdown
Contributor Author

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@mfbonfigli: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Aug 4, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit e0cec2f into openshift:main Aug 4, 2026
12 checks passed
TimurMP pushed a commit to TimurMP/release that referenced this pull request Aug 9, 2026
…82862)

Fix to make sure to inject the missing
elasticloadbalancing:SetSecurityGroups permission also on cluster
upgrades from 4.x to 4.23 as the new feature requiring the permission
is present on 5.0/4.23.
TimurMP pushed a commit to TimurMP/release that referenced this pull request Sep 5, 2026
…82862)

Fix to make sure to inject the missing
elasticloadbalancing:SetSecurityGroups permission also on cluster
upgrades from 4.x to 4.23 as the new feature requiring the permission
is present on 5.0/4.23.
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. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants