Real-World Example

Let's look at the practices we learned in light of a real-world example.

A great example of a container-related vulnerability that can be prevented by implementing some of the best practices we’ve discussed, occurred in February 2019. CVE-2019-5736 allows a container process running as root to escape its container and gain root access on the host and all containers running on that host.

As dangerous as the vulnerability is, the following things that we covered in this chapter would have prevented the issue:

  • Vulnerability scanning
  • Not running processes as root
  • Enabling SELinux

As the vulnerability has a CVE number, security scanning tools would have found it and made an alert. Also, organizations that did not allow container processes to run as root would have been protected, as the issue only affects processes running as root. Finally, common SELinux policies, such as those that ship with RHEL and CentOS, prevented the issue.

All in all, this is a great real-world example of the benefits of defense in-depth and other security-related best practices.

Get hands-on with 1200+ tech skills courses.