Velero allows on backup and restore operations and is designed to be run with full cluster admin permissions. It allows on cross namespace restore operations, which means you can restore backup of namespace A to namespace B. This policy protect restore operation into system or any protected namespaces, listed in deny condition section. It checks the Restore CRD object and its namespaceMapping field. If destination match protected namespace then operation fails and warning message is throw.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: block-velero-restoreannotations:policies.kyverno.io/title: Block Velero Restore to Protected Namespacepolicies.kyverno.io/category: Veleropolicies.kyverno.io/subject: Restorepolicies.kyverno.io/description: Velero allows on backup and restore operations and is designed to be run with full cluster admin permissions. It allows on cross namespace restore operations, which means you can restore backup of namespace A to namespace B. This policy protect restore operation into system or any protected namespaces, listed in deny condition section. It checks the Restore CRD object and its namespaceMapping field. If destination match protected namespace then operation fails and warning message is throw.spec:validationFailureAction: Auditbackground: falserules:- name: block-velero-restore-to-protected-namespacematch:any:- resources:kinds:- velero.io/v1/Restorevalidate:message: "Warning! Restore to protected namespace: {{request.object.spec.namespaceMapping | values(@)}} is not allowed!"deny:conditions:any:- key: "{{request.object.spec.namespaceMapping || `{}` | values(@)}}"operator: AnyInvalue:- kube-system- kube-node-lease
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.