Skip to main content

Supply chain security scanner for npm and pip packages

Project description

gate

Supply chain security scanner for npm and pip packages.

Checks packages for known CVEs, quarantines newly published versions, and warns about suspicious install scripts — before they hit your project.

  ✓ flask 3.1.1
  ✗ requests 2.28.0
    CVE-2023-32681: Unintended leak of Proxy-Authorization header
  ⚠ urllib3 2.3.0
    Published 2 day(s) ago (quarantine window: 7 days)

Why

Supply chain attacks increasingly target the window between a package being published and being detected as malicious. Existing tools (Trivy, Snyk, Dependabot) catch known CVEs but miss:

  • Newly published malicious versions not yet in any database
  • Install scripts that run arbitrary code on pip install

Gate adds a quarantine window — new versions are flagged until the community has had time to catch problems.

Zero runtime dependencies. A supply chain security tool that trusts its own supply chain is not a security tool.

Checks

Check What it catches
CVE scan Known vulnerabilities via OSV.dev
Quarantine window Versions published within N days
Install scripts npm packages running suspicious install hooks
Hash verification Detects tampered packages via lock file integrity checks
Maintainer change Flags when a package owner has changed between versions
SBOM export Generates a CycloneDX 1.6 Software Bill of Materials

Installation

pip install gate-cli

Requires Python 3.12+.

Usage

Check a single package

gate check requests
gate check requests==2.28.0
gate check lodash --npm
gate check lodash==4.17.15 --npm

Scan all packages in a project

Automatically detects requirements.txt or package-lock.json:

gate scan

Exit code is non-zero if errors are found — suitable for CI pipelines.

Export a CycloneDX SBOM

gate scan --sbom                  # print to stdout
gate scan --sbom report.cdx.json  # write to file

Install as a git pre-commit hook

gate init

Gate will run automatically on every git commit when lock files change. To remove:

gate uninstall

Configuration

Create .gate.toml in your project root to override defaults:

quarantine_days = 14

fail_on = ["critical_cve", "install_script"]
warn_on = ["recent_release"]
Option Default Description
quarantine_days 7 Days a new release must age before passing
fail_on ["critical_cve", "install_script"] Conditions that block the commit / exit 1
warn_on ["recent_release"] Conditions that warn but allow through

Move recent_release from warn_on to fail_on to enforce the quarantine window strictly.

Supported ecosystems

Ecosystem Lock file Registry
PyPI requirements.txt pypi.org
npm package-lock.json registry.npmjs.org

CVE data is sourced from OSV.dev — Google's open vulnerability database.

Contributing

Gate is open source and built for the community. Contributions welcome.

git clone https://github.com/Mhacker1020/gate
cd gate
pip install -e ".[dev]"
python -m pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gate_cli-0.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gate_cli-0.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file gate_cli-0.1.0.tar.gz.

File metadata

  • Download URL: gate_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for gate_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ac49e9e2fcae1f31ce3f2f09936b47f13b3fd58404e600ca9cf94d7ffb4fdbd
MD5 1964eb5fe756e0f6661703692ef976cb
BLAKE2b-256 49f473d234161216e22541c36d36b0b709c2e2bfea153551ab4ddb911fb4b5a1

See more details on using hashes here.

File details

Details for the file gate_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gate_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for gate_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00965c06e7059d4d81b3c9a6750aad77aac8760f9c9192a88624967e0012c0f8
MD5 813968a729abeaa26cd4ef921d83a416
BLAKE2b-256 8e222cc2cc0849a442a45e3673b298c133a63a52ed8c732cae6c2269b0c5710f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page