All skills
lukemurraynz avatar

/container-supply-chain

@2cc2455

Production implementation guide for new container image supply-chain security: OCI image signing, digest-first builds, GitHub artifact attestations, Cosign keyless signing, optional Notation/ACR signing, Rekor audit lookup, SBOM generation and attestation, vulnerability scanning, waiver governance, SLSA Build track evidence, deployment admission gates, and artifact-leakage prevention. USE FOR: implementing build-sign-attest-scan-verify pipelines, hardening GHCR or ACR container release workflows, verifying image provenance, configuring Kubernetes/AKS deployment gates, preventing Docker/package artifact leakage, and producing auditable supply-chain records.

Use this Skill: https://skilld.dev/gh/lukemurraynz/hve-agent-skills/container-supply-chain

This session only. Nothing lands on disk.

referencesdistribution-artifact-leakage.md

≈2.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Distribution Artifact Leakage

Use this reference when a package, image, release archive, browser bundle, workflow artifact, model bundle, prompt package, git history, or exported support bundle may expose material that should remain server-side or confidential.

Publish Boundary

Treat distributed artifacts as public unless the organization has a stronger approved control around access, retention, and revocation.

Common public or semi-public distribution surfaces:

  • npm, NuGet, PyPI, Maven, RubyGems, Go modules, and similar packages
  • Docker and OCI images
  • Helm charts and deployment bundles
  • browser, mobile, desktop, and Electron bundles
  • CI/CD artifacts, release archives, test reports, screenshots, and support bundles
  • SBOMs, provenance files, vulnerability reports, and debug bundles
  • model, agent, prompt, workflow, or MCP/server tool packages
  • git history available to repository readers, forks, mirrors, or vendors

Obfuscation and minification do not protect secrets, prompts, source code, security policy, routing logic, business logic, or proprietary model/agent configuration.

Universal Block List

Block these from distributed artifacts unless explicitly approved as public:

  • .env*, credentials, keys, certificates, connection strings, tokens, cookies, and local secrets
  • .git, git remotes, reflogs, patch files, and local branch metadata
  • prompts/, internal agent instructions, SKILL.md, .agent.md, tool schemas, routing logic, and orchestration policy
  • source maps, PDBs, debug symbols, traces, heap dumps, and verbose logs
  • tests, fixtures with real data, screenshots, recordings, and support bundles
  • server-only modules inside client packages
  • Terraform plans, generated configuration with secrets, and deployment output containing identifiers or keys
  • package-manager caches that contain private feed URLs, tokens, or credentials
  • AI model weights, embeddings, indexes, or evaluation datasets not approved for release

Package Publish Checks

Before publish:

  1. Prefer an allowlist where the ecosystem supports it.
  2. Run the ecosystem pack or dry-run command.
  3. Inspect the produced file list and, where practical, the archive contents.
  4. Fail publish if confidential, server-side, or unrelated material appears.
  5. Save the inspected file list as PR or release evidence.

Ecosystem notes:

  • npm: prefer the files allowlist in package.json; do not rely on .npmignore alone.
  • .NET/NuGet: set prompts, appsettings, debug symbols, internal content, and test assets to Pack="false" unless intentionally public.
  • Python: use explicit package discovery includes; exclude tests, prompts, scripts, local config, and notebooks with outputs unless intentionally distributed.
  • Java/Maven/Gradle: inspect generated jars/wars and source jars; keep local config and test fixtures out of published artifacts.
  • Go: check module contents and avoid committing generated files that embed local paths or secrets.

Docker and OCI Image Checks

Before push:

  1. Confirm the Dockerfile uses a minimal runtime-only final stage.
  2. Confirm .dockerignore keeps sensitive files out of the build context.
  3. Use BuildKit secrets or the platform equivalent for private feeds and build-time credentials.
  4. Do not pass secrets through Docker build args, especially when provenance is enabled.
  5. Inspect image history and exported filesystem when leakage risk is high.
  6. Confirm the runtime image does not include package-manager caches, source code, tests, or build tooling unless required.

Build context hygiene, .dockerignore placement and depth traps

