Skip to content

Critical security flaw: User should not be root when the Dockerfile completes #876

Closed
@philipjonsen

Description

@philipjonsen

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.

BAD PRACTICE:

FROM debian:buster
USER root
RUN ...

RECOMMENDED:

FROM debian:buster
USER root
RUN ...
USER guest

Last USER should not be root on these places:

hive/blob/master/clients/besu/Dockerfile#L6-L6
hive/blob/master/clients/openethereum/Dockerfile#L11-L11
hive/blob/master/clients/teku-vc/Dockerfile#L6-L6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions