Kyverno policies for the chart's defaults, and a test that bad values fail #22

Merged
jcoffey-dev merged 1 commits from feat/policy-checks into main 2026-11-19 01:37:57 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 67d0f8284c Kyverno policies for the chart's defaults, and a test that bad values fail
lab/policy/defaults.yaml: four ValidatingPolicies for what Pod Security
restricted doesn't check, in namespaces labelled inbuxa.org/policy=enforce:
a read-only root, no service-account token except the upgrade Job's, no
secret in the environment (warn until the chart's server image is rc.32),
and a deny-all NetworkPolicy over every pod. Autogen applies them to
Deployments and Jobs too.

lab/policy/policy-test.sh: the chart as the lab installs it is admitted;
networkPolicy.enabled=false is refused; a secret in extraEnv is flagged;
the schema refuses a securityContext value; a writable root, a token or an
added capability in an edited manifest are refused.

up.sh installs Kyverno 1.19.2 (chart 3.9.2) and the policies.
2026-11-18 18:24:04 -07:00