5.22 Ensure that docker exec commands are not used with the privileged option

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

You should not use docker exec with the --privileged option.

Rationale:

Using the --privileged option in docker exec commands gives extended Linux capabilities to the command. This could potentially be an insecure practice, particularly when you are running containers with reduced capabilities or with enhanced restrictions.

Impact:

If you need enhanced capabilities within a container, then run it with all the permissions it requires. These should be specified individually.

Solution

You should not use the --privileged option in docker exec commands.

Default Value:

By default, the docker exec command runs without the --privileged option.

See Also

https://workbench.cisecurity.org/files/4244