Adding capabilities other than `NET_BIND_SERVICE` is disallowed. In addition, all containers must explicitly drop `ALL` capabilities.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: disallow-capabilities-strictannotations:policies.kyverno.io/title: Disallow Capabilities (Strict)policies.kyverno.io/category: Pod Security Standards (Restricted)policies.kyverno.io/severity: mediumpolicies.kyverno.io/minversion: 1.6.0kyverno.io/kyverno-version: 1.6.0kyverno.io/kubernetes-version: 1.22-1.23policies.kyverno.io/subject: Podpolicies.kyverno.io/description: Adding capabilities other than `NET_BIND_SERVICE` is disallowed. In addition, all containers must explicitly drop `ALL` capabilities.spec:validationFailureAction: Auditbackground: truerules:- name: require-drop-allmatch:any:- resources:kinds:- Podpreconditions:all:- key: "{{ request.operation || 'BACKGROUND' }}"operator: NotEqualsvalue: DELETEvalidate:message: Containers must drop `ALL` capabilities.foreach:- list: request.object.spec.[ephemeralContainers, initContainers, containers][]deny:conditions:all:- key: ALLoperator: AnyNotInvalue: "{{ element.securityContext.capabilities.drop[] || `[]` }}"- name: adding-capabilities-strictmatch:any:- resources:kinds:- Podpreconditions:all:- key: "{{ request.operation || 'BACKGROUND' }}"operator: NotEqualsvalue: DELETEvalidate:message: Any capabilities added other than NET_BIND_SERVICE are disallowed.foreach:- list: request.object.spec.[ephemeralContainers, initContainers, containers][]deny:conditions:all:- key: "{{ element.securityContext.capabilities.add[] || `[]` }}"operator: AnyNotInvalue:- NET_BIND_SERVICE- ""
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.
This policy prevents updates to the project field after an Application is created.