Privilege Escalation with Docker Container

Privilege Escalation with Docker Container
This article discusses how to gain root access to a host system from within a Docker container by using privileged mode and mounting the host filesystem, highlighting the potential security risks involved. It also covers methods to prevent such exploitations, including using rootless mode and security policies like SELinux or AppArmor. (Affected: Docker environments and host systems)

Keypoints :

  • Docker uses cgroups and namespaces to isolate container environments on the host system.
  • Running Docker containers in –privileged mode with the host filesystem mounted allows for potential root access to the host.
  • Executing the chroot command within such a container can provide an attacker with a shell on the host system.
  • Once inside the host environment, users can install packages or modify system configurations.
  • This method can be used to bypass standard privilege restrictions, posing security threats.
  • DNS issues within containers can be resolved manually by editing /etc/resolv.conf.
  • Preventative measures include running Docker in rootless mode and employing SELinux or AppArmor for mandatory access control.
  • The security vulnerabilities are actively monitored by Docker, emphasizing the importance of configuration security.
  • Caution is advised, and this technique should never be tested on critical or production systems.

Read More: https://infosecwriteups.com/privilege-escalation-using-docker-container-e9110713936b?source=rss—-7b722bfd1b8d—4

Views: 19