Break/Fix Drill Focus
- Intentionally fail: Trigger a permission failure by setting
readOnlyRootFilesystem: trueon an app that needs to write logs. - Fix securely: Resolve the failure by adding an
emptyDirvolume instead of settingreadOnlyRootFilesystem: false. - Capture evidence: Compare the before and after manifest diff and explain the risk reduction.
Core Exercises (Required)
- Check User ID: Exec into a running
backendpod and runid. Verify that it is notroot. - Verify Read-Only: Try to
touch /bin/testinside a running pod. Verify that it fails withRead-only file system. - Inspect Seccomp: Check the
seccompProfileof a running pod usingkubectl get pod <pod> -o yaml. Verify that it is set toRuntimeDefault.
Challenge Exercise (Optional)
Iterative Hardening From Zero: Start from a fully insecure manifest (root user, writable filesystem, all capabilities, no seccomp) and iteratively harden it to match the golden baseline, documenting each change and its security impact.
Done When
You have completed this chapter when:
- You can prove both
backendandfrontendworkloads run non-root. - You can diagnose and fix permission failures without using root or privileged mode.
- You can explain why privileged shortcuts are rejected in production.
- You understand the risk reduction provided by a read-only root filesystem.
Knowledge Check
Before finishing this chapter, complete the Quiz to verify your understanding of the guardrail principles.