A build context is a leakage surface and a size surface: .venv/ (with tokens and private feed URLs), .git/, and tool caches ride into the context when ignored incompletely. Two traps are production-verified:

  • Place .dockerignore at the build context root, not the service subdirectory. When the build context points above the service directory (e.g. context: ../.. in a monorepo so a shared src/, pyproject.toml, and lockfile are reachable), the remote build tars up everything under that root, with no root .dockerignore, that includes .venv/ (196 MB+ once real dependencies land), .git/, and cache directories. This silently "works" while the context is small, then fails outright with remote build failed: archive/tar: write too long, a confusing error naming no offending file. Confirm exactly what the Dockerfile's COPY instructions reference before excluding a directory, so nothing needed is silently dropped.
  • Use **/target, not target, to exclude nested build-artifact directories. A bare target entry only excludes a target/ directory at the exact root of the build context; nested directories (e.g. src-tauri/target/ in a workspace) are not matched and are still sent to the remote build. A single Rust release target/ can contain .lib files over 800 MB, tripping archive/tar: write too long on ACR remote builds. The same glob rule applies to node_modules, dist, .next, and similar artifacts, use **/<dirname> for anything that can appear at depth.

Useful checks:

# Check layers and command history for obvious leaks.
docker history --no-trunc myimage:local

# Export filesystem for review in high-risk releases.
container_id=$(docker create myimage:local)
docker export "$container_id" -o image-rootfs.tar
docker rm "$container_id"
tar -tf image-rootfs.tar | sort > image-rootfs-files.txt

# Look for common sensitive paths.
grep -Ei '(^|/)(\.git|\.env|id_rsa|id_ed25519|appsettings\..*\.json|.*\.pdb|.*\.map|SKILL\.md|\.agent\.md)$' image-rootfs-files.txt

Block images that include:

  • .git, .env*, private keys, certificates, local app settings, or user profile directories
  • prompt files, SKILL.md, .agent.md, and internal orchestration instructions
  • source maps, PDBs, tests, or source code not required at runtime
  • package-manager caches with credentials or private feed metadata
  • build tools, compilers, SDKs, and scanners in runtime images unless required by the workload

CI/CD Artifact and Log Checks

  • Validate artifact directories before upload.
  • Keep retention short and justified unless audit policy requires longer retention.
  • Never echo secrets or derived secrets.
  • Mask derived secret values before any command can print them.
  • Treat Terraform plans, deployment output, screenshots, traces, and support bundles as sensitive by default.
  • Run full-repository secret scans before release branches or tags when history exposure matters.
  • Keep vulnerability reports and SBOMs accessible only to intended consumers if they reveal exploitable inventory.

Git History Remediation

If a secret entered git history:

  1. Rotate the credential immediately.
  2. Identify every branch, tag, fork, mirror, artifact, and log that may contain it.
  3. Clean history with an approved tool such as git filter-repo or BFG.
  4. Force-push only after coordination and approval.
  5. Verify with a fresh clone and full-history secret scan.
  6. Record the incident, affected secret, rotation evidence, cleanup command, and verification result.

Do not treat deleting the file from the current tree as remediation.

Prompt and Tool-Definition Protection

Classify prompts and tool definitions before packaging:

  • Public: user-facing text or examples that provide no sensitive operational advantage.
  • Internal: implementation guidance that can be shared with repository contributors but not customers or public packages.
  • Confidential: system prompts, orchestration policy, tool catalogs, routing logic, security posture, business logic, model configuration, and agent runtime configuration.

Confidential prompts and tool definitions must stay server-side. Load them from controlled configuration, Key Vault, App Configuration, Foundry storage, mounted secrets, or an equivalent runtime store.

Do not embed confidential prompts in compiled strings, browser bundles, Docker layers, NuGet resources, npm packages, mobile/desktop bundles, model packages, or workflow artifacts.

Review Evidence

For a publish or release PR, attach or summarize:

  • pack or dry-run file list
  • image history and filesystem inspection result, if an image is published
  • artifact validation result
  • secret scan scope and result
  • SBOM and provenance handling decision
  • explicit prompt/tool classification result when AI components are packaged
  • waiver or exception approvals with owner and expiry

Source: SKILL.md on GitHub

1 alert8d3 checks · Risk CRITICAL
  • Gen Agent Trust Hub8d

    This skill provides production-grade guidance for container supply chain security. It includes an attack surface for indirect prompt injection as it processes external artifacts, and it references a security transparency log that may trigger false positives in generic automated scanners.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

Signed by skilld at 2cc2455. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated last month
Other metadata
compatibility
Assumes new projects. Prefer current Docker Buildx/build-push-action, Cosign v2+, GitHub artifact attestations, Syft, Grype, Trivy, and OCI registries that support signatures/referrers. Verify current tool versions, CLI flags, registry support, and cloud-provider guidance before enforcement.
metadata
{
  "owner": "platform-engineering",
  "lastReviewed": "2026-07-29",
  "last_verified": "2026-07-29"
}

README badge

README badge for lukemurraynz/hve-agent-skills/container-supply-chain