Skip to content

Commit

Permalink
Merge pull request #1168 from epasham/main
Browse files Browse the repository at this point in the history
Fix for issue 1166: Allow CAP_NET_RAW and NET_RAW drop capabilities
  • Loading branch information
realshuting authored Oct 17, 2024
2 parents 45a6e62 + 372d7f4 commit 7c3df92
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,20 @@ spec:
securityContext:
capabilities:
drop:
- CAP_NET_RAW
- CAP_NET_RAW
---
apiVersion: v1
kind: Pod
metadata:
name: drop-netraw-good
spec:
containers:
- args:
- sleep
- infinity
image: ghcr.io/kyverno/test-busybox:1.35
name: busybox
securityContext:
capabilities:
drop:
- NET_RAW
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ readme: |
annotations:
kyverno/category: "Best Practices"
kyverno/subject: "Pod"
digest: 97e963f073e6324fa514015bc8fd8564b93fb7da6f8564fcf8a8fefc4c9da784
digest: 357011bf6ef0268a0ca1b248e0c7a59fc42e7f2017d02838c85711c329130676
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ spec:
all:
- key: CAP_NET_RAW
operator: AnyNotIn
value: "{{ element.securityContext.capabilities.drop[].to_upper(@) || `[]` }}"
value: "{{ element.securityContext.capabilities.drop[].to_upper(@) || `[]` }}"
- key: NET_RAW
operator: AnyNotIn
value: "{{ element.securityContext.capabilities.drop[].to_upper(@) || `[]` }}"

0 comments on commit 7c3df92

Please sign in to comment.