security(kyverno): restore background coverage of kube-system, kube-public and kube-node-lease #4234
Description
🤖 Generated by the Agentic Engineer
Evidence
- security(kyverno): system namespaces have had no Kyverno policy coverage since June #4228 found that no Kyverno policy has evaluated anything in
kube-system,kube-public,kube-node-leaseorkyvernosince June, because the chart's default resource filters exclude those namespaces and background scans honour the filters. - With fix(kyverno): exclude the system namespaces from auto-vpa explicitly #4232 merged, every background policy that generates or mutates existing resources already excludes
kube-system,kube-publicandkube-node-leaseexplicitly (add-default-deny,add-default-limitrange,add-ns-quota,disable-default-sa-automount,auto-vpa; the Hetzner retrofits are scoped tolonghorn-systemor to cluster-scoped Nodes). - The
kyvernonamespace is different:add-default-denyandadd-default-limitrangedo not exclude it. Dropping its filter would make Kyverno generate a default-deny NetworkPolicy in its own namespace and adefault-limitrangethat collides with the Flux-owned one of the same name. It stays filtered in this slice. - Admission is unchanged for
kube-system(the webhooks'namespaceSelectoralready skips it).kube-publicandkube-node-leasehold only ConfigMaps and node Leases; everyEnforcerule on prod matches Pods or GitHub team objects, so none newly blocks anything there.
Audience and problem
The maintainer reads the compliance aggregate as the cluster's policy state, but it silently leaves out the namespaces that run the cluster's core workloads.
Hypothesis
Dropping the three Kubernetes system namespaces from the resource filters gives them current background reports, with no new admission effect and no generated or mutated resources there.
Success signal
A policy matching a resource in kube-system, kube-public or kube-node-lease produces a current report within two scan intervals (proved on a throwaway cluster in CI), and the reports controller's memory stays within its limit for a week after rollout.
Smallest useful change
Remove the three [*/*,<namespace>,*] entries through resourceFiltersExclude, keep kyverno filtered, invert the throwaway-cluster proof so it requires a report in the three namespaces and none in kyverno, and update docs/policy-reports.md.
Acceptance criteria
- The CI proof shows a current report for a matching resource in each of the three namespaces and none in
kyverno. - No generate or mutate-existing policy acts in the three namespaces.
- The docs describe which namespaces Kyverno covers and why
kyvernois still excluded.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fields✅ Done
Activity
chore: agent-claim #4234 nonce=cdca769cc4b18b033bd8d1bee0759153