How do AppArmor and SELinux fit into container hardening?
IntermediateProductionImage Security & Hardening
Answer
They are mandatory access control layers on top of namespaces and capabilities. Docker applies the docker-default AppArmor profile on Debian/Ubuntu and container_t SELinux labels on RHEL/Fedora. Leave them on; do not use --security-opt apparmor=unconfined or label=disable to "fix" permission errors. Write custom profiles for sensitive workloads.
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerHow do you manage Trivy false positives and accepted risks?IntermediateWhich `docker run` flags make up a hardened runtime baseline?BeginnerWhat does `no-new-privileges` protect against?Beginner