Skip to content

Back to the catalog

Supply Chain Firewall (Datadog)
github.comrepo

Supply Chain Firewall (Datadog)

Supply Chain Firewall (SCFW) is a Datadog-built CLI that wraps npm, pip, and poetry commands to inspect every package target against known-malicious/compromised package datasets (the open-source malicious-software-packages-dataset and OSV.dev) before installation proceeds, blocking or warning on hits. It ships as a single Go binary, can be aliased transparently into a developer's shell, and optionally reports run outcomes and enforces centralized allow/block policies through Datadog Code Security across a fleet, sending only package metadata (never source code) to Datadog.

TL;DR Datadog's SCFW is a CLI firewall that blocks malicious npm/PyPI/poetry package installs in real time, with optional fleet-wide policy management via Datadog Code Security.
Document

What it is

Supply Chain Firewall (SCFW) is Datadog's CLI for blocking installation of malicious npm and PyPI packages on developer workstations. Two facts the summary omits matter most: the tool is now distributed as a single Go binary with no runtime dependencies, and the Python version is deprecated — maintained only for security updates on the v3 branch. It also supports poetry in addition to pip and npm.

How it works

Given an install command, SCFW enumerates the package targets that command would actually install and evaluates them against known-malicious/compromised package intelligence. Two backends:

  • Local mode — the open-source malicious-software-packages-dataset plus the OSV.dev API. For single developers / experimentation.
  • Datadog Code Security backend — adds Datadog Security Research's threat-intel feed, centralized ALLOW/BLOCK policy across a fleet, and centralized logging/alerting on blocked attempts. Datadog receives only package metadata (ecosystem, name, version, artifact source) and the commands run — never package source code.

SCFW only inspects known "installish" subcommands for supported package managers; any other subcommand is always allowed. It refuses to run an inspected subcommand on an unsupported version of a supported package manager.

What to do

Install via Go (requires Go 1.26+):

go install github.com/DataDog/supply-chain-firewall/scfw@latest

Or download the release binary and verify the SHA-256 against the checksum published on the release page before installing (the page provides a full curl/sha256sum verification script — do not skip the checksum check).

Then wire it into your shell so package managers pass through transparently:

scfw configure \
    --alias-npm \
    --alias-pip \
    --alias-poetry \
    --dd-api-key=<your-api-key> \
    --dd-app-key=<your-app-key> \
    --dd-site=<your-dd-site>

This adds an SCFW-managed block to your .bashrc/.bash_profile/.zshrc/.zprofile (restart the shell to activate) and optionally stores Datadog keys in the system keychain. --dd-* flags are optional; it's idempotent and additive. Without aliases, invoke explicitly: scfw run -- pip install <pkg>.

CI enforcement: in a non-interactive context, a warning-level result is blocked by default — it can never be silently ignored. Control this with SCFW_ON_WARNING (allow/block), which overrides --allow-on-warning/--block-on-warning. Supply credentials via DD_API_KEY/DD_APP_KEY/DD_SITE env vars (these take precedence over keychain values), which suits per-job secret injection.

Before uninstalling, run scfw configure --remove to strip the managed rc-file block, then delete the binary.

Caveats

Coverage is bounded: unrecognized subcommands run unchecked, and the tool declines rather than degrades on unsupported package-manager versions — upgrade your package manager first. The Python (v3) path is end-of-life for features.

Technologies named here

Techniques named here

  • Command inspection/interception before execution