/security:scfwfrom security
Sets up Datadog's Supply-Chain Firewall (scfw) to block known-malicious npm, PyPI, and Poetry packages at install time. Includes setup (install, configure, test) and review (check wiring, read logs, audit packages).
Ships in security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Invocation: use /security:scfw [subcommand] in Claude Code or
$security-scfw [subcommand] in Codex.
You are setting up and operating Supply-Chain Firewall (scfw), Datadog's open-source tool that blocks known-malicious npm, PyPI, and Poetry packages before they install. It's the closest open-source analog to a registry-side "malicious package firewall": a client-side gate that inspects the full set of targets a package-manager command would pull, checks them against Datadog's malicious-packages dataset + OSV.dev (plus a recent-publish warning heuristic), and auto-blocks known-malicious installs / prompts on warnings before handing off to the real package manager.
This is a reactive, known-bad gate — it stops packages that have already been reported, not novel/zero-day malware via behavioral analysis. It complements, and does not replace, the CI/PR-side scanning in [[security-socket]] and [[security-snyk]], and the endpoint inventory in [[security-bumblebee]]. For defense in depth, run it alongside them.
The skill has two modes:
scfw, wire scfw configure so plain pip/npm/poetry passively route through the firewall (this is what makes it part of the toolchain — no re-invoking this skill), smoke-test the pipeline, and optionally install a Claude Code hook. Once.User-triggered only. Activate on:
/security:scfw — pick mode automatically (review if scfw is installed and configured, setup otherwise)./security:scfw setup — force the install/configure flow even when already configured./security:scfw review — confirm wiring + walk the recent log (if not configured, tell the user to run setup first and stop)./security:scfw audit — review mode, jump straight to auditing installed packages.Do not self-activate on related phrasing ("scan my dependencies", "is this package safe", "supply chain"). Surface the slash command and let the user decide.
HAS_SCFW=0; command -v scfw >/dev/null 2>&1 && HAS_SCFW=1
IS_CONFIGURED=0
for rc in "$HOME/.zshrc" "$HOME/.bashrc"; do
[ -f "$rc" ] && grep -q "SCFW MANAGED BLOCK" "$rc" && IS_CONFIGURED=1
done
echo "HAS_SCFW=$HAS_SCFW IS_CONFIGURED=$IS_CONFIGURED"
Branch:
HAS_SCFW=1 + IS_CONFIGURED=1 → review mode (Phase R).setup argument → setup mode regardless.review argument + not configured → tell the user "scfw isn't configured yet; run /security:scfw setup first" and stop.review argument + configured → review mode.audit argument → review mode, jump straight to the audit step (R.3).scfw installs via pipx, which drops the binary in ~/.local/bin. If command -v scfw comes back empty right after an install, that dir may not be on PATH yet — check ~/.local/bin/scfw before concluding it's missing.
You're here because scfw is installed and configured. Don't re-install or re-configure.
scfw --version
grep -n "SCFW MANAGED BLOCK" "$HOME/.zshrc" "$HOME/.bashrc" 2>/dev/null
# In a fresh interactive shell the aliases resolve to the firewall:
zsh -ic 'type pip; type npm; type poetry' 2>/dev/null || bash -ic 'type pip npm poetry' 2>/dev/null
Report whether the managed block is present and which managers are aliased (pip/npm/poetry should show scfw run …). If the block is gone, the firewall is off for new shells — offer to re-run setup's configure step.
The local log is JSON Lines, one record per scfw run/scfw audit. It only exists if SCFW_HOME (or SCFW_LOG_FILE) was set — setup's --scfw-home does that. Default path:
LOG="${SCFW_HOME:-$HOME/.scfw}/scfw.log"
[ -f "$LOG" ] || echo "no local log at $LOG (was scfw configured with --scfw-home / SCFW_HOME?)"
echo "=== action tally ==="
jq -r '.action // empty' "$LOG" 2>/dev/null | sort | uniq -c
echo "=== recent blocks ==="
jq -c 'select(.action=="BLOCK")' "$LOG" 2>/dev/null | tail -20
echo "=== recent warnings ==="
jq -c 'select(.warning==true)' "$LOG" 2>/dev/null | tail -20
Walk the user through any BLOCK records (a malicious package was stopped — note the install_targets and relevant_findings) and warnings. Records carry ecosystem, package_manager, action, warning, and (when present) install_targets / relevant_findings. Only commands run in an aliased interactive shell are logged here — the agent's own scfw run calls in a non-interactive shell usually aren't (no SCFW_HOME in that environment).
audit)scfw audit re-checks what's already installed against the same verifiers — useful when a new advisory lands:
scfw audit pip
scfw audit npm
scfw audit poetry
# For a project venv, point at its executable:
scfw audit --executable .venv/bin/pip pip
Run only the managers relevant to the project. Report any findings; a clean audit is the expected, good outcome.
PKG="<package name>"
LOG="${SCFW_HOME:-$HOME/.scfw}/scfw.log"
jq -c --arg p "$PKG" 'select((.install_targets // .audited_packages // [] | tostring) | test($p; "i"))' "$LOG" 2>/dev/null
Report the matching records (when it was seen, what action was taken). If nothing matches, say so — and if the log is sparse, suggest an scfw audit for a definitive current-state answer rather than relying on log history.
Review mode is conversational. After R.1/R.2, wait for the user to ask. Don't proactively run R.3/R.4 unless they ask to audit or name a package.
The rest of this file is setup mode. Skip it if you're in review mode.
uname -s # scfw is fully supported on macOS, best-effort on Linux, NOT on Windows
command -v python3 # scfw is a Python tool
command -v pipx || command -v pip3 # pipx strongly preferred (isolated install)
command -v jq # for reading the JSON Lines log in review mode + the optional hook
MINGW*/MSYS*/CYGWIN*) → stop. scfw doesn't support Windows; point the user at WSL.uv, pnpm, and yarn are not covered.Hand the install to the user. Installing a tool is a trust decision, and strict permission classifiers block agents from doing it unattended. Print the command and ask them to run it (in Claude Code, prefix with ! so the output lands in the transcript):
! pipx install scfw
Fallback if pipx isn't available: pip install --user scfw (or inside a virtualenv). After they report it finished, verify (safe to run agent-side):
scfw --version # expect 3.x
If command -v scfw is empty, try ~/.local/bin/scfw --version and tell the user to add ~/.local/bin to PATH (pipx ensurepath).
scfw configure writes a # BEGIN SCFW MANAGED BLOCK … # END SCFW MANAGED BLOCK region into ~/.bashrc and ~/.zshrc (only files that already exist), adding shell aliases like alias pip="scfw run pip" so every install passively routes through the firewall, plus an export SCFW_HOME=… that turns on the local JSON Lines log review mode reads.
Hand this to the user too — it edits their shell rc (persistence) and, run bare, is an interactive wizard. Give them the non-interactive form, tailored to the managers they use, and always include --scfw-home so logging is on:
! scfw configure --scfw-home "$HOME/.scfw" --alias-pip --alias-npm --alias-poetry
Drop any --alias-* for a manager they don't use. (Bare ! scfw configure runs the guided wizard instead — offer it if they prefer prompts.)
Notes:
~/.zshrc won't get aliased — have them touch ~/.zshrc first (or run the wizard, which handles home dir setup).source ~/.zshrc (or ~/.bashrc).grep -n "SCFW MANAGED BLOCK" "$HOME/.zshrc" "$HOME/.bashrc" 2>/dev/null
zsh -ic 'type pip' 2>/dev/null || bash -ic 'type pip' 2>/dev/null # should show: pip is an alias for scfw run pip
Explain the behavior the user will now see on every install: known-malicious → auto-blocked; a vulnerability or very-recently-published package → a [y/N] prompt; clean → installs normally.
Prove the firewall is in the path without mutating the environment or touching real malware — --dry-run verifies the targets and exits without installing:
! scfw run --dry-run pip install requests
Expect it to resolve/verify requests (and its deps) and report no findings, then stop short of installing. If the user aliased npm/poetry, a matching scfw run --dry-run npm install <pkg> works too. This confirms scfw is wired and reaching its data sources. (Do not attempt to install a known-malicious package to "prove" blocking — trust the dry run.)
Ask the user:
The
scfw configurealiases only cover your interactive shell. When Claude Code runspip install/npm install/poetry additself (non-interactive Bash), it bypasses them. Want me to install a small PreToolUse hook that blocks the agent's un-wrapped installs so they must go throughscfw run?
If no, skip to Phase 5. If yes, the hook (scripts/scfw-guard.sh) inspects the agent's Bash commands and:
scfw run → denies it and tells the agent to re-issue it through scfw run (where scfw vets the targets).ask). scfw can't run bun/pnpm, but their packages come from the npm registry and would enter outside the firewall — so the hook surfaces that blind spot rather than silently allowing or pretending it's vetted.Wiring it into settings.json is a persistence change — hand it to the user:
After it's wired, verify by asking the agent to run a bare pip install <something> — it should be blocked with the scfw run guidance; scfw run pip install <something> passes through.
Tell the user:
scfw installed and configured. From now on, just use pip / npm / poetry as usual —
they route through the Supply-Chain Firewall automatically in new shells.
known-malicious → auto-blocked
vuln / very new → [y/N] prompt
clean → installs normally
Local log: ${SCFW_HOME:-~/.scfw}/scfw.log (JSON Lines)
Agent hook: <installed / not installed>
Ongoing:
/security:scfw review # confirm wiring + walk recent blocks/warnings
/security:scfw audit # re-check already-installed packages against the feeds
Remove everything:
scfw configure --remove # drop shell aliases/exports
~/.claude/skills/security-scfw/scripts/install.sh --remove # if you installed the agent hook
pipx uninstall scfw
scfw run step to the CI job. Mention this if the user asks about team/CI coverage; it's out of scope for this per-machine setup.[[security-socket]] / [[security-snyk]].bun/pnpm/uv/yarn can't be added without patching scfw. bun and pnpm pull from the npm registry, so the data would cover them, but scfw can't resolve their install targets. The optional hook therefore flags bun/pnpm installs as outside the firewall (awareness only) rather than pretending to vet them. macOS fully supported, Linux best-effort, no Windows.verifier.py template ships with scfw — e.g. wiring the ossf/malicious-packages OSV feed, whose local list lives under $SCFW_HOME/); scfw configure can forward logs to Datadog (--dd-api-logger / --dd-agent-port with DD_API_KEY) for fleet observability.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
6 skills in this plugin
/bumblebeeSet up and use Perplexity's bumblebee endpoint scanner for supply-chain exposure checks. Two modes — setup (install the Go binary, pick an output directory, run a first baseline scan, optionally schedule recurring scans and wire up an exposure catalog) and review (read the latest scan, answer advisory lookups like "did I have package X@Y installed", surface drift since the prior scan, optionally re-run with the catalog). Aimed at single developers and small teams (no MDM, no SIEM). User-triggered only — activate when the user invokes `/security:bumblebee`, `/security:bumblebee review`, `/security:bumblebee check <package>`, or `/security:bumblebee setup`./gitleaksSet up gitleaks secret-scanning on a repo. Scans history for existing leaks first — stops if dirty, because installing CI on top of a polluted history makes CI permanently red. If history is clean, scaffolds .gitleaks.toml, a local pre-commit hook, and a pinned CI workflow that scans both git history and working tree. User-triggered only — activate when the user invokes `/security:gitleaks`./openssfScaffold OpenSSF Scorecard GitHub Action on a public repo with a safe two-phase rollout — first run with publish_results false so SARIF findings can be triaged before any score reaches the public dashboard, then flip to true and add a badge once the score is acceptable. Refuses to install on private/internal repos. Subcommand `fix` turns a Scorecard report into a remediation plan and applies it. Use when the user says "add OpenSSF", "set up Scorecard", "OpenSSF boilerplate", "fix the scorecard findings", or "/security:openssf"./snykSet up Snyk on a repo. The integration is a GitHub App plus a Snyk-side "import this repo as a project" step, not a checked-in config, so most of the skill is walking the user through the three browser steps (Snyk login → GitHub App install → Add project) and then verifying via the GitHub API that the App actually landed on the right account. Pre-flips "Automatic fix PRs" off so the install doesn't dump a backlog of fix PRs into the repo. Optionally scaffolds a pinned CI workflow that runs `snyk code test` (SAST), which isn't covered by the App's free tier dependency-CVE scanning. User-triggered only — activate when the user invokes `/security:snyk`./socketSet up Socket Security (socket.dev) on a repo. The integration is a GitHub App, not a config file, so most of the skill is walking the user through the OAuth install in two browser steps (socket.dev sign-in, then GitHub App install) and then verifying via the GitHub API that the install actually landed on the right account and the current repo is in the selected-repos list. Optionally scaffolds a pinned CI workflow as a status-check backstop to the App's PR comments. User-triggered only — activate when the user invokes `/security:socket`.npx claudepluginhub zcaceres/skills --plugin security