ci-workflow-audit
Use this skill when a user wants a one-shot scan of their CI workflows
for the supply-chain attack surface that the ci-action-pinning rule
defines as forbidden. The rule is the gate (blocks new violations
post-deployment); this skill is the discovery tool (surfaces existing
violations in a user repo).
Pairs with npm-supply-chain-audit (npm-ecosystem audit) — together
they cover most of the user-side risk surface that AIWG's own
supply-chain hardening (v2026.5.3) addresses on the AIWG side.
Triggers
- "audit workflow pinning"
- "ci workflow audit"
- "are my actions pinned"
- "check container image pins"
- "scan workflows for secrets"
- "supply chain risk in CI"
Scope
Audits the following workflow file locations (all supported in parallel):
| Platform | Path |
|---|---|
| GitHub Actions | .github/workflows/*.yml, .github/workflows/*.yaml |
| Gitea Actions | .gitea/workflows/*.yml, .gitea/workflows/*.yaml |
| GitLab CI | .gitlab-ci.yml, .gitlab/*.yml (where applicable) |
| Reusable workflows | uses: ./.github/workflows/* references (transitive) |
Read-only. No mutations.
Audit sequence
1. Inventory workflow files
find .github/workflows .gitea/workflows -type f \( -name "*.yml" -o -name "*.yaml" \) 2>/dev/null
test -f .gitlab-ci.yml && echo ".gitlab-ci.yml"
Record the count. Each subsequent check iterates over this set.
2. Action-pin audit — fail on tag-pinned `uses:`
# Detect floating tags (semver tags, branches, latest)
grep -rnHE '^\s*-\s*uses:\s*[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+@(v?[0-9]+(\.[0-9]+)*|main|master|latest)\s*(#.*)?$' \
.github/workflows/ .gitea/workflows/ 2>/dev/null
Each match is a finding. Severity: HIGH (workflow runs arbitrary
third-party code with workflow's secret access).
Acceptable exception: uses: ./ references (local reusable workflows
in the same repo) — these pin to the calling commit. Flag separately
as INFO and recurse into them to check their uses: references too.
3. Container-image-pin audit — fail on tag-pinned `container:`/`image:`
grep -rnHE '^\s*(container|image):\s*[a-zA-Z0-9._/-]+:[a-zA-Z0-9._-]+\s*(#.*)?$' \
.github/workflows/ .gitea/workflows/ 2>/dev/null \
| grep -v 'sha256:'
Each match without @sha256: is a finding. Severity: HIGH (same
attack surface as actions; container provides the execution
environment for every step).
4. Bare `:latest` audit
grep -rnHE ':latest\b' .github/workflows/ .gitea/workflows/ 2>/dev/null
Each match is a finding. Severity: CRITICAL (:latest is the
canonical anti-pattern — captures both digest absence AND the most
volatile possible tag).
5. PR-secret-exposure audit
For each workflow file, check whether any job triggered by
pull_request references secrets.*:
# Identify pull_request-triggered jobs
for f in $(find .github/workflows .gitea/workflows -name "*.yml" -o -name "*.yaml" 2>/dev/null); do
# Extract jobs that run on pull_request and check for secret references
awk '/^on:/,/^[a-z]/ { print }' "$f" | grep -q 'pull_request' || continue
if grep -nE '\${{\s*secrets\.' "$f" >/dev/null 2>&1; then
echo "POTENTIAL SECRET EXPOSURE in $f"
grep -nE '\${{\s*secrets\.' "$f"
fi
done
Each match is a finding. Severity: CRITICAL (a contributor PR
from a fork can read repo secrets via the workflow's environment;
classic supply-chain attack vector documented in the Shai-Hulud
campaign).
Acceptable exception: jobs gated with if: github.event.pull_request.head.repo.full_name == github.repository
(only trusted maintainer PRs). Flag as INFO and verify the guard.
6. Curl-pipe-shell installer audit
grep -rnHE 'curl[^|]+\|\s*(bash|sh)' .github/workflows/ .gitea/workflows/ 2>/dev/null
Each curl | sh pattern is a finding. Severity: MEDIUM unless
the surrounding context includes a content-hash check (look for
sha256sum, OBSERVED_SHA, EXPECTED_INSTALL_SHA) — if no hash
check is present, severity is HIGH.
The recommended fix pattern (strict-mode opt-in) is documented in the