The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Supply Chain Guard listing page.
Open-source supply-chain security scanner that runs locally and offline. It matches known-malicious packages, extensions, plugins, providers, container images and CI actions in 15 ecosystems, with tested matchers ready for more (see Ecosystem Coverage), reading manifests and lockfiles at any depth of a repository, including the transitive dependencies a lockfile pins; and it analyses what you install for malware behavior: GlassWorm, Vidar, Shai-Hulud, fake AI tool repos, account takeovers and 350+ threat indicators in all. It generates CycloneDX 1.6 SBOMs with real dependency inventories, grades SLSA provenance (parses and structurally validates in-toto/DSSE attestations), and correlates findings into attack-chain incidents. Supports EU Cyber Resilience Act SBOM and component-documentation work, and NIS2 supply chain risk-management measures.

Scan a project. No account, no configuration, and the scan itself makes no network request:
It exits 1 on a high finding or a scan that could not examine everything, and
2 on a critical finding, so it can gate a script as it is. To add the historical
package catalog, run npx supply-chain-guard feed refresh with network access in
the directory you scan from. The catalog is cached there in .scg-cache and
belongs to the installed version, so refresh again after an upgrade.
Gate every pull request:
Let your AI coding agent check a package before it installs it (MCP):
Every release is published to npm from this repository's CI with a signed
SLSA provenance attestation,
and the Action installs that exact version. Each GitHub Release also carries
the tarball with that provenance as a Sigstore bundle (.sigstore.json). To check
one yourself:
Everything else, from output formats to policies, is further down: Quickstart, GitHub Action, For AI Coding Agents (MCP).
For a deep dive into how GlassWorm infiltrates the software supply chain and the detection techniques behind this tool, read the blog post: How GlassWorm Gets In and How We Locked It Out.
Package, extension, plugin and image identities are matched against the threat feed. This list is generated from the indicators that actually ship, so an ecosystem is only named as covered once there is something to match:
src/App/ is covered, and a lockfile's transitive dependencies are matched, not only direct ones.import()FILE_TOO_LARGE_SKIPPED (info severity, never affects exit codes) instead of being silently skipped - padding a payload past the limit no longer hides it from the report#!/bin/sh, #!/usr/bin/env node, python3, ruby, perl and others), and an extensionless file named like a git hook (pre-commit, pre-push, ...) is read as shell even without one, so hooks under scripts/hooks/ or .husky/ and bin/ launchers in a directory scan or an npm tarball are content-scanned. *.bats suites are read as bash and, like *.test.ts, count as test files, and Perl source is read as .pl/.pm too. A file with no extension, no shebang and no hook name is still not readnpm <pkg> mode, corroborates a package's claimed repository against the repo's own package.json and flags a repo borrowed from an unrelated popular project to inherit its stars/trust (conservative: monorepos, forks, related names, and unfetchable repos are not flagged).github/workflows/*.md that ingest untrusted issue/PR text, hold a cross-repo token, and can post publicly - the prompt-injection data-leak postureimage: value (Compose, Kubernetes,
workflow containers), see Ecosystem CoverageDetects LLM-control tokens embedded in package READMEs that target downstream AI coding agents (Claude Code, Cursor, Copilot) reading the docs on behalf of a human developer. The example tokens below are HTML-escaped in the raw README so the patterns do not flag this documentation itself - they render normally in any markdown viewer:
<system-reminder> / <system-prompt> (Anthropic family)<|im_start|> / <|im_end|> ChatML (OpenAI, Llama, Mistral, Qwen)[INST] / [/INST] (Mistral, Llama instruction-tuned)<|system|> / <|user|> / <|assistant|> (Phi, Gemma, Granite, generic role tokens)Not credentials: the map of your network that a public repository hands out for free. Private and non-routable addresses (RFC1918, CGNAT, link-local, IPv6 ULA), internal-only hostnames (.internal, .local, .lan, .corp, .home, .intranet), clone URLs pointing at a forge that is not a known public one, developer home-directory paths, and internal service endpoints. Reported at medium (reconnaissance value, not compromise), with an optional deny-list for the names only your project knows. See Internal Disclosure.
Links individual findings into incident-level attack chains:
Multi-dimension trust scoring for package and repository inspections:
npm, pypi, repo, and remote scan <github-url> modes; local directory scans evaluate Code Quality and Dependency Trust with renormalised weights).Requires Node.js 22 or newer. Every release runs its complete test suite, and
installs and executes its own packed tarball, on Node 22 and on Node 24, the current
Active LTS. Full policy, including what the
package is published from and what the Action and container image run on:
docs/node-support.md.
Or use directly with npx:
Run the scanner as a pre-commit hook (Python-ecosystem teams get the same gate without touching npm). Add this to your .pre-commit-config.yaml:
The scanner writes its risk history to .scg-history/ in the scanned repo;
it is not written when --no-history is set, which the hook now uses. For
plain scans without that flag, add the folder to your .gitignore.
If a file in .scg-history/ cannot be read, the scan says so and fails. The
two stores there, risk-history.json and triage-decisions.json, are the
baseline that trend, forecast and triage-governance rules compare against. A
store that is absent is a first scan and stays silent, which is the normal case
on a fresh checkout or a hosted runner. A store that exists but does not parse,
because a scan was interrupted mid-write or the file was edited by hand, is lost
evidence, and the two are deliberately not reported the same way: the scan emits
RISK_HISTORY_UNREADABLE or TRIAGE_STORE_UNREADABLE at high, sets
partialScan: true, and exits nonzero regardless of --fail-on, because an
unusable baseline is an indeterminate result rather than a clean one. The
unreadable file is left on disk rather than overwritten, so complete entries can
still be recovered from it, usually by closing the truncated JSON array by hand.
Delete the file to start a new baseline once you have decided the old trend is
expendable. --no-history does not silence this: that flag stops the write, not
the read, so a corrupt store still degrades the verdict and is still reported.
The hook scans the repository root on every commit and fails on high or critical findings.
Run the scanner without a Node toolchain via the official multi-arch image (linux/amd64, linux/arm64), published to GHCR on every release tag:
${PWD} works in bash, zsh, and PowerShell; in cmd.exe use %cd% instead.
Publish the badge JSON from CI (gist or gh-pages), then point Shields at it:
The scan exits non-zero when it finds high/critical issues - exactly when the
badge MUST update to red. Neutralize the exit code on the generate step (or use
if: always() on the publish step) so a bad scan never freezes the badge green:
--min-severity may reduce report noise, but it cannot be stricter than the
active --fail-on gate because that would hide findings required for the exit
verdict. Invalid combinations fail before scanning. Incomplete coverage also
exits nonzero regardless of the severity threshold and is reported as
partialScan: true in JSON.
Secret scanners answer one question: did a credential get committed? This family answers a different one: did our internal topology get committed?
Internal hostnames, private LAN addresses, self-hosted forge URLs, developer home directories and private repository names are not credentials, so no secret scanner reports them. Together they are the reconnaissance map an attacker draws before touching anything: what exists, what it is called, where it listens, and who works on it. It leaks through the same boring channels every time. A copied clone command in a README. A .env.example that kept the real staging host. A comment with the path the author built from. A lockfile pointing at an internal registry. None of it is a secret, all of it is intelligence, and it stays in git history long after the file is fixed.
The rules are shape-based, so they work on a repository whose owner has configured nothing at all. You never have to write down what your infrastructure is called in order to be protected from publishing it.
| Rule | Severity | Shape |
|---|---|---|
INTERNAL_PRIVATE_IP | medium | RFC1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), CGNAT (100.64.0.0/10), link-local (169.254.0.0/16) |
INTERNAL_PRIVATE_IPV6 | medium | IPv6 Unique Local Addresses (fc00::/7) |
INTERNAL_HOSTNAME | medium | Hostnames in an internal-only TLD: .internal, .local, .lan, .corp, .home, .intranet |
INTERNAL_SERVICE_ENDPOINT | medium | http(s)://HOST:PORT where HOST is private or internal |
INTERNAL_GIT_REMOTE | medium | ssh://git@<host>:<port>/<path> and scp-style git@<host>:<path> where the host is not a known public forge |
INTERNAL_DEV_PATH | medium | C:\Users\<name>\, /home/<name>/, /Users/<name>/ in committed code or docs. /Users/ is matched case-sensitively, because /users/ is a REST route |
INTERNAL_SINGLE_LABEL_URL | low | A URL whose host has no domain at all, so it only resolves through internal DNS or a hosts file |
INTERNAL_DENYLIST_MATCH | medium | A term your project configured (see below). Off unless configured |
INTERNAL_DISCLOSURE_TRUNCATED | info | A limit stopped this family short on one file (see Bounded cost). Never silent about a gap |
Severity follows the host, not the rule. A host with no domain part is the weakest signal in the family whichever rule reports it, so a dotless payments host with a port is low, exactly like the same host without one. Only a dotted internal name or a private address makes an endpoint medium.
INTERNAL_GIT_REMOTE is the one worth pointing at: it finds a self-hosted forge without anyone having to name it. Any clone URL that is not github.com, gitlab.com, bitbucket.org, codeberg.org, git.sr.ht and the other well-known public hosts is, by shape alone, a forge somebody runs privately.
Topology is reconnaissance value, not compromise, so the family reports medium and low. high and critical stay reserved for credential-shaped findings, which the existing rules already own.
Practically: the default gate exits non-zero on critical and high only, so upgrading cannot turn a passing build red. --fail-on high and --fail-on critical are equally unaffected. Two things do change: the risk score rises (each medium adds points), and a pipeline that runs --fail-on medium or lower will see the new findings. If you would rather not see them at all, they respect every existing control:
The parser reads block style only; a flow sequence on one line
(disable: [A, B]) is reported as POLICY_UNKNOWN_KEY and disables nothing.
A rule that screams on every README gets switched off, and a switched-off rule protects nothing. Three independent layers keep this quiet.
1. The reserved documentation space never fires. Anything written the way the RFCs intend is invisible to these rules:
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24example.com, example.org, example.net, the .example TLD, .invalid, .testlocalhost URLsrunner, vscode, ubuntu, jenkins, you, dev, user, Public and moredb, redis, api, minio, nginx, and the unix / npipe pseudo-hosts that mean "a UNIX domain socket, not a machine"10.0.0.0/16 is a subnet layout, not a host, so it is not reported (a /32 host route is)169.254.169.254 (and the ECS 169.254.170.2, Amazon Time Sync 169.254.169.123, Alibaba 100.100.100.200), the Kubernetes defaults 10.96.0.1 and 10.96.0.10 and the k3s 10.43.0.1 / 10.43.0.10, the default service and pod CIDRs (10.96.0.0/12, 10.244.0.0/16, 10.42.0.0/16), the Docker bridge gateway 172.17.0.1, and the Docker Desktop names host.docker.internal and friends. A real address inside the same ranges is still reported.2. A match has to sit where its rule can mean what it claims.
config.internal.timeout, com.acme.internal.util and settings.local.json are never hosts../config.local, src/config.local and ../lib/settings.local are module specifiers. https://db.example.corp/, //registry.svc.example.corp/ and git@forge.internal.example:... still are hosts.( is a method call: res.local(name, val) in a changelog is not a machine.config.internal.timeout and state.local.value are property accesses. Data and config files (.yml, .json, .toml, .env, Dockerfile, lockfiles) carry unquoted values, so no quotes are required there./Users/ is matched case-sensitively and :id, {id}, <id> and ${user} are rejected after the account segment, so app.get("/users/:id"), "/users/{id}" and app.get("/users/profile/edit") are routes, not macOS home directories. A Windows path keeps both spellings, because C:\users\ is unambiguous.3. The surface decides which rules stay armed.
| Surface | Rules that still fire |
|---|---|
Source files (.ts, .py, .tf, .yml, Dockerfile, .npmrc, lockfiles) | all of them |
Documentation prose and fenced code blocks: .md / .rst / .txt, anything under docs/ | everything except the single-label URL |
Markdown inline code spans, and fenced blocks tagged ```text / ```plaintext | hostname, endpoint, clone URL |
Files that exist to BE an example: examples/, samples/, fixtures/, testdata/, *.example.* / *.sample.* / *.template.* | hostname, endpoint, clone URL |
Test, spec, mock and fixture files and directories (test/, tests/, spec/, e2e/, __tests__/, __mocks__/, *.test.*), minified and bundled output | none |
The reasoning changed here, deliberately. Documentation used to be excluded wholesale, which silenced precisely the case this family exists for: a private address or a developer path inside a README is one of the most common ways internal topology reaches a public repository, and a /home/<name>/ in a pasted stack trace is a real leak, not a teaching aid. The reserved namespace above is what protects a writer who follows the RFCs, and it works on every surface. What stays excluded is what measurement showed to be noise rather than signal: inline code spans (on the sample used to tune this, eight findings, all of them API signatures or documented examples), placeholder fences, and files whose whole purpose is to show a shape.
Two things are reported on purpose even though they can be examples. Kubernetes in-cluster names (<service>.<namespace>.svc.cluster.local) name your service inventory. And an address or path inside a code comment (a JSDoc @example block, say) is reported, because a comment is the single most common place a real host gets written down and nothing distinguishes an illustrative address from a real one there. Use RFC5737 addresses in code examples, or suppress by path.
A generated bundle is one 800 KB line, and a rule family that takes minutes on it is a rule family that gets switched off. Four limits keep the cost flat, and none of them is silent:
FILE_TOO_LARGE_SKIPPEDINTERNAL_DEV_PATH and INTERNAL_GIT_REMOTE) are each written as two
patterns, so those can reach 50 from a single file. When the per-file cap
drops findings it keeps the most severe ones.Whenever a limit is reached, the file gets one INTERNAL_DISCLOSURE_TRUNCATED finding at info severity naming the limit. A scanner that quietly stopped looking is indistinguishable from a repository with nothing to find, and that is not a trade this tool makes.
On top of that, everything else already in this tool applies: suppress with a path: glob, ignore: globs, --exclude, --min-severity, and inline // scg-ignore-next-line INTERNAL_HOSTNAME reason.
Shape rules cannot know that sample-service is one of your private repositories. A deny-list can. But a list of your internal hostnames committed to a public repository is exactly the leak you were trying to prevent, so there are three ways to configure one and only one of them puts plaintext in the repo.
Hashing recipe. Normalisation is trim, then lowercase. Then sha256, lowercase hex. That is the whole rule, so any tool can reproduce it:
What hashing is worth, honestly.
As a matcher it is exact-token matching, nothing more. A token is a maximal run of letters, digits, ., _ and - (so https://forge.internal.example/x yields forge.internal.example), plus an org/repo pair and a .git suffix stripped, all lowercased. A hashed entry for forge.internal.example therefore matches that host but not sub.forge.internal.example, and there is no way around it: a scanner that could match substrings of a hash would be a scanner that could recover the term. When you need substring or regex power, use externalFile (b).
As a secret it buys less than "hashed" suggests, and it is worth saying plainly. An unsalted, single-round sha256 of a low-entropy value is dictionary-attackable: hostnames come from a small, guessable space (a short site or service word, a two-digit index, one of a handful of internal TLDs), so anyone with your repository can hash candidate names until one matches. What a digest genuinely buys is that the term is not sitting in the file to be read, copied or grepped, and that it does not travel into a report, a log or a screenshot. That is real, and it is not the same as being unrecoverable.
If you need the stronger claim, salt it with a value that lives outside the repository:
The salt has to be held outside the repository to be worth anything: a salt committed next to the digests is hashed by the same reader who reads them, which is why there is no config key for the salt itself. hashSalted: true is what keeps this fail-visible - a scan that runs without the salt matches nothing, which looks exactly like a clean repository, so the declaration turns that silence into an INTERNAL_DENYLIST_UNAVAILABLE finding instead.
An environment variable does the same thing as externalFile without touching the committed config at all:
The external file is one entry per line, # for comments, sha256:<digest> for a hashed entry, /pattern/flags for a regex, anything else is a case-insensitive literal. If the file is configured but absent (a shared CI runner that never received it), you get an INTERNAL_DENYLIST_UNAVAILABLE finding at info severity rather than silence: a deny-list that quietly stopped running looks exactly like a repository that is clean. An entry that cannot be compiled is reported the same way (INTERNAL_DENYLIST_INVALID_ENTRY, medium). Neither finding ever prints the entry, and the environment variable is named but its value is not, because a path can itself contain an account name.
The two sources are not equally trusted, and the difference is deliberate. SCG_INTERNAL_DISCLOSURE_FILE is set by whoever runs the scan, so it may name any path on the machine and carry any pattern. internalDisclosure.externalFile and internalDisclosure.patterns live in the committed policy file, which travels inside the repository being scanned, and scanning a repository you do not own is the ordinary case for this tool. Entries from there are therefore bounded:
externalFile must stay inside the scanned directory. An absolute path is refused, a relative path that climbs out with .. is refused, and so is one that leaves through a symbolic link. The file is not opened, so nothing about a path outside the tree reaches the report. The bound is the scanned directory and nothing narrower: a path that stays inside it is still read, .git/config included, so a committed externalFile can still point at whatever your runner wrote into the workspace. Matches from it stay redacted.patterns, or from an externalFile that is inside the tree, is capped at 200 characters and refused when it quantifies a group that already contains a variable quantifier ((a+)+, (a?)*, and the like). That shape can take exponential time to report no match, so one committed line would otherwise occupy a runner until the workflow times out.INTERNAL_DISCLOSURE_TRUNCATED rather than running on.A refusal is an INTERNAL_DENYLIST_REFUSED finding at medium severity, and like every other coverage finding it marks the scan partial rather than passing quietly. In the published Action a partial scan exits 1 on its own, independently of fail-on. None of this applies to the environment-variable source.
Two limits of the shape check, both worth knowing before you upgrade.
It refuses more than it has to, and the shape it most often refuses is the ordinary one. A chained label group is how an internal hostname is normally written, and it is rejected even though it is linear in practice:
If you have the first form today, in patterns or in your own gitignored externalFile, rewrite it before you upgrade. Left as it is, the term stops being looked for, the scan becomes partial, and the Action exits 1.
It also refuses less than it has to, so an accepted pattern is not a promise about time. The check reads the source text, which cannot see ambiguity that comes from overlapping alternation, so /(a|a)+$/ and /(a|ab)+$/ are accepted and are still catastrophic, and the wall-clock budget cannot interrupt a match that is already running. Availability from a committed pattern is narrowed here, not closed; the remaining case is tracked on issue 169.
One more note on the paradox. allowlist.domains also answers INTERNAL_HOSTNAME, INTERNAL_SERVICE_ENDPOINT and INTERNAL_GIT_REMOTE for a given host, which is convenient and publishes the host name. If that is not acceptable, suppress by path instead, which names nothing:
Create .supply-chain-guard.yml in your project root to customize behavior:
Findings can also be suppressed inline with a comment on the line directly
above them: // scg-ignore-next-line RULE reason (JS/TS) or
# scg-ignore-next-line RULE (Python/YAML/shell).
The policy file is read from the directory being scanned, and from nowhere else. There is no flag, environment variable or Action input that points the scanner at a policy outside the scan target.
On a pull_request event the checkout materialises the head of the proposing
branch, so the policy that governs the scan is the one on the branch under
review, not the one on your default branch. A change that adds
.supply-chain-guard.yml alongside the code it excuses is applying its own
policy to itself. Anyone who can push a branch can therefore narrow the scan of
that branch.
That is a property of reading policy from the tree, and it is stated here rather than left to be discovered. What it is not is silent:
ignore:, which removes files before any rule opens them
and used to leave no trace anywhere.POLICY_DISABLE_NO_REASON, POLICY_IGNORE_NO_REASON,
POLICY_SUPPRESSION_NO_REASON), so an undocumented exclusion costs a line in
the report rather than nothing.If your threat model includes an untrusted proposer, the controls that actually
hold are outside this tool: require review on .supply-chain-guard.yml through
CODEOWNERS, or scan a base-ref checkout in a separate job. Treat a policy file
in a pull request diff as a change to your security gate, because it is one.
Only report NEW findings (ignore known baseline):
Two different claims live here, and they are proven differently.
Known-malicious identity matching. For every ecosystem below, a directory scan reads the listed files
at the scan root and at any depth below it, extracts the package, extension, plugin, provider, image or
action identities, and matches them against the threat feed: the bundled indicators, and the downloadable
catalog after feed refresh. A version pin fires only on the exact malicious release; a range or a
constraint in a manifest leaves the version unknown, so only a whole-name entry can match there.
This table is generated from src/ecosystem-coverage.json and checked by
the build (check:coverage); it is not written by hand. Every row is proven by
coverage-matrix.test.ts, which puts an indicator into each
listed file format, at the scan root and one directory down, runs a real scan and requires the rule to
report it exactly once. A format listed here without such a test fails the test suite. "Indicators shipped"
says whether any indicator exists today; "none yet (matcher ready)" means the matcher is proven but no
malicious package is known in that ecosystem yet, and the importer or a curated entry will fill it.
| Ecosystem | Files read | Rule | Indicators shipped | Imported automatically from |
|---|---|---|---|---|
| npm | package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lock | MALICIOUS_DEPENDENCY, LOCKFILE_MALICIOUS_VERSION, LOCKFILE_MALICIOUS_PACKAGE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| PyPI | requirements.txt, pyproject.toml, poetry.lock, uv.lock, Pipfile.lock | PYTHON_MALICIOUS_PACKAGE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| RubyGems | Gemfile, Gemfile.lock | RUBY_MALICIOUS_GEM | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| Composer (PHP) | composer.json, composer.lock | COMPOSER_MALICIOUS_PACKAGE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| NuGet (.NET) | packages.lock.json, *.csproj, packages.config | NUGET_MALICIOUS_PACKAGE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| Cargo (Rust) | Cargo.toml, Cargo.lock | CARGO_MALICIOUS_CRATE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| Go modules | go.mod, go.sum | GO_MALICIOUS_MODULE | bundle | GitHub Advisory Database, OpenSSF / OSV |
| Maven / Gradle / SBT / Bazel | pom.xml, gradle.lockfile, build.gradle, build.gradle.kts, libs.versions.toml, build.sbt, maven_install.json | MAVEN_MALICIOUS_PACKAGE | bundle + catalog | GitHub Advisory Database, OpenSSF / OSV |
| Dart / Flutter (pub) | pubspec.lock, pubspec.yaml | PUB_MALICIOUS_PACKAGE | bundle | GitHub Advisory Database, OSV |
| Swift Package Manager | Package.resolved, Package.swift | SWIFT_MALICIOUS_PACKAGE | none yet (matcher ready) | GitHub Advisory Database, OSV (SwiftURL) |
| CocoaPods | Podfile.lock, Podfile | COCOAPODS_MALICIOUS_POD | none yet (matcher ready) | curated only |
| Hex (Elixir / Erlang) | mix.lock, mix.exs | HEX_MALICIOUS_PACKAGE | none yet (matcher ready) | GitHub Advisory Database, OSV |
| CRAN (R) | renv.lock, DESCRIPTION | CRAN_MALICIOUS_PACKAGE | none yet (matcher ready) | OSV |
| Conan (C / C++) | conan.lock, conanfile.txt, conanfile.py | CONAN_MALICIOUS_PACKAGE | none yet (matcher ready) | curated only |
| Terraform / OpenTofu providers | *.tf (required_providers), .terraform.lock.hcl | TERRAFORM_MALICIOUS_PROVIDER | bundle | curated only |
| Terraform / OpenTofu modules | *.tf (module), .terraform/modules/modules.json | TERRAFORM_MALICIOUS_MODULE | none yet (matcher ready) | curated only |
| Helm charts | Chart.yaml, Chart.lock | HELM_MALICIOUS_CHART | none yet (matcher ready) | curated only |
| Ansible Galaxy | requirements.yml, galaxy.yml | ANSIBLE_MALICIOUS_CONTENT | none yet (matcher ready) | curated only |
| Container images | Dockerfile, docker-compose.yml, Kubernetes manifest (image:) | DOCKER_MALICIOUS_IMAGE | bundle | curated only |
| GitHub Actions | .github/workflows/*.yml, action.yml (composite) | GHA_KNOWN_MALICIOUS_SHA | bundle | curated only |
| Homebrew | Brewfile, Brewfile.lock.json | HOMEBREW_MALICIOUS_PACKAGE | bundle (legacy format only) | curated only |
| VS Code / Open VSX extensions | .vscode/extensions.json, devcontainer.json, installed extension package.json | VSCODE_MALICIOUS_EXTENSION | bundle + catalog | OpenSSF / OSV (VSCode) |
| Browser extensions (Chrome, Edge, Firefox) | Chromium policy JSON, Firefox policies.json, installed Chromium extension, Firefox extension manifest | BROWSER_MALICIOUS_EXTENSION | bundle | curated only |
| JetBrains plugins | .idea/externalDependencies.xml, META-INF/plugin.xml | JETBRAINS_MALICIOUS_PLUGIN | bundle | curated only |
Behavior and hardening analysis. Independent of the feed, these read what a package or repository actually does:
| Target | Command | What It Scans |
|---|---|---|
| npm package | npm <pkg>, scan | package.json install scripts and tarball contents: install-hook chains, obfuscation, exfiltration |
| PyPI package | pypi <pkg> | setup.py, setup.cfg, pyproject.toml build hooks and package contents |
| VS Code / Open VSX extension | vscode <id or .vsix> | activation events, dangerous APIs and bundled code, plus the extension's own identity |
| Source trees | scan | code patterns across JavaScript, TypeScript, Python, shell, Go, Rust and more |
| Cargo / Go | scan | build.rs, proc macros, go.mod replace directives, init() functions, CGo |
| Docker | scan | Dockerfile, Dockerfile.*, Containerfile hardening (instructions only) |
| Terraform | scan | provisioners, external module sources, hardcoded secrets |
| GitHub Actions | scan | .github/workflows: unpinned actions, secrets exfiltration, injection, agentic workflows |
| npm lockfiles | scan | integrity hashes, non-registry resolved URLs, version downgrades (package-lock.json, pnpm-lock.yaml, yarn.lock v1 and Berry, bun.lock) |
| GitHub repositories | repo | trust signals, releases, README lures |
| Solana | monitor | C2 wallet memo transactions |
supply-chain-guard is the malware / behavior / campaign-IOC layer: it statically scans what you actually install (node_modules, packages, Docker images, VS Code extensions, Actions workflows, IaC) for malicious behavior and known campaign indicators, entirely locally. It does NOT do CVE lookups: pair it with osv-scanner or npm audit for known vulnerabilities. Most tools below measure a different axis and are complementary, not competitors.
There is one axis where it goes somewhere the others do not go at all. Credential scanners such as gitleaks and trufflehog hunt secrets, and they are good at it; nothing in that category hunts what a repository gives away about the network it came from. That is what Internal Disclosure covers: internal hostnames, private addresses, self-hosted forge URLs and developer paths, reported as reconnaissance risk rather than as a leaked credential.
| Tool | Focus | Malware / behavior detection | Known-CVE lookup | Ecosystems | Open source | Account needed |
|---|---|---|---|---|---|---|
| supply-chain-guard | Malware campaigns, IOCs, behavior heuristics in installed artifacts; SBOM + SLSA provenance grading (in-toto/DSSE structural validation) | Yes: 350+ static heuristics plus multi-source GHSA/OpenSSF package verdicts and campaign-IOC matching, local at scan time (recent and curated indicators offline, the historical package catalog after a feed refresh) | No | 15 ecosystems of packages, extensions, plugins, providers, images and CI actions with shipped indicators, and tested matchers for more (see Ecosystem Coverage), plus GitHub repos | Yes (Apache-2.0) | No |
| OSV-Scanner | Known vulnerabilities in dependency inventories (OSV.dev database lookup) | Known-malicious versions via OSV MAL- entries only; no behavior or IOC analysis | Yes (offline mode available) | 11+ ecosystems, 19+ lockfile formats, container images, SBOM input | Yes (Apache-2.0) | No |
| Socket | Proactive behavioral analysis of entire registries (SaaS) | Yes: 70+ risk types registry-wide, before advisories exist; engine is closed source and cloud-side | Yes | npm, PyPI, Maven, Go, Cargo, RubyGems, NuGet, more; Actions workflows | CLI only (MIT); detection engine proprietary | Yes (except Firewall Free) |
| GuardDog | Heuristic 0-10 risk scoring of individual packages (YARA + registry metadata) | Yes: heuristics only, no known-malware or campaign-IOC database; sandboxed scanning | No | npm, PyPI, Go, RubyGems, GitHub Actions, VS Code extensions | Yes (Apache-2.0) | No |
| OpenSSF Scorecard | Security-practice score of upstream repos (branch protection, pinning, review) | No: rates project hygiene, never analyzes published package contents | Only for the rated repo itself (OSV check) | GitHub repos, partial GitLab | Yes (Apache-2.0) | No (GitHub token for self-run CLI) |
| npm audit | Advisory lookup for your npm dependency tree, built into npm | Known-malicious versions after an advisory is published; no behavior or IOC analysis; audit signatures verifies provenance | Yes (GitHub Advisory Database) | npm only | Yes (CLI; lookup is a registry-side service) | No |
Honest caveats: Socket's registry-wide behavioral detection is deeper than anything a local scanner can do, at the cost of a closed engine and cloud analysis. Scorecard is the industry standard on its axis (upstream hygiene prediction) and supply-chain-guard does not replace it. OSV-Scanner and npm audit do flag known-malicious packages: the gap is advisory lag, not a missing capability.
osv-scanner --lockfile=package-lock.json for known CVEs and MAL- entries, then supply-chain-guard scan . for behavioral and campaign-IOC threats in the installed tree. Two axes, one job, both exit-code gated.npm audit --audit-level=high plus npx supply-chain-guard scan . covers advisory-known vulnerabilities and unreported malware without adding a single dependency.guarddog npm scan <pkg> for an independent heuristic score, plus supply-chain-guard npm <pkg> for campaign-IOC and install-hook analysis, before it ever touches your machine.supply-chain-guard produces artefacts and findings that support compliance work under two EU regulations that apply to software manufacturers. It does not make an organisation compliant: compliance remains the responsibility of the organisation deploying the software, and the mapping below describes what the tool produces, not a legal assessment.
The CRA requires manufacturers of products with digital elements to identify and document the components they ship, to address vulnerabilities in those components, and to be able to reason about the integrity of what they build on. supply-chain-guard contributes to each of those activities:
package-lock.json (lockfile version 2 or
later) for the full transitive tree, falling back to the direct dependencies
declared in package.json. pnpm-lock.yaml, yarn.lock and bun.lockb are
not read, and neither is any non-npm manifest: a Python, Cargo, Go,
RubyGems, Composer or NuGet project produces an SBOM with no components from
that ecosystem. Every such file that is present is named in the document, in
metadata.properties, alongside an inventory-coverage value of
full-transitive, direct-only or none, so an inventory that was never
taken is never mistaken for a product that ships nothing. The scanner's threat
detection covers all the ecosystems listed at the top of this README; only the
SBOM inventory is npm-scoped.--sbom-output <file> and --format sbom produce the SAME document for the
same scan: the same components, the same dependency graph, the same
vulnerabilities entries and the same incident annotations. Only the
serialNumber and the timestamps differ, because each invocation is its own
run. The two exist so an SBOM can be written to a file while the scan report
itself goes to stdout in another format.
From package-lock.json (v2 or later) every component carries a stable
bom-ref, a purl, the integrity hashes, the CycloneDX scope, and the
licence the lockfile declares, expressed as an SPDX expression when the string
is an expression and as license.id when it is a plain SPDX identifier. An
identifier the generator cannot vouch for is kept as license.name rather than
asserted as SPDX, because the CycloneDX schema constrains license.id to the
SPDX enum. Relationships are emitted as a top level dependencies array rooted
at the subject component and resolved the way npm resolves them, so a nested
duplicate is linked to the dependent that actually installed it rather than to
the hoisted copy.
What could not be assessed is stated instead of left blank. A component whose
manifest declares no licence carries a supply-chain-guard:license property
saying so, so an empty licence column is never read as "no licence terms". At
the document level, metadata.properties records which manifest the inventory
came from, how many components carry a declared licence, whether the dependency
graph was resolved, partial or not assessed, and how many declared edges resolve
to no component in the document (uninstalled optional peer dependencies,
normally). A declared edge whose target is not in the document is counted there
rather than emitted as a dependsOn pointing at a bom-ref that does not
exist.
Findings removed by a suppress: entry in .supply-chain-guard.yml are emitted
as CycloneDX VEX statements, with the reason the policy declared carried
verbatim in analysis.detail. No analysis.justification is emitted: that
field is a fixed enum that a free-text reason cannot be mapped to. A suppression
with no recorded reason produces a statement that says exactly that.
Component hashes are hexadecimal digests, decoded from the base64 Subresource
Integrity value npm writes into the lockfile, because that is the encoding the
CycloneDX hash-content pattern requires. An integrity part whose algorithm is
not one this generator maps, or whose payload does not decode to the digest
length its algorithm requires, is dropped and reported on the component rather
than emitted, and counted at the document level. purls are canonical: the npm
scope is the purl namespace and the separator after it is a literal /.
Where the inventory came from package.json because no lockfile was present, a
component carries version and purl only when the manifest declares one exact
version. A range, a dist-tag such as latest, a git or URL specifier and a
workspace: protocol are constraints, not versions: those components carry
neither field, a supply-chain-guard:version property records why, and
supply-chain-guard:declared-specifier keeps the declared string verbatim.
Supplier and author are not emitted. package-lock.json does not carry either
field, and the SBOM generator reads only package-lock.json and package.json,
so there is nothing to populate them from without a registry lookup.
Article and paragraph citations are deliberately omitted here. Map these outputs to specific provisions against the final published regulation text, with your own legal review, rather than against this README.
NIS2 requires essential and important entities to take measures covering supply chain security. The relevant capabilities are:
incidents on the report), SARIF (the incident list on
runs[0].properties, and the incidents each result belongs to in that
result's property bag) and CycloneDX (one annotations entry per
incident, whose subjects are the vulnerabilities entries it groups). The
text renderer prints it as a panel. The markdown, HTML, badge, GitLab and
JUnit formats carry the individual findings only, not the incident record.
For a ready-made evidence document rather than a machine format, scan --export-incident-md writes a markdown incident report to stdout: risk score,
every detected incident with its confidence, narrative and indicator list, the
critical findings, and the response playbooks..npmrc / .yarnrc scanning
surfaces misconfiguration before deployment.Apache-2.0, no account required, and no telemetry: the scanner reports only to its own output.
Offline by default:
scan on a local path runs fully offline (unless one of the opt-in flags
--check-registry or --external-intel is passed), as do guard, feed stats,
and all report formatters. These
commands make zero network requests and are suitable for air-gapped and
data-egress-restricted environments.
An offline scan matches against the bundled indicator set: every domain, URL, IP
and hash, every curated campaign, and the recent package indicators. Older
package indicators live in the historical catalog, which is much larger than the
bundle and is downloaded by supply-chain-guard feed refresh into .scg-cache
in the working directory (or --cache-dir). A scan without that cache, or with
one left over from another release, runs against the bundled set only, and every
scan report says so in its Catalog line (see
THREAT_FEED_CATALOG_MISSING).
Networked commands and external disclosures: The commands that reach the network do so deliberately for their specific functions:
supply-chain-guard npm <pkg> / pypi <pkg> / vscode <ext>: fetch and inspect remote packages and extensions from public registries (npm, PyPI, VS Code Marketplace, Open VSX).supply-chain-guard confusion <dir>: inspects project dependency manifests and transmits every declared dependency and devDependency package name to the public npm and PyPI registries to determine whether private or internal packages are registered publicly.supply-chain-guard repo <url> and supply-chain-guard org <name>: inspect remote GitHub repositories and organizations by invoking the gh CLI as a child process, using the caller's ambient GitHub credentials.supply-chain-guard monitor <wallet>: polls public Solana RPC nodes for C2 wallet transaction activity.supply-chain-guard feed refresh: downloads updated threat intelligence from the upstream repository into the local cache.supply-chain-guard scan <github-url>: clones a remote repository via Git for analysis.supply-chain-guard scan . --check-registry: opt-in flag that queries the public npm registry for the package's latest published version to detect version drift, and transmits each Python dependency name from requirements.txt / pyproject.toml to the public PyPI registry for dependency-confusion signals. Up to v6.2.5 the PyPI lookups ran on every scan of a Python project, contrary to the offline guarantee above; they now need this flag.supply-chain-guard scan . --external-intel: opt-in flag for the two-tier score. It sends each dependency's name, ecosystem and version to the OSV API, the CVE ids found to FIRST's EPSS API, and the project's GitHub owner/repo to the OpenSSF Scorecard API, and downloads the public CISA KEV catalog.Offline runs use the feed bundled with the installed version, so pin the version you intend to audit against.
Pin an exact version. That is the recommended form, and it is the same advice this tool gives about your own dependencies: a security scanner should be a deterministic input, so you know which detection logic and which IOC feed ran, and an upgrade is a reviewable change rather than something that happens to you.
Let Dependabot keep the pin current:
daily, not weekly, and this project's release rate is why. Measured over
the 155 days to 2026-08-21: 134 releases, about 1.4 a day over the last two
months, with a median of 20 hours between releases and two thirds of the gaps
under a day. A weekly schedule cannot track that. Each weekly run opens a correct
bump pull request, and the next weekly run closes it as superseded and opens
another, so an unattended pin never moves at all. Measured in one consumer of
this Action: eight consecutive weekly bump pull requests, each alive for exactly
seven days, each proposing a newer target than the last, while the pin itself sat
unchanged for 49 days and fell 82 releases behind. Every scan check was green
throughout, because a stale pin is not a failing scan.
The interval is the cheap half. The half that actually decides the outcome is whether somebody merges the pull request, and no setting in this file supplies that.
@v6, and what it does and does not guarantee@v6 also works and stays supported. It is a floating branch, fast-forwarded
to each release by CI, and the composite action on it pins an exact npm version
that is bumped and build-gated on every release. So @v6 is not latest: every
resolution still installs one exact, release-gated version.
The caveat is what happens after a major. If the v6 line stops being released once
v7 ships, @v6 keeps resolving a frozen action that pins an old npm version, and
the IOC feed it installs stops updating. For a scanner that is a silent
false-negative generator, and nothing in your workflow would report it. An exact
pin is what turns that into a reviewable out-of-date dependency instead.
Be precise about what an exact pin does and does not buy you, because a frozen exact pin is the same silent false negative. It ages exactly as quietly. This scanner runs offline against the IOC feed bundled with the pinned version, so a pin that stops moving freezes the detection rules at that date. What an exact pin buys is a place where the staleness becomes reviewable: the bump pull request. That is a different claim from the staleness being visible on its own, and the measurement above is what the difference costs. If those pull requests are opened and superseded without ever being merged, the pin is frozen and the rule set is ageing.
The scan itself now says so. Every scan measures how old the rule set it just
matched against actually is, and reports THREAT_FEED_STALE (medium) once the
newest indicator in that rule set is more than 30 days old. The finding carries
the measured age and the newest indicator's date, it raises the risk score off
zero and the risk level off clean, and it is named in eight of the nine report
formats and in the Action's pull request comment, which renders whichever
format you set (markdown by default). It is derived offline from the feed
itself, so it travels with the pin: an installation that never updates reports
its own age without needing a network call, a registry lookup, or anything
configured by the consumer.
Where it appears, exactly, because "every format" would be one format too many:
text, json, markdown, sarif, sbom, html, gitlab and junit all
carry the rule id THREAT_FEED_STALE, and all but junit carry the full
description as well. The ninth format, badge, does not: the Shields.io endpoint
payload is {schemaVersion, label, message, color} derived from the findings
summary counts, so it never names a rule. What you see there instead is the
badge for an otherwise clean repository turning from clean/brightgreen into
1 medium/yellow - the condition is visible, but not identifiable, and a
badge is the one surface where that matters least. In junit the rule id is a
passing <testcase> rather than a <failure>, because only critical and
high become failures there.
The measurement is taken over the rule set the scan used, not over the version
number. A consumer running supply-chain-guard feed refresh before each scan
merges the published feed for 24 hours and is correctly reported as current even
on an old pin. supply-chain-guard feed stats prints both ages side by side, the
one bundled with the installed version and the effective one at scan time, so the
two are never confused. If a deliberately frozen rule set is the intent, exclude
the rule by name:
Staleness is about the rule set being old. This one is about part of it not being consulted at all.
The indicator corpus is published in two pieces. Recent and curated indicators are compiled into the package and always available offline. The historical corpus lives in a catalog that is published beside the release and downloaded on demand, because carrying all of it in the package would make every install and every Action run pay for indicators most scans never match. A scan without the catalog is narrower than a scan with it, and without this rule it reports exactly the same success.
supply-chain-guard feed refresh downloads the catalog and caches it for later
scans, in .scg-cache under the working directory unless --cache-dir names
another. The cache belongs to one release, so an upgrade needs a new refresh.
The finding names how many historical indicators were not consulted and
why, and the reason matters:
| Reason | Severity | What it means |
|---|---|---|
| not downloaded yet | info | No catalog in the cache directory. Run a refresh there. |
| unreadable | medium | The cache could not be parsed. |
| built for a different release | low | Left over from an older version. |
| does not match the pinned digest | high | Not the catalog this release expects. |
| entries do not match their checksum | high | The cached data changed underneath the scanner. |
The last two are not normal states. They say the scanner's own detection data is either corrupt or has been modified in place, which is a different problem from "not downloaded yet" and is worth looking at the machine for.
"Not downloaded yet" is info so that it does not turn every first run yellow,
and that also means --min-severity low, the Action's default, filters the
finding out. The same state is therefore recorded as provenance, independent of
any severity filter:
scan report carries a Catalog line in every format, in bold in the
Markdown report (and so in the Action's pull request comment whenever one is
posted) when the catalog was not consulted. The npm, pypi and vscode
commands, which vet one remote package, carry no Catalog line;detectionSet.catalog (consulted, entryCount,
reason), and the CycloneDX SBOM carries
supply-chain-guard:detection-set:catalog-consulted;ioc_lookup result carries checkedAgainst.catalog, plus a
coverageNote on a clean package verdict reached without the catalog.None of these changes the score, the risk level, the badge or the exit code.
The cache checksum is also compared with an entries digest compiled into the package. A cache with the right public header, recomputed checksum and entry count is still refused when its actual indicators differ from this release.
Set catalog: required in .supply-chain-guard.yml to treat any of them as
critical, so a scan that could not consult the full corpus fails the default
gate rather than reporting a narrower result as success:
The GitHub Action is bundle-only unless refresh-catalog is true. It caches
into an isolated directory under RUNNER_TEMP, not into the checkout, so a
preceding feed refresh in the workflow does not count. catalog: required
on the Action therefore needs:
An empty catalog is a valid catalog: while a release publishes no historical indicators there is nothing to miss, and the rule stays quiet under the default setting rather than firing on every scan. If scanning against the bundled set alone is the intent, exclude the rule by name:
The Action does not trust the registry to hand it the right scanner. The npm
version is pinned in action.yml, and that alone would let a registry or CDN
response carrying other bytes under that version run as the scanner, next to
your checkout and your token. So before anything is scanned:
RUNNER_TEMP, from https://registry.npmjs.org/, with --ignore-scripts,
never globally. Its lockfile records the integrity of the tarball on disk.npm audit signatures --include-attestations verifies the registry
signature and the Sigstore provenance of what was installed.scripts/verify-action-install.mjs then requires what npm does not: that
the provenance exists at all, that its signing certificate was issued to
this repository (by name and by numeric id) running
.github/workflows/ci.yml at the release tag, and that it describes the
tarball the lockfile recorded.Any failure stops the job with an error annotation naming the check, before the
scan step runs and before the scanner reaches PATH. No input changes this and
the inputs and outputs are unchanged.
What this covers is the scanner package itself. Its npm dependencies (today one,
commander, resolved within its declared range at install time) are checked by
registry signature only: they carry no provenance from this repository, and the
published package ships no shrinkwrap that would pin them.
Two operational requirements follow. The runner needs npm 11.12.0 or later,
which Node 24.15.0 and later bundle. The Action's actions/setup-node step uses
check-latest: true, so a runner whose tool cache holds an older Node 24
resolves the newest 24.x instead; if npm is still too old after that, the install
step fails closed with a message saying so. And the step talks to
registry.npmjs.org and to the Sigstore trust root CDN
(tuf-repo-cdn.sigstore.dev). The public registry is set explicitly, whatever a
runner's .npmrc says, because the provenance check is only meaningful against
the registry that recorded the attestation; a runner that can reach only a
registry mirror cannot verify the scanner and will not run it.
| Input | Description | Default |
|---|---|---|
path | Path to scan | . |
format | Output format (text/json/markdown/sarif/sbom/html/badge/gitlab/junit) | markdown |
min-severity | Minimum severity to report | low |
exclude-rules | Comma-separated rule IDs to exclude | |
fail-on | Fail check at this severity or above, including info | critical |
comment-on-pr | Post or update a PR comment | true |
refresh-catalog | Download the historical catalog into the isolated Action cache before scanning. Needed for catalog: required. | false |
Coverage failures are fail-closed regardless of fail-on: the Action exits
nonzero, sets partial-scan to true and risk-level to partial, and posts
a warning even when severity filters hide the informational coverage finding.
A critical threshold failure retains exit code 2; other partial results exit 1.
PR comments require pull-requests: write (shown above). GitHub restricts write
access for pull requests from forks, so the check verdict, job log, and outputs
remain authoritative when the platform refuses a comment.
| Output | Description |
|---|---|
score | Risk score from 0 to 100 |
risk-level | partial, clean, low, medium, high, or critical |
findings-count | Number of reportable findings after filters |
partial-scan | true when coverage was incomplete |
report | Requested report, or a size notice when it exceeds the safe output budget |
report-path | Runner-local path to the complete report for later steps in the same job |
report-truncated | true when report was replaced by the size notice |
supply-chain-guard is both a scanner OF the agentic ecosystem and a tool FOR it.
Scanning agentic attack surfaces (automatic in every scan):
.mcp.json, .cursor/mcp.json, .vscode/mcp.json,
claude_desktop_config.json - malicious server packages, C2 endpoints,
plain-http servers, secrets forwarded to remote servers, prompt injection in
tool descriptions (MCP_ rules).claude/skills/**/SKILL.md, .claude/settings.json
hooks, .cursorrules, .github/copilot-instructions.md, AGENTS.md, CLAUDE.md -
injected control tokens, invisible Unicode instruction channels, download-and-execute
and credential-harvesting instructions, dangerous hook commands (SKILL_/AGENT_ rules)Built-in MCP server - let your AI agent vet packages BEFORE installing them:
This form works in every shell (bash, zsh, PowerShell, cmd) and avoids npx
cold-start timeouts on first connect. On bash/zsh you can use the one-liner
claude mcp add supply-chain-guard -- npx -y supply-chain-guard mcp instead;
note that PowerShell swallows the bare -- itself, so on Windows prefer the
global-install form above.
Exposes three tools over stdio: ioc_lookup (offline IOC + known-bad-version check
for every supported ecosystem; package verdicts include the historical catalog only
after feed refresh, and the result says which), scan_directory, and
scan_npm_package.
Client config snippets for Claude Code, Claude Desktop, and Cursor: docs/mcp.md.
The bundled IOC feed ships with every release, and the same data is published as feed.json on every push to main - so protection lands the day a campaign is ingested, not at the next release:
A refreshed feed is merged into every scan for the next 24 hours automatically.
Rule-set age: feed stats reports two ages, the one bundled with the
installed version and the effective one at scan time, and marks either [STALE]
past 30 days. --format json returns the same values as bundledFreshness and
freshness (newestIndicator, ageDays, datedEntries, stale) for a
workflow that wants to assert on them directly. Both are computed offline, from
the feed itself.
OSV export: feed osv emits the feed's malicious-package indicators (npm,
PyPI-adjacent, Go, RubyGems, Packagist, crates.io, NuGet) as OSV-schema
records, so the feed is consumable by osv-scanner and other OSV-native tooling:
Indicator contract: every feed value is a LITERAL indicator (a domain, IP,
URL, hash, or package name), never a regular expression. All ingestion paths
(feed refresh, the legacy update API, and the cached-feed load at scan time)
validate each entry against its type's shape and quarantine anything invalid -
a malformed or hostile feed entry can neither crash a scan nor flood it with
garbage matches, and a rejected refresh never overwrites the previous cache.
Acquisition bounds: both download paths are bounded before anything is
parsed or written. An absolute 30 second deadline covers DNS, connect, headers
and the body read; the response is capped at 32 MiB, refused on a declared
Content-Length over the cap before a byte is read and counted again while
streaming when no length is declared; at most 5 redirects are followed and every
hop is revalidated. An inactivity timeout would not be enough, because a peer
that keeps trickling bytes never triggers one. Every bound fails closed and
loudly: the download is abandoned, one line naming the bound goes to stderr, the
command exits non-zero, and the previous cache stays in effect.
Curated entries are hand-added from vendor write-ups. Malicious-package entries are additionally discovered through two public upstream paths, with no account and no API key:
GHSA-... id in its source field.MAL- record exports. These
records aggregate origins including ecosystem analysis services and security
vendors, while retaining the original providers in every imported entry.
Licensed Apache-2.0.OSV querybatch separately corroborates GitHub-discovered packages. It is never used to corroborate an OpenSSF-discovered package against the same database.
Every imported entry is auditable: the source field names the public advisory
it came from. A failed import writes nothing at all - the previous feed stays in
effect and the process exits non-zero. The full mapping (ecosystem prefixes,
version-range rules, which upstream fields deliberately stay unset) is in
docs/threat-feed-sources.md; the source-adapter
contract and trust boundaries are in
docs/feed-architecture.md.
Block known-bad packages BEFORE the package manager runs their lifecycle scripts - the only install blocker whose entire blocklist is auditable in git history, offline, no account:
Supports npm, pnpm, yarn, and bun. Guard flags go BEFORE the manager name:
--dry-run checks the command without ever invoking the manager, --force
proceeds despite findings (with a loud warning). Everything after the manager
name is passed through to it unchanged.
All checks are offline against the bundled IOC feed (plus a feed refresh
cache when present), the known-bad-version blocklist, and the typosquat
heuristics - no network call, no telemetry.
Limitation: version ranges and tags (^1.2.3, latest) are not resolved
offline, so a version-pinned IOC only fires on an exact pin. Bare-name IOCs
(a whole malicious package) fire on any version. Use scan after install for
full-tree, behavior-level coverage.
Edit src/patterns.ts to add new detection rules:
If supply-chain-guard runs in your CI, add the badge to your README:
A static badge only claims the scan. To make it prove one, point it at the status of the workflow that runs the scan, the way this repository's own badge shows its self-scan:
See CONTRIBUTING.md for guidelines. The most impactful contribution is adding new detection patterns for emerging threats.
Full release history lives in CHANGELOG.md.
Apache-2.0 - Copyright 2026 Elvatis - Emre Kohler