{
  "schema_version": 1,
  "id": "dockerfile-compose-security",
  "track": "coding",
  "name": "Dockerfile and Compose Security",
  "version": "0.2.0",
  "sha256": "e6d6df672b3f5da12772cf62609c4383f2bea60126951d50fb874d8cfecc9060",
  "sha256_v1": "a57701e101c76ecffdcc0b884be790610e595eb94a77a861968aba4132c490b3",
  "keyword": "block",
  "word": "blocks",
  "says": "blocks on an agent's file writes and at turn end",
  "description": "Blocks (some rules ask) when a change to a Dockerfile, Containerfile or compose file adds: a base image with no tag, latest, an unresolvable ARG or no digest (stage-aware: FROM or COPY --from a stage is not an image); a final stage running as root; TLS or package-signature checks off; secret-named ENV/ARG/environment literals; COPY of key or .env files; remote ADD without checksum; fetch piped to a shell; RUN --security=insecure; chmod 777 or setuid; sudo, sshd, chpasswd; unpinned git clone; ONBUILD RUN; compose privileged, broad cap_add, unconfined profiles, devices, host namespaces, runtime socket or host-root mounts, database ports on every interface, untagged images. A one-line form is left to block-fetch-exec-in-files, block-unpinned-agent-components or agentic-code-security only where that gate is installed and reads the file; scan-secrets lines always. Misses: build args overriding defaults, commands in variables, aliases or $'' quoting, bake and k8s files. Friction, not a boundary.",
  "misses": "build args overriding defaults, commands in variables, aliases or $'' quoting, bake and k8s files.",
  "where": [
    "write",
    "turn-end"
  ],
  "groups": [
    "cloud-iac"
  ],
  "eval_cases": 37,
  "eval_executed": 37,
  "latest": {
    "version": "0.2.0",
    "date": "2026-10-25",
    "change": "Hardening (SR-2d2d; findings F24, F26, F33; eval cases tc-035 to tc-037; tests in test_dockerfile_compose_sr2d2.py). Behaviour change: a sibling gate (block-fetch-exec-in-files, block-unpinned-agent-components, agentic-code-security) counts as installed only when a readable regular `gate.json` (not a symlink, at most 1 MiB) under its compiled folder, directly or one folder down, has `action: block`; a bare folder, such as one a plain `mkdir` leaves, an unreadable file or a gate that only warns no longer hides this bundle's deny findings. Behaviour change: the fetch-exec and remote-ADD deferral applies the installed sibling's own `content_pattern` from its compiled gate to the physical line, and defers nothing when the pattern is missing or does not compile; the HP03 regex copies are gone, so forms the sibling's pattern reads (a quoted `'curl'`, a pipe into `python3 -`) are now left to it and a line it does not read (a space-preceded `#` in quotes before the fetch) is reported here. Behaviour change: a secret-named literal is left to scan-secrets only when scan-secrets' pattern matches a span of one raw physical line that holds the literal, not a `name: value` string rebuilt from the parsed value, so an alias, anchor, tag, block or wrapped scalar, or a Dockerfile value split by a continuation, is reported here. Known limits: the copied scan-secrets pattern is still the 0.0.9 one (it reads fewer quoted-colon forms than the shipped 0.1.2, which only means a double report); the pins and node-tls deferrals still use this bundle's own line patterns, gated by the same block-action check. protect-agent-config's `mkdir` of compiled folders is not changed here."
  },
  "agent_labels": {
    "claude-code": {
      "keyword": "block",
      "says": "blocks on an agent's file writes and at turn end"
    },
    "cursor": {
      "keyword": "block",
      "says": "blocks on an agent's file writes and at turn end. Where its description says it asks, it refuses at both points, because this client cannot prompt at either point"
    },
    "codex": {
      "keyword": "block",
      "says": "blocks on an agent's file writes and at turn end. Where its description says it asks, it refuses at both points, because this client cannot prompt at either point. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)"
    },
    "copilot": {
      "keyword": "block",
      "says": "blocks at turn end only. It does not check a file write when it happens. Where its description says it asks, it refuses at turn end, because this client cannot prompt there. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)"
    },
    "devin": {
      "keyword": "block",
      "says": "blocks at turn end only. It does not check a file write when it happens. Where its description says it asks, it refuses at turn end, because this client cannot prompt there. If the hook errors, the action goes through (vendor docs only, not witnessed)"
    },
    "grok": {
      "keyword": "ungraded",
      "says": "Not graded yet for Grok"
    },
    "goose": {
      "keyword": "ungraded",
      "says": "Not graded yet for goose"
    },
    "antigravity": {
      "keyword": "ungraded",
      "says": "Not graded yet for Antigravity"
    },
    "openhands": {
      "keyword": "ungraded",
      "says": "Not graded yet for OpenHands"
    },
    "kimi-code": {
      "keyword": "ungraded",
      "says": "Not graded yet for Kimi Code"
    },
    "factory-droid": {
      "keyword": "ungraded",
      "says": "Not graded yet for Factory Droid"
    }
  },
  "source_url": "https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/dockerfile-compose-security",
  "enforces": "enforced-at-commit",
  "examples": [
    {
      "word": "Refused",
      "prompt": "A commit adds a Dockerfile whose only stage is built FROM an untagged image.",
      "command": null
    },
    {
      "word": "Allowed",
      "prompt": "A commit adds a Dockerfile pinned by digest, built FROM an earlier stage, running as a non-root user.",
      "command": null
    }
  ]
}
