Skip to main content

Impact & Risk Analysis

  • Severity: Medium
  • CIS Benchmark: CIS 5.4
  • Impact: Network Spoofing & Privilege Escalation. By default, Docker containers retain capabilities like NET_RAW, which allows an attacker to create spoofed network traffic. If a container is compromised, having unnecessary kernel capabilities (like SYS_CHROOT or DAC_OVERRIDE) allows the attacker to bypass file permissions or escape the container isolation.

Common Misconfiguration

Running containers with the default Docker capability set, or worse, using --cap-add=ALL. The default set includes capabilities like NET_RAW which are often not required for standard web applications but pose a security risk.

Vulnerable Example

Secure Example

Audit Procedure

Run the following command to inspect the capabilities of running containers:
  • Result: Review the output for each container.
  • Fail: If NET_RAW is not in CapDrop (unless explicitly required), or if CapAdd contains unnecessary privileges.
  • Pass: If the container uses CapDrop=ALL or explicitly drops NET_RAW and other unused capabilities.

Remediation

You should restrict the capabilities to the minimum required for the container to function. To remove unneeded capabilities (specifically NET_RAW):
The most secure approach is to remove all capabilities and then restore only the ones specifically used: