hypnguyen1209/offensive-claude / skills/cicd-supply-chain
cicd-supply-chain
FlaggedUse when attacking or auditing a CI/CD pipeline or software supply chain — pwn requests, poisoned pipeline execution, compromised/mutable-tag actions, dependency confusion, registry worms, runner backdoors, OIDC trust abuse, SLSA/provenance
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.2 KB |
| references/action-dependency-compromise.md | markdown | 7.5 KB |
| references/build-integrity-defense.md | markdown | 8.2 KB |
| references/package-registry-attacks.md | markdown | 7.6 KB |
| references/pipeline-poisoning.md | markdown | 9.5 KB |
| references/runner-attacks.md | markdown | 7.3 KB |
| references/secrets-oidc-abuse.md | markdown | 8.1 KB |
| scripts/dependency_confusion.py | script | 4.9 KB |
| scripts/malicious_action_scanner.py | script | 9.4 KB |
| scripts/oidc_trust_auditor.py | script | 7.9 KB |
| scripts/provenance_verify.sh | script | 3.5 KB |
| scripts/runner_recon.sh | script | 5.1 KB |
| scripts/workflow_auditor.py | script | 7.9 KB |
scripts/provenance_verify.sh
View on GitHub#!/usr/bin/env bash
#
# provenance_verify.sh - Defensive gate: verify SLSA build provenance + cosign keyless signature
# for a container image (or artifact) BEFORE promoting/deploying it. Run this in a release job or
# admission step; a non-zero exit must block promotion.
#
# It enforces that the artifact was built:
# - by the expected SLSA builder (slsa-github-generator),
# - from the expected source repo + ref,
# - and signed by the expected workflow identity via Sigstore (Fulcio cert + Rekor log).
#
# Usage:
# provenance_verify.sh --image ghcr.io/org/app:tag --repo org/app
# provenance_verify.sh --image ghcr.io/org/app@sha256:DIGEST --repo org/app \
# --workflow .github/workflows/release.yml \
# --builder 'https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/v2.0.0'
#
# Deps: cosign (>=2), slsa-verifier, crane OR docker (to resolve a tag to a digest). jq optional.
set -euo pipefail
IMAGE="" ; REPO="" ; WORKFLOW=".github/workflows/release.yml"
BUILDER='https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/v2.0.0'
ISSUER='https://token.actions.githubusercontent.com'
REKOR='https://rekor.sigstore.dev'
while [ $# -gt 0 ]; do
case "$1" in
--image) IMAGE="$2"; shift 2 ;;
--repo) REPO="$2"; shift 2 ;;
--workflow) WORKFLOW="$2"; shift 2 ;;
--builder) BUILDER="$2"; shift 2 ;;
--issuer) ISSUER="$2"; shift 2 ;;
*) echo "unknown arg: $1" >&2; exit 2 ;;
esac
done
[ -n "$IMAGE" ] && [ -n "$REPO" ] || { echo "usage: --image <ref> --repo <org/name>" >&2; exit 2; }
command -v cosign >/dev/null || { echo "cosign not installed" >&2; exit 3; }
command -v slsa-verifier >/dev/null || { echo "slsa-verifier not installed" >&2; exit 3; }
# 1. Resolve a tag reference to an immutable digest (never verify a mutable tag).
if echo "$IMAGE" | grep -q '@sha256:'; then
IMAGE_DIGEST="$IMAGE"
else
if command -v crane >/dev/null; then
DIG=$(crane digest "$IMAGE")
elif command -v docker >/dev/null; then
docker pull -q "$IMAGE" >/dev/null
DIG=$(docker buildx imagetools inspect "$IMAGE" --format '{{.Manifest.Digest}}' 2>/dev/null \
|| docker inspect --format '{{index .RepoDigests 0}}' "$IMAGE" | sed 's/.*@//')
else
echo "need crane or docker to resolve tag->digest" >&2; exit 3
fi
BASE="${IMAGE%%:*}"
IMAGE_DIGEST="${BASE}@${DIG}"
fi
echo "[*] verifying immutable ref: $IMAGE_DIGEST"
# 2. SLSA provenance: must come from $REPO via the trusted builder.
echo "[*] slsa-verifier: source=github.com/$REPO builder=$BUILDER"
if slsa-verifier verify-image "$IMAGE_DIGEST" \
--source-uri "github.com/$REPO" \
--builder-id "$BUILDER"; then
echo "[+] SLSA provenance OK"
else
echo "[!] SLSA provenance verification FAILED -- BLOCK promotion" >&2; exit 1
fi
# 3. Cosign keyless attestation: identity must match the expected release workflow + OIDC issuer.
IDENTITY_RE="^https://github.com/${REPO}/\\.github/workflows/$(basename "$WORKFLOW")@refs/"
echo "[*] cosign verify-attestation identity~=$IDENTITY_RE issuer=$ISSUER"
if COSIGN_EXPERIMENTAL=1 cosign verify-attestation "$IMAGE_DIGEST" \
--type slsaprovenance \
--certificate-identity-regexp "$IDENTITY_RE" \
--certificate-oidc-issuer "$ISSUER" \
--rekor-url "$REKOR" >/dev/null 2>&1; then
echo "[+] cosign keyless signature + Rekor entry OK"
else
echo "[!] cosign attestation verification FAILED -- BLOCK promotion" >&2; exit 1
fi
echo "[+] ALL GATES PASSED: $IMAGE_DIGEST is verified -- safe to promote"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |