Supply Chain Security — protecting the entire process: from writing code to running containers.
Defense layers:
1. SBOM (Software Bill of Materials):
1# Generate SBOM2syft myapp:latest -o spdx-json > sbom.json3trivy image --format spdx-json myapp:latest > sbom.json45# Check SBOM6trivy sbom sbom.json
2. Container Image Signing (Cosign):
1cosign sign ghcr.io/myorg/myapp:latest2cosign verify \3 --certificate-identity=ci@myorg.com \4 --certificate-oidc-issuer=https://token.actions.githubusercontent.com \5 ghcr.io/myorg/myapp:latest
3. Admission Control (Kyverno):
1apiVersion: kyverno.io/v12kind: ClusterPolicy3metadata:4 name: verify-and-scan5spec:6 validationFailureAction: Enforce7 rules:8 - name: verify-image9 verifyImages:10 - imageReferences: ["ghcr.io/myorg/*"]11 attestors:12 - entries:13 - keys:14 publicKeys: "-----BEGIN PUBLIC KEY-----..."15 - name: check-no-latest16 match:17 any:18 - resources:19 kinds: ["Pod"]20 validate:21 message: "Using :latest is prohibited"22 pattern:23 spec:24 containers:25 - image: "!*:latest"
4. CI/CD Security:
Chain: Code → Scan → Sign → SBOM → Verify → Deploy.