Skip to content

Commit

Permalink
bumped chart versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaanj18 committed Jan 2, 2025
1 parent 61bf8d0 commit 2590ace
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
12 changes: 7 additions & 5 deletions best-practices/require_drop_all/require_drop_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
capabilities should be dropped from a Pod, with only those required added back.
This policy ensures that all containers explicitly specify the `drop: ["ALL"]`
ability. Note that this policy also illustrates how to cover drop entries in any
case although this may not strictly conform to the Pod Security Standards.
case although this may not strictly conform to the Pod Security Standards.
spec:
validationFailureAction: Audit
background: true
Expand All @@ -25,12 +25,14 @@ spec:
- resources:
kinds:
- Pod
operations:
- CREATE
- UPDATE
preconditions:
all:
- key: "{{ request.operation || 'BACKGROUND' }}"
operator: NotEquals
value: DELETE
validate:
message: >-
Containers must drop `ALL` capabilities.
Containers must drop `ALL` capabilities.
foreach:
- list: request.object.spec.[ephemeralContainers, initContainers, containers][]
deny:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,43 @@ metadata:
policies.kyverno.io/subject: Pod,Volume
policies.kyverno.io/minversion: 1.6.0
kyverno.io/kubernetes-version: "1.22-1.23"
policies.nirmata.io/remediation-docs: "https://docs.nirmata.io/policysets/podsecurity/restricted/restrict-volume-types/"
kyverno.io/kyverno-version: 1.10.0
policies.kyverno.io/description: >-
In addition to restricting HostPath volumes, the restricted pod security profile
limits usage of non-core volume types to those defined through PersistentVolumes.
This policy blocks any other type of volume other than those in the allow list
(configMap, csi, downwardAPI, emptyDir, ephemeral, persistentVolumeClaim, projected, and secret).
This policy blocks any other type of volume other than those in the allow list.
spec:
validationFailureAction: Audit
background: true
rules:
- name: restricted-volumes
match:
any:
- resources:
kinds:
- Pod
- resources:
kinds:
- Pod
preconditions:
all:
- key: "{{ request.operation || 'BACKGROUND' }}"
operator: NotEquals
value: DELETE
validate:
message: >-
Using volume types beyond those listed in the policy rule is disallowed.
Only the following types of volumes may be used: configMap, csi, downwardAPI,
emptyDir, ephemeral, persistentVolumeClaim, projected, and secret.
deny:
conditions:
all:
- key: "{{ request.object.spec.volumes[].keys(@)[] || '' }}"
operator: AnyNotIn
value:
- name
- configMap
- csi
- downwardAPI
- emptyDir
- ephemeral
- persistentVolumeClaim
- projected
- secret
- ""
- key: "{{ request.object.spec.volumes[].keys(@)[] || '' }}"
operator: AnyNotIn
value:
- name
- configMap
- csi
- downwardAPI
- emptyDir
- ephemeral
- persistentVolumeClaim
- projected
- secret
- ''

0 comments on commit 2590ace

Please sign in to comment.