The `exec` command may be used to gain shell access, or run other commands, in a Pod's container. While this can be useful for troubleshooting purposes, it could represent an attack vector and is discouraged. This policy blocks Pod exec commands to containers named `nginx` in Pods starting with name `myapp-maintenance`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: deny-exec-by-pod-and-containerannotations:policies.kyverno.io/title: Block Pod Exec by Pod and Containerpolicies.kyverno.io/category: Samplepolicies.kyverno.io/minversion: 1.6.0policies.kyverno.io/subject: Podpolicies.kyverno.io/description: The `exec` command may be used to gain shell access, or run other commands, in a Pod's container. While this can be useful for troubleshooting purposes, it could represent an attack vector and is discouraged. This policy blocks Pod exec commands to containers named `nginx` in Pods starting with name `myapp-maintenance`.spec:validationFailureAction: Enforcebackground: falserules:- name: deny-nginx-exec-in-myapp-maintenancematch:any:- resources:kinds:- Pod/execpreconditions:all:- key: "{{ request.operation || 'BACKGROUND' }}"operator: Equalsvalue: CONNECT- key: "{{ request.name }}"operator: Equalsvalue: myapp-maintenance*validate:message: Nginx containers inside myapp-maintanence Pods may not be exec'd into.deny:conditions:all:- key: "{{ request.object.container }}"operator: Equalsvalue: nginx
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.