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 6820c0ae9e
All checks were successful
continuous-integration/drone/push Build is passing
only warn for some policies
2020-05-04 21:15:38 +02:00

14 lines
312 B
Rego

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