Supply Chain Audit Skill
Auditing software supply chain security across CI/CD pipelines, container images, and
language package ecosystems. Produces structured findings with severity ratings,
file:line references, and actionable fix templates.
When to Use This Skill
- CI/CD security review: Unpin action refs, excessive permissions, secret leakage
- Dependency pinning: Lock files missing, hash verification absent, mutable semver refs
- Container supply chain: Mutable base image tags, non-root execution, SBOM generation
- Credential hygiene: OIDC migration from long-lived secrets, subject constraint gaps
- Compliance mapping: SLSA L1-L4 readiness assessment, SBOM generation guidance
- Pre-merge gate: Block PRs that introduce High/Critical supply chain regressions
Prerequisites — External Tool Check
Before running the audit, check for missing external tools and offer to install them:
# Build once (from the amplihack-rs workspace root):
cargo build -p amplihack-supply-chain-audit --bin amplihack-supply-chain-audit
# List any missing external tools and their install options:
amplihack-supply-chain-audit --check-tools
--check-tools prints each missing tool, what it is used for, and the
platform-specific install commands. The audit itself is invoked the same way,
pointing the binary at the repository root:
# Full markdown report (default), scoped to the detected ecosystems:
amplihack-supply-chain-audit /path/to/repo --scope all
# Machine-readable output for tooling:
amplihack-supply-chain-audit /path/to/repo --scope all --json
The audit runs without these tools (offline/degraded mode) but produces fewer findings:
| Tool |
What's lost without it |
gh |
Cannot resolve action tags to SHAs via GitHub API |
crane |
Cannot resolve container image digests |
syft |
Cannot generate SBOMs (SPDX/CycloneDX) |
grype |
Cannot scan for known CVEs |
cosign |
Cannot verify image signatures or attestations |
Ecosystem Detection
Detect which dimensions apply before running checks:
| Signal |
Ecosystem |
Dimensions Triggered |
.github/workflows/*.yml |
GitHub Actions |
1, 2, 3, 4 |
Dockerfile / docker-compose.yml |
Containers |
5, 12 |
.github/workflows/ with secrets.* |
Credentials |
6 |
*.csproj / NuGet.Config |
.NET / NuGet |
7 |
requirements*.txt / pyproject.toml / setup.cfg |
Python |
8 |
Cargo.toml / Cargo.lock |
Rust |
9 |
package.json / package-lock.json / yarn.lock |
Node.js |
10 |
go.mod / go.sum |
Go |
11 |
Run all triggered dimensions. Report skipped dimensions explicitly.
12 Audit Dimensions
Dimensions 1-4: GitHub Actions
See reference/actions.md
| # |
Name |
What to Check |
| 1 |
Action SHA pinning |
uses: refs must be @<40-char-SHA> # vX.Y.Z |
| 2 |
Workflow permissions |
Top-level permissions: read-all; job-level minimal grants |
| 3 |
Secret exposure |
No secrets in run: echo/env; ACTIONS_STEP_DEBUG guard |
| 4 |
Cache poisoning |
actions/cache key collision; restore-keys breadth |
Dimensions 5 & 12: Containers
See reference/containers.md
| # |
Name |
What to Check |
| 5 |
Base image pinning |
FROM image@sha256:<digest> not :latest or semver tag |
| 12 |
Docker build chain |
Multi-stage scratch/distroless final stage; non-root USER |
Dimension 6: Credentials
See reference/credentials.md
| # |
Name |
What to Check |
| 6 |
OIDC vs long-lived secrets |
Prefer id-token: write OIDC; verify subject constraints |
Dimension 7: .NET / NuGet
See reference/dotnet.md
| # |
Name |
What to Check |
| 7 |
NuGet lock & audit |
RestoreLockedMode, authorized sources, NuGetAudit severity gate |
Dimension 8: Python
See reference/python.md
| # |
Name |
What to Check |
| 8 |
Python dependency integrity |
--require-hashes, --extra-index-url risks, typosquatting signals |
Dimension 9: Rust
See reference/rust.md
| # |
Name |
What to Check |
| 9 |
Cargo supply chain |
Cargo.lock committed, build.rs risk, [patch]/[replace] scope |
Dimension 10: Node.js
See reference/node.md
| # |
Name |
What to Check |
| 10 |
Node.js integrity |
npm ci not npm install, npx resolution, postinstall scripts |
Dimension 11: Go
See reference/go.md
| # |
Name |
What to Check |
| 11 |
Go module integrity |
go.sum present and committed, GONOSUMCHECK, replace directive scope |
5-Step Audit Workflow
Step 1: Scope Detection
# Detect active ecosystems
ls .github/workflows/*.yml 2>/dev/null && echo "GHA detected"
ls Dockerfile docker-compose.yml 2>/dev/null && echo "Containers detected"
ls requirements*.txt pyproject.toml 2>/dev/null && echo "Python detected"
ls package.json 2>/dev/null && echo "Node detected"
ls go.mod 2>/dev/null && echo "Go detected"
ls Cargo.toml 2>/dev/null && echo "Rust detected"
ls *.csproj 2>/dev/null && echo ".NET detected"
Record active dimensions. Skip and annotate inactive ones in the report.
Step 2: Static Analysis (per ecosystem)
Run dimension-specific checks from each reference file. Collect raw findings with:
- Dimension number
- File path and line number (
file:line)
- Current value (the offending pattern)
- Expected value (the fix)
- Severity: Critical / High / Medium / Info
Step 3: Severity Scoring
Map findings to CVSS-aligned severity bands:
| Severity |
CVSS Range |
Examples |
| Critical |
9.0-10.0 |
Unpin third-party action with write permissions + secret access |
| High |
7.0-8.9 |
Mutable action ref; :latest container; long-lived secret with broad scope |
| Medium |
4.0-6.9 |
Missing permissions: read-all; missing Cargo.lock commit |
| Info |
0.1-3.9 |
Semver action ref for first-party org action; advisory-only NuGet finding |
Step 4: Report Generation
Produce a structured markdown report:
## Supply Chain Audit Report
**Date**: YYYY-MM-DD
**Scope**: [list active ecosystems]
**Skipped**: [list inactive ecosystems with reason]
### Summary
| Severity | Count |
| -------- | ----- |
| Critical | N |
| High | N |
| Medium | N |
| Info | N |
### Findings
#### CRITICAL-001 · Dim 1 · Unpin third-party action
- **File**: `.github/workflows/release.yml:14`
- **Current**: `uses: actions/checkout@v4`
- **Expected**: `uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2`
- **Fix**: Look up SHA at https://github.com/actions/checkout/releases
### SLSA Readiness
[See reference/sbom-slsa.md for compliance table]
### Recommended Next Steps
1. Fix all Critical findings before next deployment
2. Delegate lock-file issues to `dependency-resolver` skill
3. Install SHA-pinning pre-commit hooks via `pre-commit-manager` skill
Step 5: Remediation Prioritization
Order fixes:
- Critical first: Unpin + write-permissions + secret-access combinations
- High: Any mutable reference in production workflows
- Delegate: Lock file generation to
dependency-resolver
- Automate: Pre-commit enforcement via
pre-commit-manager
- Compliance: SBOM generation, SLSA provenance — see reference/sbom-slsa.md
Output Format Conventions
- Every finding includes
file:line (e.g., .github/workflows/ci.yml:23)
- Fix templates are copy-pasteable with no placeholders requiring guessing
- SHA lookups always reference the official release page URL
- Severity is explicit per finding; never implicit
- Report ends with a "next steps" section distinguishing manual vs. automatable fixes
Integration Points
| Skill |
When to Delegate |
dependency-resolver |
Lock file conflicts, outdated transitive deps, version incompatibilities |
pre-commit-manager |
Install SHA-pinning hooks, npm ci enforcement, go mod verify hooks |
cybersecurity-analyst |
Runtime threat modeling, network exposure analysis, post-incident review |
silent-degradation-audit |
CI reliability issues, flaky tests masking security regressions |
Evaluation Scenarios
See reference/eval-scenarios.md for three graded scenarios:
- Scenario A: GitHub Actions monorepo — GHA + Python + Node (7 planted findings)
- Scenario B: Containerized Go service — Containers + Go + Credentials (5 findings)
- Scenario C: .NET + Rust mixed repo — .NET + Rust + SLSA readiness (6 findings)
Additional Reference
- SBOM generation, CVSS scoring, SLSA L1-L4 mapping, fix-PR workflow
- Invocation interface, finding schema, inter-skill contracts, error handling
- GitHub Actions SHA lookup:
gh api repos/{owner}/{repo}/git/ref/tags/{tag}
- SLSA framework: https://slsa.dev
- OpenSSF Scorecard: https://securityscorecards.dev
Related Skills
dependency-resolver — lock file conflict resolution
pre-commit-manager — automated quality enforcement hooks
cybersecurity-analyst — runtime security and threat modeling
silent-degradation-audit — CI reliability and regression detection
pr-review-assistant — philosophy-aware PR review including supply chain checks
1---2name: supply-chain-audit-23description: Auditing software supply chain security across CI/CD pipelines, container images, and language ecosystems. Detects mutable dependency references, insecure CI patterns, credential exposure risks, and missing SBOM/SLSA controls. Use when performing a supply chain audit, checking action pinning, auditing dependencies, scanning for CI security issues, reviewing container security, or assessing dependency security. Covers GitHub Actions, containers, Python, Node, Go, Rust, .NET, and more.4---56# Supply Chain Audit Skill78Auditing software supply chain security across CI/CD pipelines, container images, and9language package ecosystems. Produces structured findings with severity ratings,10`file:line` references, and actionable fix templates.1112## When to Use This Skill1314- **CI/CD security review**: Unpin action refs, excessive permissions, secret leakage15- **Dependency pinning**: Lock files missing, hash verification absent, mutable semver refs16- **Container supply chain**: Mutable base image tags, non-root execution, SBOM generation17- **Credential hygiene**: OIDC migration from long-lived secrets, subject constraint gaps18- **Compliance mapping**: SLSA L1-L4 readiness assessment, SBOM generation guidance19- **Pre-merge gate**: Block PRs that introduce High/Critical supply chain regressions2021---2223## Prerequisites — External Tool Check2425**Before running the audit**, check for missing external tools and offer to install them:2627```bash28# Build once (from the amplihack-rs workspace root):29cargo build -p amplihack-supply-chain-audit --bin amplihack-supply-chain-audit3031# List any missing external tools and their install options:32amplihack-supply-chain-audit --check-tools33```3435`--check-tools` prints each missing tool, what it is used for, and the36platform-specific install commands. The audit itself is invoked the same way,37pointing the binary at the repository root:3839```bash40# Full markdown report (default), scoped to the detected ecosystems:41amplihack-supply-chain-audit /path/to/repo --scope all4243# Machine-readable output for tooling:44amplihack-supply-chain-audit /path/to/repo --scope all --json45```4647The audit runs without these tools (offline/degraded mode) but produces fewer findings:4849| Tool | What's lost without it |50| -------- | ------------------------------------------------- |51| `gh` | Cannot resolve action tags to SHAs via GitHub API |52| `crane` | Cannot resolve container image digests |53| `syft` | Cannot generate SBOMs (SPDX/CycloneDX) |54| `grype` | Cannot scan for known CVEs |55| `cosign` | Cannot verify image signatures or attestations |5657---5859## Ecosystem Detection6061Detect which dimensions apply before running checks:6263| Signal | Ecosystem | Dimensions Triggered |64| ---------------------------------------------------- | -------------- | -------------------- |65| `.github/workflows/*.yml` | GitHub Actions | 1, 2, 3, 4 |66| `Dockerfile` / `docker-compose.yml` | Containers | 5, 12 |67| `.github/workflows/` with `secrets.*` | Credentials | 6 |68| `*.csproj` / `NuGet.Config` | .NET / NuGet | 7 |69| `requirements*.txt` / `pyproject.toml` / `setup.cfg` | Python | 8 |70| `Cargo.toml` / `Cargo.lock` | Rust | 9 |71| `package.json` / `package-lock.json` / `yarn.lock` | Node.js | 10 |72| `go.mod` / `go.sum` | Go | 11 |7374Run all triggered dimensions. Report skipped dimensions explicitly.7576---7778## 12 Audit Dimensions7980### Dimensions 1-4: GitHub Actions8182See [reference/actions.md](reference/actions.md)8384| # | Name | What to Check |85| --- | -------------------- | ----------------------------------------------------------- |86| 1 | Action SHA pinning | `uses:` refs must be `@<40-char-SHA> # vX.Y.Z` |87| 2 | Workflow permissions | Top-level `permissions: read-all`; job-level minimal grants |88| 3 | Secret exposure | No secrets in `run:` echo/env; `ACTIONS_STEP_DEBUG` guard |89| 4 | Cache poisoning | `actions/cache` key collision; restore-keys breadth |9091### Dimensions 5 & 12: Containers9293See [reference/containers.md](reference/containers.md)9495| # | Name | What to Check |96| --- | ------------------ | --------------------------------------------------------- |97| 5 | Base image pinning | `FROM image@sha256:<digest>` not `:latest` or semver tag |98| 12 | Docker build chain | Multi-stage scratch/distroless final stage; non-root USER |99100### Dimension 6: Credentials101102See [reference/credentials.md](reference/credentials.md)103104| # | Name | What to Check |105| --- | -------------------------- | --------------------------------------------------------- |106| 6 | OIDC vs long-lived secrets | Prefer `id-token: write` OIDC; verify subject constraints |107108### Dimension 7: .NET / NuGet109110See [reference/dotnet.md](reference/dotnet.md)111112| # | Name | What to Check |113| --- | ------------------ | ------------------------------------------------------------------- |114| 7 | NuGet lock & audit | `RestoreLockedMode`, authorized sources, `NuGetAudit` severity gate |115116### Dimension 8: Python117118See [reference/python.md](reference/python.md)119120| # | Name | What to Check |121| --- | --------------------------- | -------------------------------------------------------------------- |122| 8 | Python dependency integrity | `--require-hashes`, `--extra-index-url` risks, typosquatting signals |123124### Dimension 9: Rust125126See [reference/rust.md](reference/rust.md)127128| # | Name | What to Check |129| --- | ------------------ | -------------------------------------------------------------------- |130| 9 | Cargo supply chain | `Cargo.lock` committed, `build.rs` risk, `[patch]`/`[replace]` scope |131132### Dimension 10: Node.js133134See [reference/node.md](reference/node.md)135136| # | Name | What to Check |137| --- | ----------------- | ------------------------------------------------------------------- |138| 10 | Node.js integrity | `npm ci` not `npm install`, `npx` resolution, `postinstall` scripts |139140### Dimension 11: Go141142See [reference/go.md](reference/go.md)143144| # | Name | What to Check |145| --- | ------------------- | ------------------------------------------------------------------------- |146| 11 | Go module integrity | `go.sum` present and committed, `GONOSUMCHECK`, `replace` directive scope |147148---149150## 5-Step Audit Workflow151152### Step 1: Scope Detection153154```bash155# Detect active ecosystems156ls .github/workflows/*.yml 2>/dev/null && echo "GHA detected"157ls Dockerfile docker-compose.yml 2>/dev/null && echo "Containers detected"158ls requirements*.txt pyproject.toml 2>/dev/null && echo "Python detected"159ls package.json 2>/dev/null && echo "Node detected"160ls go.mod 2>/dev/null && echo "Go detected"161ls Cargo.toml 2>/dev/null && echo "Rust detected"162ls *.csproj 2>/dev/null && echo ".NET detected"163```164165Record active dimensions. Skip and annotate inactive ones in the report.166167### Step 2: Static Analysis (per ecosystem)168169Run dimension-specific checks from each reference file. Collect raw findings with:170171- **Dimension number**172- **File path and line number** (`file:line`)173- **Current value** (the offending pattern)174- **Expected value** (the fix)175- **Severity**: Critical / High / Medium / Info176177### Step 3: Severity Scoring178179Map findings to CVSS-aligned severity bands:180181| Severity | CVSS Range | Examples |182| ------------ | ---------- | --------------------------------------------------------------------------- |183| **Critical** | 9.0-10.0 | Unpin third-party action with write permissions + secret access |184| **High** | 7.0-8.9 | Mutable action ref; `:latest` container; long-lived secret with broad scope |185| **Medium** | 4.0-6.9 | Missing `permissions: read-all`; missing `Cargo.lock` commit |186| **Info** | 0.1-3.9 | Semver action ref for first-party org action; advisory-only NuGet finding |187188### Step 4: Report Generation189190Produce a structured markdown report:191192```markdown193## Supply Chain Audit Report194195**Date**: YYYY-MM-DD196**Scope**: [list active ecosystems]197**Skipped**: [list inactive ecosystems with reason]198199### Summary200201| Severity | Count |202| -------- | ----- |203| Critical | N |204| High | N |205| Medium | N |206| Info | N |207208### Findings209210#### CRITICAL-001 · Dim 1 · Unpin third-party action211212- **File**: `.github/workflows/release.yml:14`213- **Current**: `uses: actions/checkout@v4`214- **Expected**: `uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2`215- **Fix**: Look up SHA at https://github.com/actions/checkout/releases216217### SLSA Readiness218219[See reference/sbom-slsa.md for compliance table]220221### Recommended Next Steps2222231. Fix all Critical findings before next deployment2242. Delegate lock-file issues to `dependency-resolver` skill2253. Install SHA-pinning pre-commit hooks via `pre-commit-manager` skill226```227228### Step 5: Remediation Prioritization229230Order fixes:2312321. **Critical first**: Unpin + write-permissions + secret-access combinations2332. **High**: Any mutable reference in production workflows2343. **Delegate**: Lock file generation to `dependency-resolver`2354. **Automate**: Pre-commit enforcement via `pre-commit-manager`2365. **Compliance**: SBOM generation, SLSA provenance — see [reference/sbom-slsa.md](reference/sbom-slsa.md)237238---239240## Output Format Conventions241242- Every finding includes `file:line` (e.g., `.github/workflows/ci.yml:23`)243- Fix templates are copy-pasteable with no placeholders requiring guessing244- SHA lookups always reference the official release page URL245- Severity is explicit per finding; never implicit246- Report ends with a "next steps" section distinguishing manual vs. automatable fixes247248---249250## Integration Points251252| Skill | When to Delegate |253| -------------------------- | ------------------------------------------------------------------------ |254| `dependency-resolver` | Lock file conflicts, outdated transitive deps, version incompatibilities |255| `pre-commit-manager` | Install SHA-pinning hooks, `npm ci` enforcement, `go mod verify` hooks |256| `cybersecurity-analyst` | Runtime threat modeling, network exposure analysis, post-incident review |257| `silent-degradation-audit` | CI reliability issues, flaky tests masking security regressions |258259---260261## Evaluation Scenarios262263See [reference/eval-scenarios.md](reference/eval-scenarios.md) for three graded scenarios:264265- **Scenario A**: GitHub Actions monorepo — GHA + Python + Node (7 planted findings)266- **Scenario B**: Containerized Go service — Containers + Go + Credentials (5 findings)267- **Scenario C**: .NET + Rust mixed repo — .NET + Rust + SLSA readiness (6 findings)268269---270271## Additional Reference272273- [SBOM generation, CVSS scoring, SLSA L1-L4 mapping, fix-PR workflow](reference/sbom-slsa.md)274- [Invocation interface, finding schema, inter-skill contracts, error handling](reference/contracts.md)275- GitHub Actions SHA lookup: `gh api repos/{owner}/{repo}/git/ref/tags/{tag}`276- SLSA framework: https://slsa.dev277- OpenSSF Scorecard: https://securityscorecards.dev278279---280281## Related Skills282283- `dependency-resolver` — lock file conflict resolution284- `pre-commit-manager` — automated quality enforcement hooks285- `cybersecurity-analyst` — runtime security and threat modeling286- `silent-degradation-audit` — CI reliability and regression detection287- `pr-review-assistant` — philosophy-aware PR review including supply chain checks