Secret in Build Argument
CRITICALBuild argument name suggests it contains a secret. ARG values are visible in image history via 'docker history'.
Build argument name suggests it contains a secret. ARG values are visible in image history via 'docker history'.
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-005 --project .Explore related security rules for Docker
Dockerfile uses 'sudo' in RUN instructions. This is unnecessary during
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.
Common questions about Secret in Build Argument
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-005 --project .This rule is aligned with industry-standard security frameworks and classifications: