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

14 lines
312 B
Rego
Raw Normal View History

2020-05-04 19:03:53 +00:00
package main
2020-05-04 19:15:38 +00:00
warn[msg] {
2020-05-04 19:03:53 +00:00
input.kind = "Deployment"
not input.spec.template.spec.securityContext.runAsNonRoot = true
msg = "Containers must not run as root"
}
2020-05-04 19:15:38 +00:00
warn[msg] {
2020-05-04 19:03:53 +00:00
input.kind = "Deployment"
not input.spec.selector.matchLabels.app
msg = "Containers must provide app label for pod selectors"
}