Roadmap 2.1: Deploy Kyverno with Pod Security Standards in audit mode #83

Open
opened 2026-12-03 04:39:32 +01:00 by claude-bot · 0 comments

Why

Nothing in the cluster currently stops a privileged pod, a :latest image or a container running as root. An admission controller enforces security rules on every resource, whoever or whatever creates it.

Enterprise practice: policy as code with an admission controller, rolled out in audit mode first.

Steps

  • Add the kyverno Helm chart (pinned version) to 03-k8s-infra, namespace kyverno
  • Add the kyverno-policies chart with podSecurityStandard: restricted and validationFailureAction: Audit
  • Exclude system namespaces that legitimately need privileges (kube-system, longhorn-system, kube-vip) via the chart's exclusions, with a comment why
  • Enable Kyverno's ServiceMonitors so kube-prometheus-stack scrapes them (check the release label / serviceMonitorSelector)
  • Optional: Policy Reporter UI to browse results

Tools

Kyverno, Pulumi (Helm), Prometheus.

Done when

  • kubectl get policyreport -A shows results for all app namespaces
  • The list of current violations per namespace is written down (input for 2.3)

Portfolio evidence

  • Screenshot of the policy reports / Policy Reporter
  • Number of violations at the start (baseline)

Part of the security roadmap. Keep the evidence below for the write-up (README / blog post).

## Why Nothing in the cluster currently stops a privileged pod, a `:latest` image or a container running as root. An admission controller enforces security rules on every resource, whoever or whatever creates it. **Enterprise practice:** policy as code with an admission controller, rolled out in audit mode first. ## Steps - [ ] Add the `kyverno` Helm chart (pinned version) to `03-k8s-infra`, namespace `kyverno` - [ ] Add the `kyverno-policies` chart with `podSecurityStandard: restricted` and `validationFailureAction: Audit` - [ ] Exclude system namespaces that legitimately need privileges (`kube-system`, `longhorn-system`, kube-vip) via the chart's exclusions, with a comment why - [ ] Enable Kyverno's ServiceMonitors so `kube-prometheus-stack` scrapes them (check the `release` label / `serviceMonitorSelector`) - [ ] Optional: Policy Reporter UI to browse results ## Tools Kyverno, Pulumi (Helm), Prometheus. ## Done when - `kubectl get policyreport -A` shows results for all app namespaces - The list of current violations per namespace is written down (input for 2.3) ## Portfolio evidence - [ ] Screenshot of the policy reports / Policy Reporter - [ ] Number of violations at the start (baseline) --- _Part of the security roadmap. Keep the evidence below for the write-up (README / blog post)._
claude-bot Bot added this to the Security Roadmap 2: Policy as code in Kubernetes milestone 2026-12-03 04:39:32 +01:00
claude-bot Bot added the
Priority
Medium
3
Kind/Securitysecurity-roadmap
labels 2026-12-03 04:39:32 +01:00
claude-bot Bot added this to the Security Roadmap project 2026-12-03 04:39:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kasun/homelab-infrastructure-as-code#83