HostPath volumes let Pods use host directories and volumes in containers. Using host resources can be used to access shared data or escalate privileges and should not be allowed. This policy ensures no hostPath volumes are in use.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: disallow-host-pathannotations:policies.kyverno.io/title: Disallow hostPathpolicies.kyverno.io/category: Pod Security Standards (Baseline)policies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Pod,Volumekyverno.io/kyverno-version: 1.6.0kyverno.io/kubernetes-version: 1.22-1.23policies.kyverno.io/description: HostPath volumes let Pods use host directories and volumes in containers. Using host resources can be used to access shared data or escalate privileges and should not be allowed. This policy ensures no hostPath volumes are in use.spec:validationFailureAction: Auditbackground: truerules:- name: host-pathmatch:any:- resources:kinds:- Podvalidate:message: HostPath volumes are forbidden. The field spec.volumes[*].hostPath must be unset.pattern:spec:"=(volumes)":- X(hostPath): "null"
This policy prevents the use of the default project in an Application.
Services of type LoadBalancer when deployed inside AWS have support for transport encryption if it is enabled via an annotation. This policy requires that Services of type LoadBalancer contain the annotation service.beta.kubernetes.io/aws-load-balancer-ssl-cert with some value.
This policy prevents updates to the project field after an Application is created.