Skip to content

Commit

Permalink
add check for privileged containers (rule 106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willie Sana committed Jan 15, 2021
1 parent eeab9fe commit fe0c724
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/policies/opa/rego/k8s/kubernetes_pod/AC-K8-IA-PO-H-0106.json
@@ -0,0 +1,14 @@
{
"name": "priviledgedContainersEnabled",
"file": "priviledgedContainersEnabled.rego",
"template_args": {
"name": "priviledgedContainersEnabled",
"prefix": "",
"suffix": ""
},
"severity": "HIGH",
"description": "Minimize the admission of privileged containers",
"reference_id": "AC-K8-IA-PO-H-0106",
"category": "Identity and Access Management",
"version": 1
}
@@ -0,0 +1,11 @@
package accurics

{{.prefix}}{{.name}}{{.suffix}}[pod.id] {
pod := input.kubernetes_pod[_]
pod.config.spec.privileged == true
}

{{.prefix}}{{.name}}{{.suffix}}[pod.id] {
pod := input.kubernetes_pod_security_policy[_]
pod.config.spec.privileged == true
}

0 comments on commit fe0c724

Please sign in to comment.