mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
add validateFailureAction to all policies (#1068)
This commit is contained in:
parent
f60deecdce
commit
3fb1c8e87e
31 changed files with 32 additions and 2 deletions
|
@ -11,7 +11,8 @@ apiVersion: kyverno.io/v1
|
|||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: disallow-bind-mounts
|
||||
spec:
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-hostPath
|
||||
match:
|
||||
|
|
|
@ -20,6 +20,7 @@ metadata:
|
|||
namespaces. Namespaces should be required and the default (empty) namespace
|
||||
should not be used.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-namespace
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-docker-sock-mount
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-docker-sock-mount
|
||||
match:
|
||||
|
|
|
@ -12,6 +12,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-helm-tiller
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-helm-tiller
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-host-network-port
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-host-network
|
||||
match:
|
||||
|
|
|
@ -13,6 +13,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-latest-tag
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: require-image-tag
|
||||
match:
|
||||
|
|
|
@ -18,6 +18,7 @@ metadata:
|
|||
annotations:
|
||||
pod-policies.kyverno.io/autogen-controllers: none
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-add-capabilities
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-privileged
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-privileged
|
||||
match:
|
||||
|
|
|
@ -16,6 +16,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-root-user
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-runAsNonRoot
|
||||
match:
|
||||
|
|
|
@ -17,6 +17,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: disallow-sysctls
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-sysctls
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: require-pod-probes
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-livenessProbe-readinessProbe
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: require-pod-requests-limits
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-resources
|
||||
match:
|
||||
|
|
|
@ -13,6 +13,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: require-ro-rootfs
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-readOnlyRootFilesystem
|
||||
match:
|
||||
|
|
|
@ -12,6 +12,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: restrict-automount-sa-token
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-automountServiceAccountToken
|
||||
match:
|
||||
|
|
|
@ -14,6 +14,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: restrict-image-registries
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-registries
|
||||
match:
|
||||
|
|
|
@ -12,6 +12,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: restrict-ingress-classes
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-ingress
|
||||
match:
|
||||
|
|
|
@ -17,6 +17,7 @@ kind: ClusterPolicy
|
|||
metadata:
|
||||
name: restrict-nodeport
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-nodeport
|
||||
match:
|
||||
|
|
|
@ -11,6 +11,7 @@ metadata:
|
|||
Application teams can then configure additional NetworkPolicy resources to allow
|
||||
desired traffic to application pods from select sources.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: default-deny-ingress
|
||||
match:
|
||||
|
|
|
@ -11,6 +11,7 @@ metadata:
|
|||
node leading to potential pod scheduling failures. It is highly recommended that applications
|
||||
are designed to be decoupled from the underlying infrastructure (in this case, nodes).
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-hostPath
|
||||
match:
|
||||
|
|
|
@ -11,6 +11,7 @@ metadata:
|
|||
namespaces. Namespaces should be required and the default (empty) namespace
|
||||
should not be used.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-namespace
|
||||
match:
|
||||
|
|
|
@ -8,6 +8,7 @@ metadata:
|
|||
Docker daemon on the node. This access can be used for privilege escalation and
|
||||
to manage containers outside of Kubernetes, and hence should not be allowed.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-docker-sock-mount
|
||||
match:
|
||||
|
|
|
@ -7,6 +7,7 @@ metadata:
|
|||
policies.kyverno.io/description: Tiller has known security challenges. It requires adminstrative privileges and acts as a shared
|
||||
resource accessible to any authenticated user. Tiller can lead to privilge escalation as restricted users can impact other users.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-helm-tiller
|
||||
match:
|
||||
|
|
|
@ -7,6 +7,7 @@ metadata:
|
|||
policies.kyverno.io/description: Using 'hostPort' and 'hostNetwork' allows pods to share
|
||||
the host network stack, allowing potential snooping of network traffic from an application pod.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-host-network
|
||||
match:
|
||||
|
|
|
@ -8,6 +8,7 @@ metadata:
|
|||
unexpected errors if the image changes. A best practice is to use an immutable
|
||||
tag that maps to a specific version of an application pod.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: require-image-tag
|
||||
match:
|
||||
|
|
|
@ -11,6 +11,7 @@ metadata:
|
|||
enforces that containers cannot add new capabilities. Other policies can be used to set
|
||||
default capabilities.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-add-capabilities
|
||||
match:
|
||||
|
|
|
@ -10,6 +10,7 @@ metadata:
|
|||
With `securityContext.allowPrivilegeEscalation` enabled, a process can
|
||||
gain privileges from its parent.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-privileged
|
||||
match:
|
||||
|
|
|
@ -9,6 +9,7 @@ metadata:
|
|||
least privileged user ID when building the container image and require that
|
||||
application containers run as non root users.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-runAsNonRoot
|
||||
match:
|
||||
|
|
|
@ -8,6 +8,7 @@ metadata:
|
|||
at runtime. In a Kubernetes pod these parameters can be specified under `securityContext.sysctls`.
|
||||
Kernel parameter modifications can be used for exploits and should be restricted.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-sysctls
|
||||
match:
|
||||
|
|
|
@ -9,7 +9,7 @@ metadata:
|
|||
'resources.requests' and 'resources.limits' per pod. If a namespace level request or limit is
|
||||
specified, defaults will automatically be applied to each pod based on the 'LimitRange' configuration.
|
||||
spec:
|
||||
validationFailureAction: "audit"
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-resources
|
||||
match:
|
||||
|
|
|
@ -10,6 +10,7 @@ metadata:
|
|||
containers are running or need to be restarted. A `readinessProbe` is used by services
|
||||
and deployments to determine if the pod is ready to receive network traffic.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-livenessProbe-readinessProbe
|
||||
match:
|
||||
|
|
|
@ -9,6 +9,7 @@ metadata:
|
|||
ersists the state. An immutable root filesystem can also prevent malicious binaries from
|
||||
writing to the host system.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
rules:
|
||||
- name: validate-readOnlyRootFilesystem
|
||||
match:
|
||||
|
|
Loading…
Reference in a new issue