ITADN
adversarylabs/dockerfile-adversary
adversarylabs/dockerfile-adversary · 文件
文件最后提交记录最后更新时间
README.md

container/dockerfile

container/dockerfile reviews Dockerfile-style files for container build and runtime security: unpinned bases, secrets in build args/env, broad build context copies, root runtime users, and dangerous shell patterns.

It is a Dockerfile domain reviewer, not a general image scanner (no registry pulls, no CVE DB of base layers). When it reports, the build can leak secrets or produce an unsafe runtime image.

What it does

  1. Discovers Dockerfile and *.dockerfile candidates (and related ignore files).
  2. Runs deterministic detectors with stable rule ids.
  3. Synthesizes a review through the SDK.
  4. Optionally enhances with a model when provided.

It never executes the scanned project as the product under review, never installs dependencies into it, and never needs network access to the target repository.

What it detects

Every shipped rule id, severity, and short description lives in CHECKS.md — the audit surface for “what does this adversary look for?”

Highlights:

AreaExamples
Base imagesFROM without digest pin
SecretsARG/ENV holding secret material; secrets removed only in later layers
ContextBroad COPY/ADD of .; missing .dockerignore pairing
RuntimeUSER root in final stage
Shellcurl

Ownership boundaries

Other official adversaries own adjacent classes so findings stay non-duplicative:

ConcernOwned by
Committed secrets outside Dockerfilessecurity/secrets
CI workflow supply chainci/github-actions
Go module graph integritygo/modules

Precision stance

  • High confidence only for deterministic, evidence-backed patterns.
  • Clean fixtures must stay quiet; vulnerable fixtures must fire where graded fixtures exist.
  • Prefer missing a weak signal over a false positive on normal production code.