{{ summaryTitle }} {{ summaryValue }} {{ summaryLine }} {{ badge.label }} {{ badge.value }}
Dockerfile security review inputs
Review base-image pins, final-user posture, secret-like declarations, copy scope, package hygiene, and runtime basics.
{{ sourceStatus }}
Choose the release context that should govern this static review.
{{ workflowFeedback }}
Leave blank to use a generic Dockerfile review label in handoffs.
Keep only registry hosts already approved for base images in this review context.
Apply strict release digest reminders without changing the selected profile.
{{ force_digest_pin ? 'Enabled' : 'Disabled' }}
Keep low-priority cleanup reminders in the score, findings, remediation, chart, and handoffs.
{{ include_low_signals ? 'Enabled' : 'Disabled' }}
Choose between 5 and 200 rows for the visible ledger.
rows
{{ exportAnnouncement }}
SeverityControlLineSignalEvidenceNext actionCopy
{{ row.severity }}{{ row.category }}{{ row.line }}{{ row.signal }}{{ row.evidence }}{{ row.action }}
{{ exportAnnouncement }}
{{ exportAnnouncement }}
PriorityControlChangeVerificationCopy
{{ row.priority }}{{ row.category }}{{ row.action }}{{ row.verify }}
{{ exportAnnouncement }}

A Dockerfile determines far more than how application files enter an image. It chooses the software supply-chain starting point, decides which build material can persist in layers, sets the runtime identity, and defines the command and health behavior operators will inherit. A short file can therefore carry several release risks at once.

Static review is most useful before a build, when risky defaults are still cheap to change. A mutable base tag can drift between rebuilds, a broad context copy can pull local secrets into a layer, and an ARG or ENV declaration can preserve sensitive material in image metadata or history. Running as root and exposing management ports expand the impact of a later compromise.

  • Base-image trust covers the registry, tag or digest, and the deliberate process used to refresh pinned images.
  • Build containment keeps secrets, unrelated files, remote installers, and package-manager residue out of the finished image.
  • Runtime least privilege uses an explicit non-root user, narrow permissions, an absolute working directory, and only the listener the application needs.
  • Operational readiness includes an explicit command and, for a service profile, a bounded healthcheck that tests useful behavior.

Some practices involve tradeoffs rather than universal bans. Digest pins make a build reproducible but must be updated to receive patched base images. ADD has legitimate archive and remote-fetch behavior, while COPY is clearer for ordinary file transfer. A CI builder image may not need a runtime healthcheck, but a long-running service usually benefits from one.

A clean static result is only a baseline. It cannot reveal vulnerable packages in the resolved image, secrets hidden in copied files, a compromised base image, unsafe container privileges, or a command that fails after startup. Build the image, scan it, inspect its contents and provenance, and exercise the runtime path before release.

How to Use This Tool:

Review the exact Dockerfile intended for the release and select the profile that matches the final image's job.

  1. Paste the Dockerfile source or load one Dockerfile or plain-text file up to 512 KiB. Remove real credentials before sharing or saving review evidence.
  2. Choose Runtime service, CI builder image, or Strict release gate. The service profiles expect a final-stage healthcheck; strict release also requires digest pins.
  3. Set the approved Trusted registries. Enable Force digest-pin checks when local policy requires digests outside the strict profile, and disable Include low signals only when the review intentionally excludes Low and Info findings.
  4. Review the highest-severity rows before the numeric score. Each finding names a line when one is available, the matched signal, evidence, and a suggested correction.
  5. Verify fixes by building with current Docker checks, scanning packages and secrets, confirming the final user and image contents, and running the health and startup paths.

Interpreting Results:

The Risk band follows severity before score. Any Critical finding is Blocked; any High finding is Needs hardening; and any Medium finding is at least Review. Weighted points can raise a collection of lower findings into those same bands, but they cannot lower a severe finding.

  • Baseline clear means no enabled static rule matched. It is not a release approval.
  • Low-signal cleanup contains only Low or Info findings and remains worth reviewing for maintainability and attack-surface reduction.
  • Review means at least one Medium finding or a score of 10 to 27 without a High or Critical finding.
  • Needs hardening means at least one High finding or a score of 28 or more without a Critical finding.
  • Blocked means the Dockerfile has no usable FROM instruction or another Critical base-image defect.

Technical Details:

The review joins continued physical lines into Dockerfile instructions, ignores blank lines and comments, and assigns each instruction to its build stage. Final-user, work-directory, command, and healthcheck rules inspect only the last stage, while base-image, secret, context, package, permission, port, and build-check rules can apply across stages.

Rule Core

Dockerfile security baseline rules
ControlSignals checkedSeverity
Base imageMissing or empty FROM; mutable or weak tags such as no tag, latest, a bare major version, or branch-like tags; dynamic build-argument bases; missing digest under digest policy; and registries absent from the approved list. scratch is exempt from tag, digest, and registry checks.Critical for missing or empty base; High for weak tag; Medium for dynamic base or missing required digest; Low for unapproved registry.
Runtime userFinal stage has no USER, explicitly uses root or UID 0, or runs sudo or su in a build step.High.
SecretsARG or ENV names that resemble passwords, tokens, keys, credentials, or service URLs, plus several recognizable credential and private-key value patterns.High.
Build contextBroad or remote ADD, ordinary ADD where COPY is clearer, and broad COPY . forms that can import unrelated files.High for broad or remote ADD; Medium for broad COPY; Low for ordinary ADD preference.
Package hygieneRemote installer piped to a shell; APT install without --no-install-recommends or same-layer metadata cleanup; APK without --no-cache; DNF or YUM without clean all; and pip without --no-cache-dir.High for installer pipe; Medium for APT rules; Low for APK, RPM, or pip cache rules.
Runtime surfaceWorld-writable mode 777, exposed SSH or Docker daemon ports, missing or relative final WORKDIR, missing final command, shell-form CMD or ENTRYPOINT, and a missing healthcheck when the profile requires one.High for mode 777; Medium for sensitive ports, relative workdir, or missing command; Low for the remaining signals.
Build checksDeprecated MAINTAINER, ONBUILD triggers, or a leading directive that disables all Docker build checks.Low, Medium, and Medium respectively.

Formula Core

The risk score is the sum of the enabled finding weights. Duplicate findings with the same identifier and evidence are counted once.

R=i=1nwi
Dockerfile finding weights and risk-band precedence
SeverityWeightBand effect
Critical30Any Critical finding produces Blocked.
High16Any High finding, or total score at least 28, produces Needs hardening when no Critical exists.
Medium7Any Medium finding, or total score at least 10, produces Review when no higher rule applies.
Low3Contributes to Low-signal cleanup or a score-raised band.
Info1Contributes only when an enabled Info rule exists.

Disabling Include low signals removes Low and Info rows before counting and scoring. Visible finding limit only limits the displayed ledger to 5 through 200 rows; it does not change the underlying result.

Profile rules

Dockerfile policy profile requirements
ProfileHealthcheck expectedDigest expected
Runtime serviceYesNo
CI builder imageNoNo
Strict release gateYesYes

Force digest-pin checks requires a digest regardless of profile. A finding is evidence that a text pattern matched the bounded rules; context can justify an exception, but the exception should be reviewed and recorded outside the score.

Limitations and Privacy Notes:

Dockerfile text and loaded files are read in the current browser. The review does not build or pull an image, expand variables, inspect a .dockerignore, resolve package versions, scan filesystem layers, verify signatures or provenance, test container privileges, or run the declared command and healthcheck. Treat the results as pre-build triage and avoid pasting live secrets even though the review is local.

References: