[cherry-pick: release-v0.79.x] fix(openshift): block SCC escalation via annotations - #4073
Open
tekton-robot wants to merge 1 commit into
Open
[cherry-pick: release-v0.79.x] fix(openshift): block SCC escalation via annotations#4073tekton-robot wants to merge 1 commit into
tekton-robot wants to merge 1 commit into
Conversation
Fixes a security vulnerability where empty maxAllowed in TektonConfig.spec.platforms.openshift.scc allowed privilege escalation to any SCC (including privileged) via namespace annotations. Implemented three-layer defense-in-depth: - Layer 1: Default maxAllowed to match default SCC (prevents empty configuration) - Layer 2: Namespace webhook validates the maxAllowed if it is empty then allow only default SCC. - Layer 3: RBAC reconciler treats empty maxAllowed as default SCC (final enforcement) This prevents attackers from annotating namespaces with operator.tekton.dev/scc=privileged to gain node-level access. Also documents the new behavior: empty maxAllowed is now treated as "only the default SCC is allowed" to prevent privilege escalation via the operator.tekton.dev/scc namespace annotation. Notes that requesting a less restrictive SCC such as anyuid now requires setting maxAllowed explicitly in TektonConfig. Co-authored-by: Anitha Natarajan <anataraj@redhat.com> Signed-off-by: pratap0007 <shverma@redhat.com>
4 tasks
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a cherry-pick of #3994
Changes
Fixes a security vulnerability where empty maxAllowed in
TektonConfig.spec.platforms.openshift.scc allowed privilege
escalation to any SCC (including privileged) via namespace
annotations.
Implemented three-layer defense-in-depth:
This prevents attackers from annotating namespaces with
operator.tekton.dev/scc=privileged to gain node-level access.
Also documents the new behavior: empty maxAllowed is now treated
as "only the default SCC is allowed" to prevent privilege escalation
via the operator.tekton.dev/scc namespace annotation. Notes that
requesting a less restrictive SCC such as anyuid now requires
setting maxAllowed explicitly in TektonConfig.
Manual Testing on OpenShift Cluster
Prerequisites
oc get tektonconfig configTest Cases
✅ Test 1: Default SCC Should Be Allowed
Expected: Namespace created successfully
Cleanup:
oc delete namespace test-default-scc❌ Test 2: Privileged SCC Should Be Blocked (Security Fix)
Expected: Error message:
❌ Test 3: Anyuid SCC Should Be Blocked (Security Fix)
Expected: Similar rejection with
anyuidin the error message✅ Test 4: Set maxAllowed - Verify Normal Flow Still Works
Expected: Namespace created successfully
Cleanup:
oc delete namespace test-anyuid-allowedSubmitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes
-->