trying-things/metallb-chart/policy/rbac.rego
Nicolas Belouin 79cfca92a3 Add metallb to try things out
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
2024-11-04 11:12:41 +01:00

28 lines
720 B
Rego

package main
# Validate PSP exists in ClusterRole :controller
deny[msg] {
input.kind == "ClusterRole"
input.metadata.name == "metallb:controller"
input.rules[3] == {
"apiGroups": ["policy"],
"resources": ["podsecuritypolicies"],
"resourceNames": ["metallb-controller"],
"verbs": ["use"]
}
msg = "ClusterRole metallb:controller does not include PSP rule"
}
# Validate PSP exists in ClusterRole :speaker
deny[msg] {
input.kind == "ClusterRole"
input.metadata.name == "metallb:speaker"
input.rules[3] == {
"apiGroups": ["policy"],
"resources": ["podsecuritypolicies"],
"resourceNames": ["metallb-controller"],
"verbs": ["use"]
}
msg = "ClusterRole metallb:speaker does not include PSP rule"
}