Skip to content

Files

Latest commit

 

History

History
28 lines (19 loc) · 560 Bytes

DL3002.md

File metadata and controls

28 lines (19 loc) · 560 Bytes

Pattern: Use of USER root as last user

Issue: -

Description

Switching to the root USER opens up certain security risks if an attacker gets access to the container. In order to mitigate this, switch back to a non privileged user after running the commands you need as root.

Example of incorrect code:

FROM busybox
USER root
RUN ...

Example of correct code:

FROM busybox
USER root
RUN ...
USER guest

Further Reading