Skip to content

Instantly share code, notes, and snippets.

@jmassardo
Created March 19, 2021 18:17
Show Gist options
  • Save jmassardo/79affccc671ed7572eca4cc769db9085 to your computer and use it in GitHub Desktop.
Save jmassardo/79affccc671ed7572eca4cc769db9085 to your computer and use it in GitHub Desktop.
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