Skip to content

OCPBUGS-77004: scc: restricted-v3: Fix runAsUser range#1947

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
tchap:fix-restricted-v3-runAsUser-range
Oct 23, 2025
Merged

OCPBUGS-77004: scc: restricted-v3: Fix runAsUser range#1947
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
tchap:fix-restricted-v3-runAsUser-range

Conversation

@tchap
Copy link
Copy Markdown
Contributor

@tchap tchap commented Oct 22, 2025

Issue

restricted-v3 is made for user namespaces, which require UID to be between 1000 and 65534. Yet:

 message: 'pods "sleep-94cf4ff7d-" is forbidden: unable to validate against any
        security context constraint: provider restricted-v3: .containers[0].runAsUser:
        Invalid value: 1000: must be in the ranges: [1000740000, 1000749999]'

Fix

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
    RunAsUser is the strategy that will dictate what RunAsUser is used in the
    SecurityContext.
    RunAsUserStrategyOptions defines the strategy type and any options used to
    create the strategy.
    
FIELDS:
  type  <string>
    Type is the strategy that will dictate what RunAsUser is used in the
    SecurityContext.

  uid   <integer>
    UID is the user id that containers must run as.  Required for the MustRunAs
    strategy if not using namespace/service account allocated uids.

  uidRangeMax   <integer>
    UIDRangeMax defines the max value for a strategy that allocates by range.

  uidRangeMin   <integer>
    UIDRangeMin defines the min value for a strategy that allocates by range.

Testing

Tested this manually on a ClusterBot cluster.

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 22, 2025
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Oct 22, 2025

@tchap: This pull request references CNTRLPLANE-1544 which is a valid jira issue.

Details

In response to this:

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.


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
Copy link
Copy Markdown

coderabbitai Bot commented Oct 22, 2025

Walkthrough

Updates a Kubernetes Security Context Constraint (SCC) manifest file to replace the runAsUser.ranges format with explicit uidRangeMin and uidRangeMax fields (values 1000 and 65534). Other SCC settings remain unchanged; only the UID range specification syntax is modernized.

Changes

Cohort / File(s) Change Summary
SCC Manifest UID Range Format Update
bindata/bootkube/scc-manifests/0000_20_kube-apiserver-operator_00_scc-restricted-v3.yaml
Replaces runAsUser.ranges block with explicit uidRangeMin: 1000 and uidRangeMax: 65534 fields under MustRunAsRange policy. Other SCC fields preserved.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "CNTRLPLANE-1544: scc: restricted-v3: Fix runAsUser range" directly and clearly summarizes the main change in the changeset. The raw summary confirms the change is replacing the runAsUser.ranges block with the correct fields uidRangeMin and uidRangeMax, which is precisely what the title communicates as "Fix runAsUser range." The title is concise, specific, and leaves no ambiguity about the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The pull request description directly addresses the changeset by explaining that the runAsUser field in the restricted-v3 SCC manifest needs to use uidRangeMin and uidRangeMax instead of ranges.min and ranges.max. The description provides context for the issue (user namespace requirements with UIDs 1000-65534), reproduces the validation error demonstrating the problem, includes kubectl documentation showing the correct field names, and notes manual testing was performed. This is clearly related to the actual change being made in the manifest file.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Oct 22, 2025

@tchap: This pull request references CNTRLPLANE-1544 which is a valid jira issue.

Details

In response to this:

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.

Tested this manually on a ClusterBot cluster.

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
Copy link
Copy Markdown

openshift-ci-robot commented Oct 22, 2025

@tchap: This pull request references CNTRLPLANE-1544 which is a valid jira issue.

Details

In response to this:

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.

Tested this manually on a ClusterBot cluster.

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 openshift-ci Bot requested review from deads2k and p0lyn0mial October 22, 2025 13:07
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Oct 22, 2025

@tchap: This pull request references CNTRLPLANE-1544 which is a valid jira issue.

Details

In response to this:

Issue

restricted-v3 is made for user namespaces, which requires UID to be between 1000 and 65534. Yet:

