Skip to content

OCPBUGS-87108: Scope minted AWS IAM policies to cluster-owned resources#1050

Open
amitesh1201 wants to merge 1 commit into
openshift:release-4.19from
amitesh1201:fix-CVE-2026-10843-release-4.19
Open

OCPBUGS-87108: Scope minted AWS IAM policies to cluster-owned resources#1050
amitesh1201 wants to merge 1 commit into
openshift:release-4.19from
amitesh1201:fix-CVE-2026-10843-release-4.19

Conversation

@amitesh1201

Copy link
Copy Markdown

xref: OCPBUGS-87108
Backport of #1043 from master to release-4.19 to fix CVE-2026-10843


Add an implicit StringEquals condition to every Allow statement in minted IAM user policies, requiring the standard kubernetes.io/cluster infraName tag (with a value of "owned"). This restricts minted credentials to resources tagged as belonging to the cluster, reducing the blast radius if credentials are compromised (CVE-2026-10843).

The CVE advisory suggests tightening Resource ARNs from "*" to specific ARNs, but this isn't feasible: CredentialsRequest manifests are authored before cluster infrastructure exists, so resource ARNs for specific clusters are not known when the CR is authored.

Not all AWS actions support the aws:ResourceTag condition. Actions that create new resources fail (because the resource doesn't exist yet). Describe and List actions lack resource-level permissions. Some services don't support it at all. However, within the payload, the list is both finite and rarely changed. As such, we can easily classify the entire list into supported/incompatible categories. Unrecognized actions produce an error state, with directions pointing the developer to update the classification list in the CCO.

The condition is not applied to Deny statements (this would actually narrow and weaken the policy), nor is it applied to the auto-generated iam:GetUser self-lookup statement, which is already scoped to just the own user's ARN.

Backport Notes

  • Cherry-pick had 1 conflict in tagUser (SDK v1 vs v2 type mismatch) — resolved by keeping aws-sdk-go v1 types (*iam.Tag, aws.String()) with the new ccaws.InfraResourceTagValue constant
  • Unit tests pass: go test ./pkg/aws/...
  • hack/verify-action-maps.sh adjusted to 4.19.0 nightly stream

Add an implicit StringEquals condition to every Allow statement in
minted IAM user policies, requiring the standard kubernetes.io/cluster
infraName tag (with a value of "owned"). This restricts minted
credentials to resources tagged as belonging to the cluster, reducing
the blast radius if credentials are compromised (CVE-2026-10843).

The CVE advisory suggests tightening Resource ARNs from "*" to specific
ARNs, but this isn't feasible: CredentialsRequest manifests are authored
before cluster infrastructure exists, so resource ARNs for specific
clusters are not known when the CR is authored.

Not all AWS actions support the aws:ResourceTag condition. Actions that
create new resources fail (because the resource doesn't exist yet).
Describe and List actions lack resource-level permissions. Some services
don't support it at all. However, within the payload, the list is both
finite and rarely changed. As such, we can easily classify the entire
list into supported/incompatible categories. Unrecognized actions
produce an error state, with directions pointing the developer to update
the classification list in the CCO.

The condition is not applied to Deny statements (this would actually
narrow and weaken the policy), nor is it applied to the auto-generated
iam:GetUser self-lookup statement, which is already scoped to just the
own user's ARN.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 2, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@amitesh1201: This pull request references Jira Issue OCPBUGS-87108, which is invalid:

  • expected dependent Jira Issue OCPBUGS-87109 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ASSIGNED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

xref: OCPBUGS-87108
Backport of #1043 from master to release-4.19 to fix CVE-2026-10843


Add an implicit StringEquals condition to every Allow statement in minted IAM user policies, requiring the standard kubernetes.io/cluster infraName tag (with a value of "owned"). This restricts minted credentials to resources tagged as belonging to the cluster, reducing the blast radius if credentials are compromised (CVE-2026-10843).

The CVE advisory suggests tightening Resource ARNs from "*" to specific ARNs, but this isn't feasible: CredentialsRequest manifests are authored before cluster infrastructure exists, so resource ARNs for specific clusters are not known when the CR is authored.

Not all AWS actions support the aws:ResourceTag condition. Actions that create new resources fail (because the resource doesn't exist yet). Describe and List actions lack resource-level permissions. Some services don't support it at all. However, within the payload, the list is both finite and rarely changed. As such, we can easily classify the entire list into supported/incompatible categories. Unrecognized actions produce an error state, with directions pointing the developer to update the classification list in the CCO.

The condition is not applied to Deny statements (this would actually narrow and weaken the policy), nor is it applied to the auto-generated iam:GetUser self-lookup statement, which is already scoped to just the own user's ARN.

Backport Notes

  • Cherry-pick had 1 conflict in tagUser (SDK v1 vs v2 type mismatch) — resolved by keeping aws-sdk-go v1 types (*iam.Tag, aws.String()) with the new ccaws.InfraResourceTagValue constant
  • Unit tests pass: go test ./pkg/aws/...
  • hack/verify-action-maps.sh adjusted to 4.19.0 nightly stream

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.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 9ff7624a-f8f1-475a-8733-b1251cc2a92d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@openshift-ci openshift-ci Bot requested review from 2uasimojo and dlom July 2, 2026 09:07
@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amitesh1201
Once this PR has been reviewed and has the lgtm label, please assign suhanime for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.99%. Comparing base (eaa3ebd) to head (a506367).

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release-4.19    #1050      +/-   ##
================================================
+ Coverage         46.73%   46.99%   +0.26%     
================================================
  Files                97       97              
  Lines             11988    12036      +48     
================================================
+ Hits               5602     5656      +54     
+ Misses             5768     5761       -7     
- Partials            618      619       +1     
Files with missing lines Coverage Δ
pkg/aws/actuator/actuator.go 66.93% <100.00%> (+1.48%) ⬆️
pkg/aws/utils.go 70.45% <100.00%> (+3.78%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@amitesh1201: 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/security a506367 link true /test security

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.

@racheljpg

Copy link
Copy Markdown

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 3, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@racheljpg: This pull request references Jira Issue OCPBUGS-87108, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.19.z) matches configured target version for branch (4.19.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-87109 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-87109 targets the "4.20.z" version, which is one of the valid target versions: 4.20.0, 4.20.z
  • bug has dependents

No GitHub users were found matching the public email listed for the QA contact in Jira (ocp-sustaining-admins@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

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 removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants