KCSA: Compliance and Security Frameworks
10% of the KCSA exam, 4 competencies. Back to the KCSA overview.
Each competency lists what to know and the official documentation to read, then a demo you can run. Demos run on the demo lab, a throwaway kind cluster on your own machine; set it up once before you start.
Compliance Frameworks
Section titled “Compliance Frameworks”Know
- Regulations (PCI DSS, HIPAA, GDPR) say what to protect; benchmarks such as the CIS Kubernetes Benchmark say how to configure it.
Read
Threat Modeling Frameworks
Section titled “Threat Modeling Frameworks”Know
- STRIDE and MITRE ATT&CK for containers describe what attackers do, so you can map controls to threats.
Read
Supply Chain Compliance
Section titled “Supply Chain Compliance”Know
- SBOMs, signed artifacts, and provenance attestations give evidence of what was deployed.
Read
Demo: Read the official SBOM of a Kubernetes release
-
Kubernetes publishes an SPDX SBOM for every release. List the images it contains.
Terminal window curl -Ls https://sbom.k8s.io/v1.37.2/release | grep 'SPDXID: SPDXRef-Package-registry.k8s.io' | headcurl -Ls https://sbom.k8s.io/v1.37.2/release | grep -c '^PackageName:'
What you should see: The SBOM lists every package and image in the release. Compliance frameworks increasingly ask suppliers for exactly this: a machine-readable list you can scan for vulnerable components when the next CVE lands.
Automation and Tooling
Section titled “Automation and Tooling”Know
- Benchmarks and policies are checked by tools: kube-bench for CIS, policy engines for admission, scanners for images.
Read
Demo: A pre-merge gate with server-side dry run
-
Create a namespace for this demo and make it the default for your context.
Terminal window kubectl create namespace kcsa-gatekubectl config set-context --current --namespace=kcsa-gate -
Check manifests against the live cluster’s admission rules without changing anything.
Terminal window kubectl label namespace kcsa-gate pod-security.kubernetes.io/enforce=restrictedcat > candidate.yaml <<'EOF'apiVersion: apps/v1kind: Deploymentmetadata:name: candidatenamespace: kcsa-gatespec:replicas: 1selector:matchLabels:app: candidatetemplate:metadata:labels:app: candidatespec:containers:- name: appimage: registry.k8s.io/e2e-test-images/agnhost:2.66.1args: ["netexec", "--http-port=8080"]EOFkubectl apply --dry-run=server -f candidate.yaml; echo "exit code $?"kubectl get deployments
What you should see: The dry run passes (exit code 0) but prints a PodSecurity warning: Deployments are admitted and only their pods are checked, so in a real apply the ReplicaSet would fail to create pods. A gate should treat warnings as failures (--warnings-as-errors) and check workloads with a policy engine, not only the API server’s answer.
Clean up:
rm -f candidate.yamlkubectl config set-context --current --namespace=defaultkubectl delete namespace kcsa-gateDomain and competency names are from the CNCF KCSA curriculum (current curriculum (unversioned)), cncf/curriculum, licensed CC BY 4.0. Summaries, demos, and exercises are original to this site.