message: 'pods "sleep-94cf4ff7d-" is forbidden: unable to validate against any
       security context constraint: provider restricted-v3: .containers[0].runAsUser:
       Invalid value: 1000: must be in the ranges: [1000740000, 1000749999]'

Fix

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.

Testing

Tested this manually on a ClusterBot cluster.

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
Copy link
Copy Markdown

openshift-ci-robot commented Oct 22, 2025

@tchap: This pull request references CNTRLPLANE-1544 which is a valid jira issue.

Details

In response to this:

Issue

restricted-v3 is made for user namespaces, which require UID to be between 1000 and 65534. Yet:

message: 'pods "sleep-94cf4ff7d-" is forbidden: unable to validate against any
       security context constraint: provider restricted-v3: .containers[0].runAsUser:
       Invalid value: 1000: must be in the ranges: [1000740000, 1000749999]'

Fix

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.

Testing

Tested this manually on a ClusterBot cluster.

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.

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Oct 22, 2025

/retest

@haircommander
Copy link
Copy Markdown
Member

/lgtm
/cherry-pick release-4.20

@openshift-cherrypick-robot
Copy link
Copy Markdown

@haircommander: once the present PR merges, I will cherry-pick it on top of release-4.20 in a new PR and assign it to you.

Details

In response to this:

/lgtm
/cherry-pick release-4.20

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 22, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Oct 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, sanchezl, tchap

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 Oct 22, 2025
@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Oct 22, 2025

/retest

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Oct 23, 2025

/retest-required

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Oct 23, 2025

/verified by @tchap

Tested this manually on a cluster.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Oct 23, 2025
@openshift-ci-robot
Copy link
Copy Markdown

@tchap: This PR has been marked as verified by @tchap.

Details

In response to this:

/verified by @tchap

Tested this manually on a cluster.

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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Oct 23, 2025

@tchap: 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/okd-scos-e2e-aws-ovn 3be0d2b link false /test okd-scos-e2e-aws-ovn

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 3e75bc1 into openshift:main Oct 23, 2025
14 of 15 checks passed
@tchap tchap deleted the fix-restricted-v3-runAsUser-range branch October 23, 2025 12:34
@openshift-cherrypick-robot
Copy link
Copy Markdown

@haircommander: new pull request created: #1948

Details

In response to this:

/lgtm
/cherry-pick release-4.20

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.

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Feb 17, 2026

/retitle OCPBUGS-77004: scc: restricted-v3: Fix runAsUser range

@openshift-ci openshift-ci Bot changed the title CNTRLPLANE-1544: scc: restricted-v3: Fix runAsUser range OCPBUGS-77004: scc: restricted-v3: Fix runAsUser range Feb 17, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@tchap: Jira Issue Verification Checks: Jira Issue OCPBUGS-77004
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-77004 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Issue

restricted-v3 is made for user namespaces, which require UID to be between 1000 and 65534. Yet:

message: 'pods "sleep-94cf4ff7d-" is forbidden: unable to validate against any
       security context constraint: provider restricted-v3: .containers[0].runAsUser:
       Invalid value: 1000: must be in the ranges: [1000740000, 1000749999]'

Fix

runAsUser does not use ranges.min and ranges.max,
rather the right keys are uidRangeMin and uidRangeMax.

$ k explain scc.runAsUser     
GROUP:      security.openshift.io
KIND:       SecurityContextConstraints
VERSION:    v1

FIELD: runAsUser <RunAsUserStrategyOptions>


DESCRIPTION:
   RunAsUser is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.
   RunAsUserStrategyOptions defines the strategy type and any options used to
   create the strategy.
   
FIELDS:
 type  <string>
   Type is the strategy that will dictate what RunAsUser is used in the
   SecurityContext.

 uid   <integer>
   UID is the user id that containers must run as.  Required for the MustRunAs
   strategy if not using namespace/service account allocated uids.

 uidRangeMax   <integer>
   UIDRangeMax defines the max value for a strategy that allocates by range.

 uidRangeMin   <integer>
   UIDRangeMin defines the min value for a strategy that allocates by range.

Testing

Tested this manually on a ClusterBot cluster.

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.

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. 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants