k8s: the hyperhive namespace enforces pod security restricted
No pod in the namespace has a hostPort any more, and the census found nothing else that restricted refuses. The namespace now carries the restricted level for enforce, warn and audit, so the API server refuses a pod that drifts. The bao-login test's probe pods get the container security context restricted asks for. The controller switch test shows the API server admitting a compliant pod and refusing the same pod with a host port, a kept capability or privilege.
This commit is contained in:
parent
796fd6201f
commit
d9023217fc
1 changed files with 150 additions and 9 deletions
|
|
@ -1098,7 +1098,15 @@ in
|
|||
kind = "Namespace";
|
||||
metadata = {
|
||||
name = k8sCfg.namespace;
|
||||
labels."app.kubernetes.io/part-of" = "hyperhive";
|
||||
labels = {
|
||||
"app.kubernetes.io/part-of" = "hyperhive";
|
||||
# The API server refuses a pod that breaks Pod Security `restricted` (a
|
||||
# host port, root, a kept capability, ...), and warns on and audits a
|
||||
# workload whose pods would. The level is the cluster's own version.
|
||||
"pod-security.kubernetes.io/enforce" = "restricted";
|
||||
"pod-security.kubernetes.io/warn" = "restricted";
|
||||
"pod-security.kubernetes.io/audit" = "restricted";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue