-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add check for privileged containers (rule 106)
- Loading branch information
Willie Sana
committed
Jan 15, 2021
1 parent
eeab9fe
commit fe0c724
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
pkg/policies/opa/rego/k8s/kubernetes_pod/AC-K8-IA-PO-H-0106.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
11 changes: 11 additions & 0 deletions
11
pkg/policies/opa/rego/k8s/kubernetes_pod/priviledgedContainersEnabled.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |