Skip to main content
All of the catalog
Scenario

Security & Compliance (Audit → Enforce)

Take a cluster from 'policies exist' to 'policies bite'. Kyverno ships four Pod Security and best-practice ClusterPolicies in Audit mode, so nothing is blocked and every violation lands in a policy report. Your job is the part a real team owns: read the report, remediate the workload at the source, promote the policies to Enforce, prove the admission webhook now rejects a non-compliant Pod, and issue a real TLS certificate from the lab CA with cert-manager - on a namespace that is default-deny in both directions.

SecurityVerifiedk3dkind
Definition on GitHub

What you'll do

  • Read Kyverno policy reports and identify exactly which rule each workload violates
  • Remediate the go-api Deployment at the source so it satisfies all four policies - fix the workload, never the policy
  • Triage the violation you cannot fix: exempt the vendor workload with a label-scoped Kyverno PolicyException instead of widening the policy
  • Promote a policy from Audit to Enforce with 'kubectl patch', the change that turns a report into a rejection
  • Prove enforcement is real: 'kubectl apply --dry-run=server' a root Pod and watch the admission webhook refuse it
  • Issue a TLS certificate for go-api from the lab CA, wire it onto the Ingress, and prove the lab-signed leaf is what answers the TLS handshake
  • Prove the go-api namespace is really default-deny, get refused from a pod outside it, and read why the ingress and Prometheus allow rules cannot be proven the same way on k3d

Stages

  1. 1policy-engine

    Install the admission controller (Kyverno) and the certificate authority (cert-manager)

    kyvernocert-manager
  2. 2baseline-policies

    Four ClusterPolicies in Audit mode, and the lab CA chain that signs workload certificates

    kyverno-policiescert-issuers
  3. 3namespace-isolation

    Lock the go-api namespace to default-deny, re-open only what the workload needs, and add the vendor workload that cannot comply

    network-policieslegacy-workloadworkload-baseline
  4. 4observability

    The security dashboard that plots violations, certificates and admission latency

    security-dashboards

Prerequisites

--deploy-prereqs installs these into the lab for you. They are listed so you know what the scenario depends on.

ingressmonitoring/metricsmonitoring/grafanago-api

Get updates

New scenarios and faults, release notes, and news about hosted labs if and when there is some. A few emails a month at most.

We'll email you about new releases, new lab content and paid offerings such as hosted labs, courses and workshops. Unsubscribe any time.