Harden Tekton Pipelines on owned or authorized clusters: Task/Pipeline definitions, PipelineRun isolation, ServiceAccount RBAC, workspace and secret mounts, step image trust, Triggers EventListeners, and Chains provenance. Use when reviewing Tekton YAML, PipelineRun podTemplates, privileged steps, untrusted git resolvers, TriggerBindings, or CI that runs untrusted pull requests on Kubernetes — not third-party cluster abuse.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
tekton-pipeline-security
description
Harden Tekton Pipelines on owned or authorized clusters: Task/Pipeline definitions, PipelineRun isolation, ServiceAccount RBAC, workspace and secret mounts, step image trust, Triggers EventListeners, and Chains provenance. Use when reviewing Tekton YAML, PipelineRun podTemplates, privileged steps, untrusted git resolvers, TriggerBindings, or CI that runs untrusted pull requests on Kubernetes — not third-party cluster abuse.
Tekton Pipeline Security
Assess and harden Tekton so pipeline workloads run with least privilege,
trusted inputs and images, controlled secret access, and isolated runs. Prefer
static review of Tasks, Pipelines, Triggers, and RBAC before live changes.
Org-owned, lab, or explicitly authorized clusters only.
Scope And Authorization
In scope: Tekton CRs (Task, ClusterTask, Pipeline, PipelineRun,
TaskRun, Trigger*, EventListener), run ServiceAccounts and Roles,
workspaces, resolvers, podTemplates, Chains/signing policy, and related CI
manifests you own or are contracted to review.
Out of scope: foreign-cluster abuse; using leaked pipeline tokens outside
ROE; unapproved prod runs that mutate shared systems; host breakout proofs on
shared production nodes.
Prefer kubectl get/describe and non-prod first. Gate live Triggers, privileged
podTemplates, and secret-mount experiments. Redact tokens, kubeconfigs,
git/registry credentials, and PII from logs, results, and reports.
# Owned/lab — metadata only
kubectl get task,pipeline,pipelinerun,taskrun,sa,eventlistener,trigger -n <ns>
2. ServiceAccount and RBAC least privilege
Dedicated SA per pipeline class (build vs deploy); never default SA for runs.
Limit Role verbs to what steps need (no casual * on secrets/pods/exec).
Separate deploy SA/bindings from untrusted build/test runs.
automountServiceAccountToken: false when steps do not call the API.
Who may create PipelineRun/TaskRun is as important as step power.
3. Pod template, steps, and workspaces
Control
Hardened default
Security context
non-root; allowPrivilegeEscalation: false; drop ALL
Privileged / hostPath / hostNetwork
Off for app CI; document exceptions
Step images
Pin digest or immutable tag; org-approved only
Secrets
Minimal workspace/CSI mounts; never echo into results/logs
Workspaces
Isolate RW build space from secret mounts; no shared RW PVC across trust levels
Params/results
Untrusted input; no eval of params in scripts
Untrusted PR pipelines must not mount prod deploy credentials or cluster-admin
SAs. Fix Task contracts against param injection; do not run offensive payloads
against shared prod.
4. Triggers, resolvers, and supply chain
EventListener: authenticate webhooks (interceptors, shared secrets, CEL);
restrict namespace and Trigger SA.
Bindings: allowlist branches/repos; do not pass arbitrary remote Task URLs
from untrusted events into privileged runs.
Resolvers: pin bundle/git revisions; prefer signed/trusted resources; avoid
floating public hub ClusterTasks in prod.
Chains: attest/sign release PipelineRuns; verify provenance per policy
(pair container-image-signing for image sign/verify).
Dashboard/EL: authn/z; NetworkPolicy for listeners and SCM/registry egress.
5. Remediate and verify
Fix CRs and RBAC in GitOps; re-run non-prod PipelineRun; confirm SA cannot read
unrelated secrets and untrusted Triggers cannot deploy. Apply
code-quality-standards to Task scripts; live depth → kubernetes-pentesting.
Routing
Situation
Primary
Helper
Tekton Tasks/Pipelines/Runs, SA, workspaces, Triggers, Chains