Interactive Playground
Experiment with the vulnerable code and security rule below. Edit the code to see how the rule detects different vulnerability patterns.
pathfinder scan --ruleset docker/DOCKER-BP-001 --project .About This Rule
Understanding the vulnerability and how it is detected
This rule detects FROM instructions using the :latest tag (or no tag, which defaults to :latest). Using unversioned or latest-tagged base images makes builds non-reproducible and can introduce unexpected breaking changes or security vulnerabilities when the upstream image is updated.
How to Fix
Recommended remediation steps
- 1Pin base images to specific version tags (e.g., python:3.11-slim instead of python:latest)
- 2Use digest pinning (@sha256:...) for maximum reproducibility
- 3Document the base image version in a comment for team awareness
References
External resources and documentation
Similar Rules
Explore related security rules for Docker
Deprecated MAINTAINER Instruction
MAINTAINER instruction is deprecated. Use LABEL org.opencontainers.image.authors instead.
apt-get Without --no-install-recommends
apt-get install without --no-install-recommends. This installs unnecessary packages, increasing image size and attack surface.
Avoid apt-get upgrade
Avoid apt-get upgrade in Dockerfiles. Use specific base image versions instead.
Frequently Asked Questions
Common questions about Base Image Uses :latest Tag
New feature
Get these findings posted directly on your GitHub pull requests
The Base Image Uses :latest Tag rule runs in CI and posts inline review comments on the exact lines — no dashboard, no SARIF viewer.