Created
February 2, 2024 12:41
-
-
Save lobuhi/0e2d761ae0c0d8a8bb11fa20c4aee025 to your computer and use it in GitHub Desktop.
Kyverno Validation Policy for CVE-2024-21626
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kyverno.io/v1 | |
kind: ClusterPolicy | |
metadata: | |
name: disallow-proc-self-fd-workingdir | |
spec: | |
validationFailureAction: enforce | |
background: true | |
rules: | |
- name: check-workingDir | |
match: | |
resources: | |
kinds: | |
- Pod | |
validate: | |
message: "Using /proc/self/fd in workingDir is not allowed." | |
pattern: | |
spec: | |
containers: | |
- =(workingDir): "!/proc/self/fd*" | |
initContainers: | |
- =(workingDir): "!/proc/self/fd*" | |
ephemeralContainers: | |
- =(workingDir): "!/proc/self/fd*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above flags all pods. This fixes that bug.