Interview Prep/DevSecOps/Container and IaC Security

After enabling `readOnlyRootFilesystem: true`, the app crashes writing to `/tmp`. How do you proceed?

IntermediateScenarioContainer and IaC Security
Answer

Situation read → Read-only root is a good control; the app just needs explicit writable paths.

What I'd do →

  1. Find the writes: kubectl logs shows Read-only file system errors with the path.
  2. Mount emptyDir at the needed paths:
volumeMounts:
  - name: tmp
    mountPath: /tmp
volumes:
  - name: tmp
    emptyDir: {}
  1. Redirect caches and logs to stdout or those mounts.
  2. Keep readOnlyRootFilesystem: true.

Why → An attacker cannot drop binaries into the image filesystem.

Interview tip → Do not remove the control to fix the symptom.

All DevSecOps questions Roadmap: Policy as code

More on Container and IaC Security