Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions policies/kubernetes/required-labels.rego
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ deny contains msg if {
sc := object.get(container, "securityContext", {})
readOnly := object.get(sc, "readOnlyRootFilesystem", false)
readOnly != true
msg := sprintf("Deployment/%s: container '%s' should use read-only root filesystem", [obj.metadata.name, container.name])
msg := sprintf("Deployment/%s: container '%s' must use read-only root filesystem", [obj.metadata.name, container.name])
}

# Check for liveness and readiness probes
Expand All @@ -66,13 +66,13 @@ deny contains msg if {
obj.kind == "Deployment"
container := obj.spec.template.spec.containers[_]
not container.livenessProbe
msg := sprintf("Deployment/%s: container '%s' should define a livenessProbe", [obj.metadata.name, container.name])
msg := sprintf("Deployment/%s: container '%s' must define a livenessProbe", [obj.metadata.name, container.name])
}

deny contains msg if {
obj := input
obj.kind == "Deployment"
container := obj.spec.template.spec.containers[_]
not container.readinessProbe
msg := sprintf("Deployment/%s: container '%s' should define a readinessProbe", [obj.metadata.name, container.name])
msg := sprintf("Deployment/%s: container '%s' must define a readinessProbe", [obj.metadata.name, container.name])
}