Skip to content

Commit

Permalink
removed pod level securityContext support (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
harkirat22 authored May 19, 2021
1 parent 636515e commit bea2473
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions pkg/policies/opa/rego/k8s/kubernetes_pod/securityContextCheck.rego
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ package accurics
checkCorrectAttribute(pod.config.spec)
}

{{.prefix}}{{.name}}{{.suffix}}[pod.id] {
pod := input.kubernetes_pod_security_policy[_]
podSecurityCheck(pod.config.spec)
}

checkCorrectAttribute(spec) {
container := spec.containers[_]
containerSecurityCheck(container)
Expand All @@ -42,11 +37,6 @@ checkCorrectAttribute(spec) {
containerSecurityCheck(container)
}

checkCorrectAttribute(spec) {
secContext := spec.securityContext
podSecurityCheck(secContext)
}

containerSecurityCheck(container) {
{{.not_allowed}}
container.{{.param1}}.{{.param}} == {{.value}}
Expand All @@ -64,13 +54,3 @@ containerSecurityCheck(container) {
{{.allowed}}
not container.{{.param1}}.{{.arg1}}.{{.arg2}}
}

podSecurityCheck(secContext) {
{{.not_allowed}}
secContext.{{.param}} == {{.value}}
}

podSecurityCheck(secContext) {
{{.not_allowed}}
object.get(secContext, "{{.param}}", "undefined") == "undefined"
}

0 comments on commit bea2473

Please sign in to comment.