Supply Chain Attacks
Attackers increasingly target how software is built and delivered, not only the running app: poisoned open-source packages, stolen CI credentials, tampered images, malicious GitHub Actions. The goal is to prove what is in your software and how it was built.
| Risk | Defense |
|---|---|
| Malicious or vulnerable dependency | Lock files, pinned versions, SCA, Dependabot/Renovate, private registry proxies, review new dependencies |
| Compromised CI pipeline | Least-privilege tokens, OIDC, ephemeral runners, pinned actions, protected branches, required reviews |
| Tampered image | Sign images, verify signatures at admission, deploy by digest |
| Unknown contents | Generate and store SBOMs |
| Typosquatting and dependency confusion | Scoped registries, allow lists, internal package names reserved |
SBOM and Provenance
SLSA (Supply-chain Levels for Software Artifacts) is a framework with levels describing build integrity. Higher levels require builds on a hosted, isolated build service that creates signed provenance (who built what from which source). GitHub provides actions/attest-build-provenance and a SLSA generator for this.
Sign and Verify Images
Enforce at Admission: Kyverno
Admission controllers check or change objects before Kubernetes stores them. Kyverno uses plain YAML policies. OPA Gatekeeper uses Rego.
Audit mode, review violations, fix workloads, then switch to Enforce.
Pod Security
Pod Security Standards have three profiles: privileged (no limits), baseline (blocks known escalations) and restricted (hardened best practice). Kubernetes enforces them per namespace through the built-in Pod Security Admission.
Cluster Hardening Checklist
- API server: private endpoint or restricted CIDRs, audit logging on, anonymous auth off
- RBAC: least privilege, no wildcard roles, review
cluster-adminbindings, short-lived human access via SSO - Secrets: encryption at rest, external secret manager, no secrets in env when avoidable
- Network: default-deny NetworkPolicies, then allow needed flows. Consider a service mesh (mTLS)
- Nodes: minimal OS, auto patching, no SSH, restrict instance metadata access (IMDSv2, hop limit)
- Images: trusted registries only, scan, sign, non-root
- etcd: encrypted, restricted, backed up
- Keep Kubernetes updated within the supported versions
Benchmarks and Scanners
Runtime Detection with Falco
Falco watches system calls using eBPF and alerts on suspicious behavior: shells in containers, reading /etc/shadow, unexpected network connections, privilege escalation. Send alerts to your SIEM or chat.
Compliance as Code
- Express rules as policies (Kyverno, OPA, Azure Policy, AWS Config rules, Terraform Sentinel/OPA)
- Evaluate them continuously and in pipelines, not once a year
- Collect evidence automatically: scan reports, change history from Git, access logs
- Map controls to frameworks such as CIS, SOC 2, ISO 27001, PCI DSS and HIPAA, with the help of your compliance team
- Use cloud posture tools: AWS Security Hub, Microsoft Defender for Cloud, Google Security Command Center, open-source Prowler and ScoutSuite
CKS and Security Certification Notes
- The Certified Kubernetes Security Specialist (CKS) is a hands-on exam that requires an active CKA
- Topics: cluster setup and hardening, system hardening, minimizing microservice vulnerabilities, supply chain security, monitoring, logging and runtime security
- Practice with Pod Security, NetworkPolicy, RBAC, AppArmor and seccomp profiles, Falco, Trivy, audit policy and ImagePolicyWebhook
- Check the Linux Foundation site for the current curriculum and Kubernetes version
Practice Tasks
- Generate an SBOM for an image and scan it later with Grype
- Sign an image in CI with cosign and verify it in a Kyverno policy on a kind cluster
- Label a namespace with the
restrictedPod Security level and fix a Deployment to pass - Apply default-deny NetworkPolicies and add explicit allows
- Run kube-bench and fix three findings
Conclusion
Supply chain security proves what you ship with SBOMs, provenance and signatures, admission policies enforce it in the cluster, and hardening plus runtime detection limit damage. Roll out policies in audit mode first.

