Sudo Usage in Dockerfile
MEDIUMDockerfile uses 'sudo' in RUN instructions. This is unnecessary during
Dockerfile uses 'sudo' in RUN instructions. This is unnecessary during
Experiment with the vulnerable code and security rule below. Edit the code to see how the rule detects different vulnerability patterns.
pathfinder ci --ruleset docker/DOCKER-SEC-007 --project .Explore related security rules for Docker
Dockerfile mounts Docker socket. This gives the container full control over the host Docker daemon, equivalent to root access.
Dockerfile does not specify USER instruction. Container will run as root by default, which increases the attack surface if the container is compromised.
Build argument name suggests it contains a secret. ARG values are visible in image history via 'docker history'.
Common questions about Sudo Usage in Dockerfile
Use Code Pathfinder to scan your Docker codebase and automatically detect instances of this vulnerability pattern. Install Code Pathfinder and run the following command in your project directory:
pathfinder ci --ruleset docker/DOCKER-SEC-007 --project .This rule is aligned with industry-standard security frameworks and classifications: