Interview Prep/Docker/Security and scanning

How do you apply AppArmor or SELinux with Docker?

AdvancedScenarioSecurity and scanning
Answer

Situation read → Mandatory access control adds a second barrier.

What I'd do → Ubuntu: default docker-default AppArmor profile is applied automatically; custom: --security-opt apparmor=myprofile. RHEL/Fedora: enable "selinux-enabled": true in daemon.json, label mounts with :z/:Z, and keep container_t confinement.

Why → Even if processes escape other controls, MAC denies access outside policy.

Interview tip → Never run setenforce 0 to fix a mount error; fix labels.

All Docker questions Roadmap: Docker & containers

More on Security and scanning