This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
gitops-tbrnt/_test/policies/deployment.rego
Tobias Brunner cd264d9046
Some checks failed
continuous-integration/drone/push Build is failing
enhance conftest - mirror rego
2020-05-04 21:03:53 +02:00

14 lines
312 B
Rego

package main
deny[msg] {
input.kind = "Deployment"
not input.spec.template.spec.securityContext.runAsNonRoot = true
msg = "Containers must not run as root"
}
deny[msg] {
input.kind = "Deployment"
not input.spec.selector.matchLabels.app
msg = "Containers must provide app label for pod selectors"
}