Skip to content

OCPBUGS-87107: Scope minted AWS IAM policies to cluster-owned resources #1051

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

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

Conversation

@amitesh1201

@amitesh1201 amitesh1201 commented Jul 2, 2026

Copy link
Copy Markdown

xref: OCPBUGS-87107
Backport of #1043 from master to release-4.18 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 2 conflicts:
    1. pkg/aws/actuator/actuator.go (line 913) — SDK v1 vs v2 type mismatch in tagUser: resolved by keeping aws-sdk-go v1 types (*iam.Tag, aws.String()) with the new ccaws.InfraResourceTagValue constant
    2. pkg/aws/actuator/actuator_test.go (line 21) — import conflict: added "encoding/json" (needed by new tests), removed "errors" (unused on this branch)
  • Unit tests pass: go test ./pkg/aws/...
  • hack/verify-action-maps.sh adjusted to 4.18.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-87107, which is invalid:

  • expected dependent Jira Issue OCPBUGS-87108 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-87107
Backport of #1043 from master to release-4.18 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 2 conflicts:
  1. pkg/aws/actuator/actuator.go (line 913) — SDK v1 vs v2 type mismatch in tagUser: resolved by keeping aws-sdk-go v1 types (*iam.Tag, aws.String()) with the new ccaws.InfraResourceTagValue constant
  2. pkg/aws/actuator/actuator_test.go (line 21) — import conflict: added "encoding/json" (needed by new tests), removed "errors" (unused on this branch)
  • Unit tests pass: go test ./pkg/aws/...
  • hack/verify-action-maps.sh adjusted to 4.18.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: 55b3c542-f26a-4de9-942c-736b76dbd0bc

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 suhanime July 2, 2026 09:30
@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 jstuever 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.96%. Comparing base (363e98b) to head (ed35629).

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release-4.18    #1051      +/-   ##
================================================
+ Coverage         46.70%   46.96%   +0.26%     
================================================
  Files                97       97              
  Lines             11970    12018      +48     
================================================
+ Hits               5590     5644      +54     
+ Misses             5763     5756       -7     
- Partials            617      618       +1     
Files with missing lines Coverage Δ
pkg/aws/actuator/actuator.go 66.25% <100.00%> (+1.51%) ⬆️
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 ed35629 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.

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

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants