turbot/docker_compliance
GitHub
Loading controls...

Control: 5.26 Ensure that the container is restricted from acquiring additional privileges

Description

You should restrict the container from acquiring additional privileges via suid or sgid bits.

A process can set the no_new_priv bit in the kernel and this persists across forks, clones and execve. The no_new_priv bit ensures that the process and its child processes do not gain any additional privileges via suid or sgid bits. This reduces the danger associated with many operations because the possibility of subverting privileged binaries is lessened.

Remediation

You should start your container with the options below:

docker run --rm -it --security-opt=no-new-privileges ubuntu bash

Default Value

By default, new privileges are not restricted.

Usage

Run the control in your terminal:

steampipe check docker_compliance.control.cis_v160_5_26

Snapshot and share results via Steampipe Cloud:

steampipe login
steampipe check --share docker_compliance.control.cis_v160_5_26

SQL

This control uses a named query:

docker_container_no_new_privileges

Tags