Datasets:
Download source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/pod-security-policy/read-only-root-filesystem/src.cel from Vinyeh/AutoOntologyBench: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/pod-security-policy/read-only-root-filesystem/src.cel
- Command line
-
hf download hf://datasets/Vinyeh/AutoOntologyBench/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/pod-security-policy/read-only-root-filesystem/src.cel
-
curl -L -o src.cel https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/pod-security-policy/read-only-root-filesystem/src.cel
1.76 kB
| variables: | |
| - name: containers | |
| expression: 'has(variables.anyObject.spec.containers) ? variables.anyObject.spec.containers : []' | |
| - name: initContainers | |
| expression: 'has(variables.anyObject.spec.initContainers) ? variables.anyObject.spec.initContainers : []' | |
| - name: ephemeralContainers | |
| expression: 'has(variables.anyObject.spec.ephemeralContainers) ? variables.anyObject.spec.ephemeralContainers : []' | |
| - name: exemptImagePrefixes | |
| expression: | | |
| !has(variables.params.exemptImages) ? [] : | |
| variables.params.exemptImages.filter(image, image.endsWith("*")).map(image, string(image).replace("*", "")) | |
| - name: exemptImageExplicit | |
| expression: | | |
| !has(variables.params.exemptImages) ? [] : | |
| variables.params.exemptImages.filter(image, !image.endsWith("*")) | |
| - name: exemptImages | |
| expression: | | |
| (variables.containers + variables.initContainers + variables.ephemeralContainers).filter(container, | |
| container.image in variables.exemptImageExplicit || | |
| variables.exemptImagePrefixes.exists(exemption, string(container.image).startsWith(exemption))).map(container, container.image) | |
| - name: badContainers | |
| expression: | | |
| (variables.containers + variables.initContainers + variables.ephemeralContainers).filter(container, | |
| !(container.image in variables.exemptImages) && | |
| (!has(container.securityContext) || | |
| !has(container.securityContext.readOnlyRootFilesystem) || | |
| container.securityContext.readOnlyRootFilesystem != true) | |
| ).map(container, container.name) | |
| validations: | |
| - expression: '(has(request.operation) && request.operation == "UPDATE") || size(variables.badContainers) == 0' | |
| messageExpression: '"only read-only root filesystem container is allowed: " + variables.badContainers.join(", ")' | |