mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
support failurePolicy in kyverno-policies helm chart (#4323)
* support failurePolicy in kyverno-policies helm chart Signed-off-by: Tom Stewart <thomas.stewart@arcadia.com>
This commit is contained in:
parent
c95bb74992
commit
ca3d346fcc
21 changed files with 33 additions and 8 deletions
charts/kyverno-policies
Chart.yamlREADME.mdvalues.yaml
templates
baseline
disallow-capabilities.yamldisallow-host-namespaces.yamldisallow-host-path.yamldisallow-host-ports.yamldisallow-host-process.yamldisallow-privileged-containers.yamldisallow-proc-mount.yamldisallow-selinux.yamlrestrict-apparmor-profiles.yamlrestrict-seccomp.yamlrestrict-sysctls.yaml
other
restricted
|
@ -29,3 +29,5 @@ annotations:
|
||||||
description: Fix Kyverno version check when image tag contains registry port number
|
description: Fix Kyverno version check when image tag contains registry port number
|
||||||
- kind: fixed
|
- kind: fixed
|
||||||
description: Ensure preconditions are present with default values
|
description: Ensure preconditions are present with default values
|
||||||
|
- kind: added
|
||||||
|
description: Support for failurePolicy setting in kyverno-policies helm chart
|
||||||
|
|
|
@ -68,6 +68,7 @@ The command removes all the Kubernetes components associated with the chart and
|
||||||
| podSecurityPolicies | list | `[]` | Policies to include when `podSecurityStandard` is `custom`. |
|
| podSecurityPolicies | list | `[]` | Policies to include when `podSecurityStandard` is `custom`. |
|
||||||
| includeOtherPolicies | list | `[]` | Additional policies to include from `other`. |
|
| includeOtherPolicies | list | `[]` | Additional policies to include from `other`. |
|
||||||
| validationFailureAction | string | `"audit"` | Validation failure action (`audit`, `enforce`). For more info https://kyverno.io/docs/writing-policies/validate. |
|
| validationFailureAction | string | `"audit"` | Validation failure action (`audit`, `enforce`). For more info https://kyverno.io/docs/writing-policies/validate. |
|
||||||
|
| failurePolicy | string | `"Fail"` | API server behavior if the webhook fails to respond ('Ignore', 'Fail') For more info: https://kyverno.io/docs/writing-policies/policy-settings/ |
|
||||||
| validationFailureActionOverrides | object | `{"all":[]}` | Define validationFailureActionOverrides for specific policies. The overrides for `all` will apply to all policies. |
|
| validationFailureActionOverrides | object | `{"all":[]}` | Define validationFailureActionOverrides for specific policies. The overrides for `all` will apply to all policies. |
|
||||||
| policyExclude | object | `{}` | Exclude resources from individual policies. Policies with multiple rules can have individual rules excluded by using the name of the rule as the key in the `policyExclude` map. |
|
| policyExclude | object | `{}` | Exclude resources from individual policies. Policies with multiple rules can have individual rules excluded by using the name of the rule as the key in the `policyExclude` map. |
|
||||||
| policyPreconditions | object | `{}` | Add preconditions to individual policies. Policies with multiple rules can have individual rules excluded by using the name of the rule as the key in the `policyPreconditions` map. |
|
| policyPreconditions | object | `{}` | Add preconditions to individual policies. Policies with multiple rules can have individual rules excluded by using the name of the rule as the key in the `policyPreconditions` map. |
|
||||||
|
|
|
@ -23,6 +23,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: adding-capabilities
|
- name: adding-capabilities
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: host-namespaces
|
- name: host-namespaces
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -23,6 +23,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: host-path
|
- name: host-path
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -16,13 +16,14 @@ metadata:
|
||||||
policies.kyverno.io/description: >-
|
policies.kyverno.io/description: >-
|
||||||
Access to host ports allows potential snooping of network traffic and should not be
|
Access to host ports allows potential snooping of network traffic and should not be
|
||||||
allowed, or at minimum restricted to a known list. This policy ensures the `hostPort`
|
allowed, or at minimum restricted to a known list. This policy ensures the `hostPort`
|
||||||
field is unset or set to `0`.
|
field is unset or set to `0`.
|
||||||
spec:
|
spec:
|
||||||
validationFailureAction: {{ .Values.validationFailureAction }}
|
validationFailureAction: {{ .Values.validationFailureAction }}
|
||||||
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: host-ports-none
|
- name: host-ports-none
|
||||||
match:
|
match:
|
||||||
|
@ -54,4 +55,4 @@ spec:
|
||||||
containers:
|
containers:
|
||||||
- =(ports):
|
- =(ports):
|
||||||
- =(hostPort): 0
|
- =(hostPort): 0
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: host-process-containers
|
- name: host-process-containers
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -22,6 +22,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: privileged-containers
|
- name: privileged-containers
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: check-proc-mount
|
- name: check-proc-mount
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -22,6 +22,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: selinux-type
|
- name: selinux-type
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -25,6 +25,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: app-armor
|
- name: app-armor
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -14,8 +14,8 @@ metadata:
|
||||||
kyverno.io/kyverno-version: 1.6.0
|
kyverno.io/kyverno-version: 1.6.0
|
||||||
kyverno.io/kubernetes-version: "1.22-1.23"
|
kyverno.io/kubernetes-version: "1.22-1.23"
|
||||||
policies.kyverno.io/description: >-
|
policies.kyverno.io/description: >-
|
||||||
The seccomp profile must not be explicitly set to Unconfined. This policy,
|
The seccomp profile must not be explicitly set to Unconfined. This policy,
|
||||||
requiring Kubernetes v1.19 or later, ensures that seccomp is unset or
|
requiring Kubernetes v1.19 or later, ensures that seccomp is unset or
|
||||||
set to `RuntimeDefault` or `Localhost`.
|
set to `RuntimeDefault` or `Localhost`.
|
||||||
spec:
|
spec:
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
@ -23,6 +23,7 @@ spec:
|
||||||
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: check-seccomp
|
- name: check-seccomp
|
||||||
match:
|
match:
|
||||||
|
@ -50,7 +51,7 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
=(securityContext):
|
=(securityContext):
|
||||||
=(seccompProfile):
|
=(seccompProfile):
|
||||||
=(type): "RuntimeDefault | Localhost"
|
=(type): "RuntimeDefault | Localhost"
|
||||||
=(ephemeralContainers):
|
=(ephemeralContainers):
|
||||||
- =(securityContext):
|
- =(securityContext):
|
||||||
=(seccompProfile):
|
=(seccompProfile):
|
||||||
|
|
|
@ -26,6 +26,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: check-sysctls
|
- name: check-sysctls
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: check-runasgroup
|
- name: check-runasgroup
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: require-drop-all
|
- name: require-drop-all
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -22,6 +22,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: privilege-escalation
|
- name: privilege-escalation
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -22,6 +22,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: run-as-non-root-user
|
- name: run-as-non-root-user
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -23,6 +23,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: run-as-non-root
|
- name: run-as-non-root
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -15,16 +15,17 @@ metadata:
|
||||||
kyverno.io/kubernetes-version: "1.22-1.23"
|
kyverno.io/kubernetes-version: "1.22-1.23"
|
||||||
policies.kyverno.io/description: >-
|
policies.kyverno.io/description: >-
|
||||||
The seccomp profile in the Restricted group must not be explicitly set to Unconfined
|
The seccomp profile in the Restricted group must not be explicitly set to Unconfined
|
||||||
but additionally must also not allow an unset value. This policy,
|
but additionally must also not allow an unset value. This policy,
|
||||||
requiring Kubernetes v1.19 or later, ensures that seccomp is
|
requiring Kubernetes v1.19 or later, ensures that seccomp is
|
||||||
set to `RuntimeDefault` or `Localhost`. A known issue prevents a policy such as this
|
set to `RuntimeDefault` or `Localhost`. A known issue prevents a policy such as this
|
||||||
using `anyPattern` from being persisted properly in Kubernetes 1.23.0-1.23.2.
|
using `anyPattern` from being persisted properly in Kubernetes 1.23.0-1.23.2.
|
||||||
spec:
|
spec:
|
||||||
background: {{ .Values.background }}
|
|
||||||
validationFailureAction: {{ .Values.validationFailureAction }}
|
validationFailureAction: {{ .Values.validationFailureAction }}
|
||||||
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
{{- with concat (index .Values "validationFailureActionOverrides" "all") (default list (index .Values "validationFailureActionOverrides" $name)) }}
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: check-seccomp-strict
|
- name: check-seccomp-strict
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -25,6 +25,7 @@ spec:
|
||||||
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
validationFailureActionOverrides: {{ toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
background: {{ .Values.background }}
|
background: {{ .Values.background }}
|
||||||
|
failurePolicy: {{ .Values.failurePolicy }}
|
||||||
rules:
|
rules:
|
||||||
- name: restricted-volumes
|
- name: restricted-volumes
|
||||||
match:
|
match:
|
||||||
|
|
|
@ -16,6 +16,10 @@ includeOtherPolicies: []
|
||||||
# For more info https://kyverno.io/docs/writing-policies/validate.
|
# For more info https://kyverno.io/docs/writing-policies/validate.
|
||||||
validationFailureAction: audit
|
validationFailureAction: audit
|
||||||
|
|
||||||
|
# -- API server behavior if the webhook fails to respond ('Ignore', 'Fail')
|
||||||
|
# For more info: https://kyverno.io/docs/writing-policies/policy-settings/
|
||||||
|
failurePolicy: Fail
|
||||||
|
|
||||||
# -- Define validationFailureActionOverrides for specific policies.
|
# -- Define validationFailureActionOverrides for specific policies.
|
||||||
# The overrides for `all` will apply to all policies.
|
# The overrides for `all` will apply to all policies.
|
||||||
validationFailureActionOverrides:
|
validationFailureActionOverrides:
|
||||||
|
|
Loading…
Add table
Reference in a new issue