You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:
name: require-tekton-securitycontextannotations:
policies.kyverno.io/title: Require securityContext for Tekton TaskRunpolicies.kyverno.io/category: Tektonpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: TaskRunkyverno.io/kyverno-version: 1.7.2policies.kyverno.io/minversion: 1.7.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/description: >- A securityContext is required for each TaskRun step.spec:
validationFailureAction: Auditbackground: truerules:
- name: check-step-securitycontextmatch:
any:
- resources:
kinds:
- tekton.dev/v1beta1/TaskRun.statusvalidate:
message: "A securityContext is required with `privileged` and `allowPrivilegeEscalation` set to `false`."pattern:
=(status):
=(taskSpec):
steps:
# TODO: missing securityContext for digest-to-results
- (name): "!digest-to-results"securityContext:
# TODO: ideally all tasks run as non-root#runAsNonRoot: trueprivileged: falseallowPrivilegeEscalation: false
The text was updated successfully, but these errors were encountered:
runAsNonRoot: true
homelab/k8s/shared/infrastructure/kyverno-policies/samples/tekton/require-tekton-securitycontext/require-tekton-securitycontext.yaml
Lines 34 to 35 in 18ae95b
The text was updated successfully, but these errors were encountered: