Work through the policy reports namespace by namespace: add securityContext (non-root, read-only root fs where possible, drop capabilities), requests/limits, digests
For workloads that legitimately need an exception, add a PolicyException with a reason in a comment
Switch policies to Enforce one at a time and watch for rejected deployments
Demo: kubectl run a privileged pod and a :latest image; both are rejected with a clear message
Tools
Kyverno, kubectl.
Done when
All roadmap policies run in Enforce
Violations are at zero apart from documented exceptions
pulumi up for all stacks still passes
Portfolio evidence
Violation count before/after
Screenshot of a rejected pod
Decision record: rollout approach and exception handling
Part of the security roadmap. Keep the evidence below for the write-up (README / blog post).
## Why
Policies in audit mode only report. The goal is enforcement without breaking running services, which is exactly the rollout problem companies face.
**Enterprise practice:** staged rollout (audit → fix → enforce) with documented, time-boxed exceptions.
Depends on kasun/homelab-infrastructure-as-code#84 and kasun/homelab-ansible#19 (Renovate pins the image digests).
## Steps
- [ ] Work through the policy reports namespace by namespace: add `securityContext` (non-root, read-only root fs where possible, drop capabilities), requests/limits, digests
- [ ] For workloads that legitimately need an exception, add a `PolicyException` with a reason in a comment
- [ ] Switch policies to `Enforce` one at a time and watch for rejected deployments
- [ ] Demo: `kubectl run` a privileged pod and a `:latest` image; both are rejected with a clear message
## Tools
Kyverno, kubectl.
## Done when
- All roadmap policies run in `Enforce`
- Violations are at zero apart from documented exceptions
- `pulumi up` for all stacks still passes
## Portfolio evidence
- [ ] Violation count before/after
- [ ] Screenshot of a rejected pod
- [ ] Decision record: rollout approach and exception handling
---
_Part of the security roadmap. Keep the evidence below for the write-up (README / blog post)._
claude-botBot
added this to the Security Roadmap 2: Policy as code in Kubernetes milestone 2026-12-03 04:39:33 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
Policies in audit mode only report. The goal is enforcement without breaking running services, which is exactly the rollout problem companies face.
Enterprise practice: staged rollout (audit → fix → enforce) with documented, time-boxed exceptions.
Depends on kasun/homelab-infrastructure-as-code#84 and kasun/homelab-ansible#19 (Renovate pins the image digests).
Steps
securityContext(non-root, read-only root fs where possible, drop capabilities), requests/limits, digestsPolicyExceptionwith a reason in a commentEnforceone at a time and watch for rejected deploymentskubectl runa privileged pod and a:latestimage; both are rejected with a clear messageTools
Kyverno, kubectl.
Done when
Enforcepulumi upfor all stacks still passesPortfolio evidence
Part of the security roadmap. Keep the evidence below for the write-up (README / blog post).