-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: AnaisUrlichs <urlichsanais@gmail.com>
- Loading branch information
1 parent
bfef710
commit de4e25b
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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,24 @@ | ||
# METADATA | ||
# title: "default ServiceAccount not allowed" | ||
# description: "Ensure Workflow pods are not using the default serviceAccountName" | ||
# scope: package | ||
# custom: | ||
# id: | ||
# avd_id: | ||
# severity: HIGH | ||
# provider: Kubernetes | ||
# short_code: default-serviceaccount-not-allowed | ||
# recommended_action: "Default ServiceAccount not allowed" | ||
package builtin.argowf | ||
|
||
deny[msg] { | ||
input.kind == "Workflow" | ||
not input.spec.serviceAccountName | ||
msg := "Ensure Workflow pods are not using the default ServiceAccount" | ||
} | ||
|
||
deny[msg] { | ||
input.kind == "Workflow" | ||
input.spec.serviceAccountName == "default" | ||
msg := "Ensure Workflow pods are not using the default ServiceAccount" | ||
} |
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,26 @@ | ||
# METADATA | ||
# title: "ensure workflow pods are running as non root" | ||
# description: "Ensure Workflow pods are running as non root" | ||
# scope: package | ||
# related_resources: | ||
# - https://argo-workflows.readthedocs.io/en/latest/workflow-pod-security-context/ | ||
# custom: | ||
# id: ID002 | ||
# avd_id: AVD-ARGOWF-0002 | ||
# severity: HIGH | ||
# provider: Kubernetes | ||
# short_code: non-root-argowf | ||
# recommended_action: "Ensure pods are running as non root" | ||
package custom.argowf.ID002 | ||
|
||
deny[msg] { | ||
input.kind == "Workflow" | ||
not input.spec.securityContext.runAsNonRoot | ||
msg = "Workflow should not run as root and securityContext.runAsNonRoot for the workflow should be set to true." | ||
} | ||
|
||
deny[msg] { | ||
input.kind == "Workflow" | ||
input.spec.securityContext.runAsNonRoot != true | ||
msg = "Workflow should not run as root and securityContext.runAsNonRoot for the workflow should be set to true." | ||
} |