mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-22 16:24:48 -06:00
bb0d4e271b
Signed-off-by: lucperkins <lucperkins@gmail.com>
15 lines
335 B
Rego
15 lines
335 B
Rego
package example
|
|
|
|
default deny = false
|
|
|
|
# Reject objects without a customer label.
|
|
deny {
|
|
not input.metadata.labels.customer
|
|
}
|
|
|
|
# Reject pods referring to images outside the corporate registry.
|
|
deny {
|
|
input.kind == "Pod"
|
|
container := input.spec.containers[_]
|
|
not re_match("^registry.acmecorp.com/.+$", container.image)
|
|
} |