Created
March 19, 2021 18:17
-
-
Save jmassardo/79affccc671ed7572eca4cc769db9085 to your computer and use it in GitHub Desktop.
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
package policy["com.styra.kubernetes.validating"].test.test | |
import data.policy["com.styra.kubernetes.validating"].rules.rules | |
test_block_priv_mode { | |
in := { | |
"kind": "AdmissionReview", | |
"request": { | |
"kind": { | |
"kind": "Pod", | |
"version": "v1" | |
}, | |
"object": { | |
"metadata": { | |
"name": "myapp" | |
}, | |
"spec": { | |
"containers": [ | |
{ | |
"image": "nginx:0.1.0", | |
"name": "nginx-frontend", | |
"securityContext": { | |
"privileged": false | |
} | |
}, | |
] | |
} | |
} | |
} | |
} | |
actual := rules.block_priv_mode with input as in | |
count(actual) == 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment