greglas75/zuvo/container-audit

Claude Code and agent skill by greglas75/zuvo

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Static Docker/container security audit across 6 dimensions (K1-K6): base image provenance and pinning, privilege and runtime hardening, secret and build-context hygiene, image minimalism and attack surface, known-vulnerability scan (Trivy/Grype), and compose/orchestration hardening. Static-first — parses Dockerfile, Containerfile, and docker-compose (incl. override/merge files) with zero Docker and zero network; the CVE dimension (K5) runs Trivy/Grype only when present, else degrades to N/A. Reserved dimensions K7-K10 (Kubernetes) activate behind --k8s. HEALTHY/NEEDS ATTENTION/AT RISK/CRITICAL grade with critical gates. Distinct from infra-audit (live host daemon over SSH) and ci-audit (Docker build speed in the pipeline). Switches: zuvo:container-audit full | [path] | --static | --scan | --dockerfile <p> | --compose <p> | --quick | --k8s | --persist-backlog

Install

npx vskill@latest install greglas75/zuvo/container-audit

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as greglas75/zuvo/container-audit.

zuvo:container-audit

Audit container artifacts (Dockerfile, Containerfile, docker-compose) as code for security defects — running as root, mutable :latest bases, secrets baked into layers, bloated attack surface, known CVEs, and docker.sock mounts. Single-pass, read-only.

When to use: before shipping a Dockerized service, after editing a Dockerfile or compose file, periodic container hardening review, pre-deploy gate. When NOT to use: auditing the live Docker daemon on a remote host over SSH (zuvo:infra-audit IS9); Docker build speed / cache in CI (zuvo:ci-audit CI8); application-code vulnerabilities (zuvo:security-audit).

Mandatory File Loading

Read every file below before starting. Print the checklist.

CORE FILES LOADED:
1. ../../shared/includes/codesift-setup.md -- [READ | MISSING -> STOP]
2. ../../shared/includes/env-compat.md -- [READ | MISSING -> STOP]
3. ../../shared/includes/report-output-location.md -- [READ | MISSING -> STOP]
4. ../../shared/includes/severity-vocabulary.md -- [READ | MISSING -> STOP]
5. ../../shared/includes/run-logger.md -- [READ | MISSING -> STOP]
6. ../../shared/includes/retrospective.md -- [READ | MISSING -> STOP]
7. ../../shared/includes/backlog-protocol.md -- [READ | MISSING -> STOP] (Filing findings through backlog-add)

If any file is MISSING, STOP. Do not proceed from memory.


Argument Parsing

TokenBehavior
_(empty)_ or fullAll applicable dimensions, scope = project root
[path]Scope to a directory (monorepo package / service)
--staticForce pure-static: skip live Trivy/Grype even if present (K5 via trivy config or N/A)
--scanForce live CVE scan; missing scanner OR declined image pull → exit non-zero (scan aborted), never a silent downgrade
--dockerfile <path>Audit a single Dockerfile
--compose <path>Audit a single compose file
--quickCritical gates only (K1 + K2 + K3)
--k8sActivate reserved dimensions K7-K10 (Kubernetes manifest/RBAC/Pod-Security/network-policy)
--persist-backlogRecord CRITICAL/HIGH findings via backlog-add

Safety Gates

GATE 1 -- Read-Only

The only write targets are zuvo/audits/ and, through backlog-add, memory/backlog.md and memory/findings/. FORBIDDEN: modifying any Dockerfile, compose, or source file; building, running, tagging, or pushing images.

GATE 2 -- Secret Censorship

Any secret value — from ANY source (an ENV/ARG/.env, a hardcoded literal in a RUN command, a compose environment: entry, a scanned config) — is replaced with *** before it reaches the report. Variable NAMES may show; VALUES never. .env.example placeholders may show as-is.

GATE 3 -- Consent Before Any Image PULL

trivy config and the native Dockerfile/compose parse run freely (no pull). Before any trivy image <ref> / grype <ref> that must PULL an image, prompt: Pull image <ref> to scan for CVEs? This performs network egress to <registry>. [y/N] — default DENY. In a non-interactive / CI context (no TTY, no way to answer) do NOT prompt — treat it as an automatic DENY. Decline (or non-interactive) → default mode: K5 falls back to trivy config/native with an annotation; --scan mode: exit non-zero. The prompt (or the non-interactive auto-deny) and the outcome are logged.

GATE 4 -- No Daemon / Socket Interaction

The audit never connects to /var/run/docker.sock or a remote daemon (that is zuvo:infra-audit). Detecting a docker.sock mount in a compose file (K6) is static text analysis, not a socket connection.


MANDATORY TOOL CALLS — Container Audit Validity Gate

INVALID if any tool below is skipped. "DEFERRED", "N/A", --quick are NOT valid reasons.

ToolTriggerSkip allowed?
get_file_treeAlwaysNO — discover Dockerfile/compose/.dockerignore
search_textAlwaysNO — FROM/USER/COPY/ARG/ENV/mount scan
search_patternsAlwaysNO — K2/K3/K6 anti-patterns
scan_secretsAlwaysNO — K3 baked-secret detection
audit_scanAlwaysNO — compound check

The gate checks the CHECK was PERFORMED, not that a specific CodeSift tool was literally invoked. When CodeSift is genuinely unavailable, the equivalent Glob/Read/grep fallback SATISFIES the gate (record scan_secrets: grep-fallback(<N> hits), codesift: unavailable). What is REJECTED is a check silently NOT DONE: scan_secrets: skipped, codesift: unavailable used as an excuse to run NO secret scan at all, or retrospective: skipped.

VERDICT vs logging: the audit VERDICT (PASS/WARN/FAIL/INCOMPLETE) is independent of the postamble log-append. "append-runlog exit 0" below means the log wrapper returned 0 (append succeeded) — a FAIL audit still appends its run line and returns 0 from the wrapper; the VERDICT is FAIL, not the exit code. A --scan abort (GATE 3) exits BEFORE the postamble and does not write a run line.

POSTAMBLE (on a completed audit): report on disk → retro appended → ~/.zuvo/append-runlog returns 0. Every finding needs path/to/file:LINE (verify-audit gate).

Mandatory-tools-acknowledgment: I will run get_file_tree + search_text + search_patterns + scan_secrets + audit_scan (or their grep/Glob fallback if CodeSift is unavailable) for this container audit. Every finding will cite a `path/to/file:LINE` resolving in the current tree.

Degraded mode (CodeSift unavailable): fall back to Glob/Read/grep for artifact discovery and pattern scans; note codesift=unavailable in telemetry and proceed — the fallback satisfies the mandatory-tools gate (above), do NOT block.


Phase 0: Detect and Scope

0.1 Target Resolution

Set TARGET_ROOT from arguments. All subsequent scans use this path.

0.2 Artifact Discovery

Enumerate container artifacts (use get_file_tree; cross-check with git ls-files):

PatternKind
Dockerfile*, *.dockerfile, Containerfileimage build
docker-compose*.y{a,}ml, compose*.y{a,}mlcompose
docker-compose.override.y{a,}ml, compose.override.y{a,}mlcompose override (merged into effective config)
.dockerignorebuild-context filter
*.yaml/*.yml under k8s/, kubernetes/, manifests/Kubernetes (K7-K10, only when --k8s)

If NO container artifacts are found → report "no container artifacts" and exit HEALTHY (N/A — nothing to audit). This is not a failure. Note: get_file_tree HAS run at this point (that is how "none found" was determined, satisfying the mandatory-tools gate for it); the remaining artifact-scanning tools (search_text/search_patterns/scan_secrets over Dockerfiles) are vacuously N/A because there is nothing to scan — record them as N/A(no-artifacts), not skipped.

0.3 Scanner and Socket Detection
  • command -v trivy / command -v grype → K5 mode (live vs N/A).
  • Note Docker socket presence only to decide whether an image pull is even possible; never connect.

Print:

CONTAINER ARTIFACT INVENTORY
------------------------------------
Target: [TARGET_ROOT]
Dockerfiles: [N]
Compose files: [N] (+ [N] override)
.dockerignore: [present/absent]
K8s manifests: [N] (audited only with --k8s)
CVE scanner: [trivy | grype | none -> K5 N/A]
------------------------------------

Phase 1: Dimension Analysis (K1-K6, + reserved K7-K10)

Single-pass inline execution. No sub-agents.

Multi-stage scope rule: runtime dimensions (K2, K4, K6) are judged on the FINAL stage only — root/tools in a builder stage is fine. K1 (pinning) and K5 (CVE) apply to every EXTERNAL base ref in ALL stages (a FROM node:latest AS builder is still pulled → supply-chain risk). INTERNAL stage refs (FROM builder, where builder is a prior stage in the same file) are exempt.

K1: Base Image Provenance & Pinning -- Weight 15, Critical Gate
CheckGoodBadSeverity
Base fully pinned@sha256:… digest (immutable):latest, :stable, or no tagCRITICAL
Version tag (no digest)node:20.11.1 — acceptable but MUTABLE (a tag can be re-pushed)—MEDIUM (recommend adding @sha256:)
Trusted registryOfficial / org registryUnknown/anonymous registryHIGH
Every stage's external baseAll pinnedA builder stage on :latestHIGH
Var-interpolated FROM $REG/imgResolvable + pinnedUnresolvable build-arg baseHIGH (flag, do not silent-pass)

Only a @sha256: digest is truly immutable; a specific version tag is pinned-enough to clear the critical gate but is flagged MEDIUM (recommend a digest). Critical gate: any final-image external base on :latest/:stable/no-tag → FAIL. The gate fires on that FINDING; a K1 score of 0 also fires it but is not required. rule_ids: K1-latest-tag, K1-no-tag, K1-mutable-version-tag, K1-untrusted-registry, K1-unpinned-builder.

K2: Privilege & Runtime Hardening -- Weight 18, Critical Gate
CheckGoodBadSeverity
Non-root userUSER <non-root> in final stage (or distroless :nonroot)No USER → runs as rootCRITICAL
Compose user: overrideabsent, or a non-root uidcompose user: root/user: "0" overriding the image's non-root USER back to rootCRITICAL
Privileged (compose)privileged: false / absentprivileged: trueCRITICAL
Capabilities (compose)cap_drop: [ALL] + minimal cap_addNo cap_drop / cap_add: [ALL]HIGH
no-new-privileges (compose)security_opt: [no-new-privileges:true]absentMEDIUM
Read-only rootfs (compose)read_only: true where feasiblewritable rootfs unnecessarilyMEDIUM

Distroless :nonroot variants satisfy the non-root check even without a USER line — do NOT false-flag them. Critical gate: the image runs as root AND/OR privileged: true → FAIL. The gate fires on that FINDING; a K2 score of 0 also fires it but is not required. rule_ids: K2-root-user, K2-privileged, K2-no-cap-drop, K2-no-new-privileges.

K3: Secret & Build-Context Hygiene -- Weight 18, Critical Gate
CheckGoodBadSeverity
No secret in ENV/ARGConfig-only ENV/ARGENV API_KEY=… / ARG SECRET=… baked to a layerCRITICAL
Build secretsRUN --mount=type=secretsecret passed via ARG (persisted in history)CRITICAL
.dockerignore presentexcludes .env, .git, keysabsent with a blind COPY . .CRITICAL
No hardcoded credssecrets via runtime env / managerliteral password/token in DockerfileCRITICAL

K3 only flags ENV/ARG whose NAME matches secret patterns (*KEY*, *SECRET*, *TOKEN*, *PASSWORD*, *CRED*), never benign build config (VERSION, NODE_ENV). Critical gate: any secret baked into the image, OR a blind COPY . . with no .dockerignore → FAIL. The gate fires on that FINDING; a K3 score of 0 also fires it but is not required. rule_ids: K3-secret-in-env, K3-secret-in-arg, K3-no-dockerignore, K3-hardcoded-cred.

K4: Image Minimalism & Attack Surface -- Weight 12
CheckGoodBadSeverity
Multi-stagebuilder + slim runtimesingle fat stage shipping build toolsHIGH
Minimal basedistroless / -slim / alpinefull ubuntu/node (non-slim) for runtimeMEDIUM
Package-manager cache--no-cache / rm -rf /var/lib/apt/listsapt/apk cache left in a layerMEDIUM
No dev/debug tools in finalprod image has no curl/nc/shell (distroless)debug tooling shipped to prodMEDIUM

rule_ids: K4-no-multistage, K4-fat-base, K4-pkg-cache, K4-debug-tools.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
8
7-day trend score
11

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/greglas75/zuvo/container-audit/badge)](https://verified-skill.com/skills/greglas75/zuvo/container-audit)

Something wrong with this skill or its page? Tell us.