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/dependency_confusion.py
View on GitHub#!/usr/bin/env python3
"""
dependency_confusion.py - Find dependency-confusion / typosquat candidates from a project manifest.
For each dependency declared in the manifest, it queries the public registry (npm / PyPI) and reports:
* CLAIMABLE -> name does not exist on the public registry (404): an attacker can register it
(classic dependency confusion of an internal/private package name).
* VERSION-SHADOW -> exists publicly but the public latest version is LOWER/odd vs the pinned one,
or the project pins a private-looking scope: a high public version could shadow it.
* SCOPED -> npm @scope/name (scope must be claimable too); noted for triage.
Read-only: it only performs registry metadata GETs. It NEVER publishes anything.
Usage:
python3 dependency_confusion.py --manifest package.json --registry npm
python3 dependency_confusion.py --manifest requirements.txt --registry pypi
python3 dependency_confusion.py --manifest pyproject.toml --registry pypi
python3 dependency_confusion.py --manifest package.json --registry npm --out dc.json
Dependencies: requests (pip install requests)
"""
import argparse, json, re, sys
try:
import requests
except ImportError:
sys.exit("requests required: pip install requests")
NPM = "https://registry.npmjs.org/{name}"
PYPI = "https://pypi.org/pypi/{name}/json"
UA = {"User-Agent": "dc-audit/1.0 (authorized supply-chain assessment)"}
def parse_npm(path):
data = json.load(open(path, encoding="utf-8"))
deps = {}
for key in ("dependencies", "devDependencies", "optionalDependencies", "peerDependencies"):
deps.update(data.get(key, {}) or {})
return deps # {name: versionspec}
def parse_requirements(path):
deps = {}
for line in open(path, encoding="utf-8"):
line = line.split("#", 1)[0].strip()
if not line or line.startswith("-"):
continue
m = re.match(r"^([A-Za-z0-9_.\-]+)\s*(?:[=<>!~]=?\s*([^\s;]+))?", line)
if m:
deps[m.group(1)] = m.group(2) or "*"
return deps
def parse_pyproject(path):
text = open(path, encoding="utf-8").read()
deps = {}
# [project] dependencies = ["foo>=1", ...] and poetry [tool.poetry.dependencies]
for m in re.finditer(r'["\']([A-Za-z0-9_.\-]+)\s*(?:[=<>!~\^]=?\s*[^"\']*)?["\']', text):
name = m.group(1)
if name.lower() not in ("python",) and len(name) > 1:
deps.setdefault(name, "*")
return deps
def check_npm(session, name):
r = session.get(NPM.format(name=name), headers=UA, timeout=15)
if r.status_code == 404:
return ("CLAIMABLE", "not on npm public registry")
if r.status_code == 200:
latest = (r.json().get("dist-tags", {}) or {}).get("latest", "?")
return ("PUBLIC", f"public latest={latest}")
return ("UNKNOWN", f"http {r.status_code}")
def check_pypi(session, name):
r = session.get(PYPI.format(name=name), headers=UA, timeout=15)
if r.status_code == 404:
return ("CLAIMABLE", "not on PyPI")
if r.status_code == 200:
latest = r.json().get("info", {}).get("version", "?")
return ("PUBLIC", f"public latest={latest}")
return ("UNKNOWN", f"http {r.status_code}")
def main():
ap = argparse.ArgumentParser(description="Dependency-confusion candidate finder")
ap.add_argument("--manifest", required=True)
ap.add_argument("--registry", required=True, choices=["npm", "pypi"])
ap.add_argument("--out")
args = ap.parse_args()
if args.registry == "npm":
deps = parse_npm(args.manifest)
checker = check_npm
else:
if args.manifest.endswith(".toml"):
deps = parse_pyproject(args.manifest)
else:
deps = parse_requirements(args.manifest)
checker = check_pypi
session = requests.Session()
results = []
for name, spec in sorted(deps.items()):
scoped = name.startswith("@")
status, detail = checker(session, name)
flag = status
if status == "CLAIMABLE":
flag = "CLAIMABLE" # highest interest
elif scoped:
flag = "SCOPED"
results.append({"name": name, "pinned": spec, "scoped": scoped,
"status": status, "flag": flag, "detail": detail})
rank = {"CLAIMABLE": 0, "SCOPED": 1, "UNKNOWN": 2, "PUBLIC": 3}
results.sort(key=lambda r: rank.get(r["flag"], 9))
for r in results:
mark = "<== CLAIMABLE (confusion candidate)" if r["status"] == "CLAIMABLE" else ""
print(f"[{r['flag']:9}] {r['name']:40} pinned={r['pinned']:12} {r['detail']} {mark}")
claimable = [r for r in results if r["status"] == "CLAIMABLE"]
print(f"\n{len(results)} deps checked; {len(claimable)} CLAIMABLE confusion candidate(s).")
if args.out:
json.dump(results, open(args.out, "w", encoding="utf-8"), indent=2)
print(f"wrote {args.out}")
if __name__ == "__main__":
main()
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 |