Skip to content

Allow runtime/default seccomp on pipelines-scc SecurityContextConstraints - #4497

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
savitaashture:fix-ssc-1
Nov 24, 2026
Merged

tekton-robot merged 1 commit into
tektoncd:mainfrom
savitaashture:fix-ssc-1

Conversation

@savitaashture

@savitaashture savitaashture commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

With set-security-context enabled, Tekton injects seccompProfile: RuntimeDefault on init containers. OpenShift rejects the pod unless pipelines-scc lists that profile, which causes SCC admission failures.

Upstream Pipeline changes : tektoncd/pipeline#9589

Issue:

task clone-git-repo has failed: pods "clone-and-success-qgpz4-clone-git-repo-pod" is forbidden: unable to validate against any security context constraint: [provider "anyuid": Forbidden: not usable by user or serviceaccount, metadata.annotations[container.seccomp.security.alpha.kubernetes.io/prepare]: Forbidden: seccomp may not be set, metadata.annotations[container.seccomp.security.alpha.kubernetes.io/place-scripts]: Forbidden: seccomp may not be set, metadata.annotations[container.seccomp.security.alpha.kubernetes.io/working-dir-initializer]: Forbidden: seccomp may not be set, provider restricted-v2: .containers[0].runAsUser: Invalid value: 65532: must be in the ranges: [1000840000, 1000849999], provider restricted-v3: .spec.hostUsers: Invalid value: null: Host Users must be set to false, provider "restricted": Forbidden: not usable by user or serviceaccount, provider "nested-container": Forbidden: not usable by user or serviceaccount, provider "nonroot-v2": Forbidden: not usable by user or serviceaccount, provider "hostmount-anyuid": Forbidden: not usable by user or serviceaccount, provider "logging-scc": Forbidden: not usable by user or serviceaccount, provider "hostmount-anyuid-v2": Forbidden: not usable by user or serviceaccount, provider "machine-api-termination-handler": Forbidden: not usable by user or serviceaccount, provider "hostnetwork-v2": Forbidden: not usable by user or serviceaccount, provider "hostnetwork": Forbidden: not usable by user or serviceaccount, provider "hostaccess": Forbidden: not usable by user or serviceaccount, provider "insights-runtime-extractor-scc": Forbidden: not usable by user or serviceaccount, provider "node-exporter": Forbidden: not usable by user or serviceaccount, provider "privileged": Forbidden: not usable by user or serviceaccount] --- getting this error because this change https://github.com/tektoncd/pipeline/pull/9589 is there related to pipeline

Verification:

  • Verified by creating sample Pipelinerun which contains git-clone task
  • Verified SCC set
oc get scc pipelines-scc -o yaml | grep -A5 seccomp         

seccompProfiles:
- runtime/default
- '*'
supplementalGroups:
  type: RunAsAny
userNamespaceLevel: AllowHostLevel

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

If set-security-context is true ensure SecurityContextConstraints have   
seccompProfiles:
- '*'

so TaskRuns work with set-security-context enabled.

Today Tekton injects seccompProfile: RuntimeDefault on init containers when set-security-context is true. Without this SCC update, OpenShift admission can reject TaskRun pods. 
The operator now configures pipelines-scc automatically with 
seccompProfiles:
- '*'

But If user using different SCC name ensure to add 
seccompProfiles:
- '*'

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Nov 24, 2026
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 24, 2026
@savitaashture savitaashture added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.84%. Comparing base (d6f753b) to head (8e2ba5d).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4497   +/-   ##
=======================================
  Coverage   31.84%   31.84%           
=======================================
  Files         530      530           
  Lines       25534    25534           
=======================================
  Hits         8131     8131           
  Misses      17403    17403           
Flag Coverage Δ
unit-tests 31.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@infernus01 infernus01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While preparing the upgrade to Pipeline v1.18 in kinflux, I set set-security-context: false in TektonConfig, so build pods are still admitted.

Could we add a release note telling those users to either add runtime/default to seccompProfiles in their SCCs, or keep set-security-context: false?

seLinuxContext:
type: MustRunAs
seccompProfiles:
- runtime/default

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.

Should we keep * to allow any profiles? I think some tasks like buildah or task needing some low level permission,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ya make sense
Lets keep what is required and if needed in future we can extend

removed * now

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.

I am thinking maybe we should remove runtime/default and keep only *. It will avoid issues with buldah, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

@savitaashture

Copy link
Copy Markdown
Contributor Author

Could we add a release note telling those users to either add runtime/default to seccompProfiles in their SCCs, or keep set-security-context: false?

@infernus01 with this scc update going forward upgrade will automatically take this change and we no need to do set-security-context: false

Do you mean adding this as RN ?

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Nov 24, 2026
@infernus01

Copy link
Copy Markdown
Member

@infernus01 with this scc update going forward upgrade will automatically take this change and we no need to do set-security-context: false

Do you mean adding this as RN ?

Yes, since this PR covers clusters where TaskRuns run under pipelines-scc, but clusters that use their own SCCs won't pick it up, right?

@savitaashture

Copy link
Copy Markdown
Contributor Author

@infernus01 with this scc update going forward upgrade will automatically take this change and we no need to do set-security-context: false
Do you mean adding this as RN ?

Yes, since this PR covers clusters where TaskRuns run under pipelines-scc, but clusters that use their own SCCs won't pick it up, right?

Make sense
Added now
Please check thank you

@infernus01 infernus01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2026
…ints

With set-security-context enabled, Tekton injects seccompProfile: RuntimeDefault on init containers.
OpenShift rejects the pod unless pipelines-scc lists that profile, which causes SCC admission failures.

Signed-off-by: savitaashture <sashture@redhat.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2026

@jkhelil jkhelil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2026

@khrm khrm 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.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2026
@tekton-robot
tekton-robot merged commit 87dd8de into tektoncd:main Nov 24, 2026
18 checks passed
@savitaashture

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-v0.82.x

@tekton-robot

Copy link
Copy Markdown
Contributor

✅ Cherry-pick to release-v0.82.x successful!

A new pull request has been created to cherry-pick this change to release-v0.82.x.

PR: #4501

Please review and merge the cherry-pick PR.

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. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants