Skip to main content

Dependency scanner that finds your enemies in the supply chain

Project description

depenemy

Your dependencies could be your enemy.

Depenemy scans your project for supply chain risks, behavioral issues, and reputation red flags - before they can do damage.

CI PyPI Python 3.9+ License: MIT


Why depenemy?

Modern projects pull in hundreds of dependencies. Each one is a potential entry point for a supply chain attack - a compromised maintainer account, a typosquatted package, an old version with a known CVE, or a package that runs arbitrary code on install.

Depenemy gives you a single command that audits all your dependencies across npm, Python, Rust, and Solidity - and tells you exactly what looks suspicious and why.


What it detects

Behavioral risks

ID Name Description Severity
B001 Range specifier Version uses ^, ~, >=, * - allows unexpected updates Warning
B002 No version pinned No version specified at all Error
B003 Lagging version Pinned version is significantly behind latest Warning

Reputation signals

ID Name Description Severity
R001 Young author account Package author's GitHub account is < 12 months old Warning
R002 New package Package was first published < 6 months ago Warning
R003 Low weekly downloads < 1,000 weekly downloads Warning
R004 Low total downloads < 10,000 total downloads Warning
R005 No updates in 2+ years Last publish was over 2 years ago Warning
R006 Few contributors Fewer than 5 contributors on GitHub Warning
R007 Known vulnerable version Your version is below a known security patch (OSV/CVE) Error
R008 Deprecated package Package is officially marked as deprecated Warning
R009 Typosquatting suspected Name is suspiciously close to a popular package Warning

Supply chain risks

ID Name Description Severity
S001 Install scripts Package runs code at install time (postinstall, preinstall) Error
S002 No source repository No GitHub/GitLab link in package metadata Warning
S003 Archived repository Source repo has been archived or deleted Warning
S004 Dependency confusion Private package name found on public registry Warning
S005 Known malicious package Package has a recorded history of malicious activity (OSV) Error

Supported ecosystems

Ecosystem Manifest files
npm / Node.js package.json, package-lock.json, yarn.lock
Python requirements*.txt, pyproject.toml, Pipfile
Rust Cargo.toml
Solidity Foundry / Hardhat (delegates to npm)

Installation

pip install depenemy

Usage

CLI

# Scan your project
depenemy scan .

# Scan a specific file
depenemy scan pyproject.toml

# Output as SARIF (for GitHub Code Scanning)
depenemy scan . --output sarif --output-file results.sarif

# Output as JSON to a custom filename (table scan always writes depenemy-results.json automatically)
depenemy scan . --output json --output-file my-results.json

# Pipe JSON output to another tool
depenemy scan . --output json | jq '.findings'

# Fail the command if any warnings exist (useful in CI)
depenemy scan . --fail-on warning

# List all available rules
depenemy rules

Example output: image


GitHub Action

Add to your workflow and results appear automatically as Code Scanning alerts on every pull request:

- name: Scan dependencies
  uses: W3OSC/depenemy@v0.1.0
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    fail-on: error

Pre-commit hook

Block pushes that introduce risky dependencies. Add to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/W3OSC/depenemy
    rev: v0.1.0
    hooks:
      - id: depenemy

Configuration

Create .depenemy.yml in your repository root to customize thresholds, severities, and ignore specific packages:

thresholds:
  min_weekly_downloads: 1000       # R003 threshold
  min_total_downloads: 10000       # R004 threshold
  min_author_account_age_days: 365 # R001 threshold
  min_package_age_days: 180        # R002 threshold
  max_stale_days: 730              # R005 threshold
  min_contributors: 5              # R006 threshold
  max_version_lag: 10              # B003 threshold (minor versions)
  typosquatting_distance: 1        # R009 threshold (edit distance)

rules:
  B001: warning   # downgrade range specifier to warning
  R003: false     # disable low downloads check entirely

ignore:
  - name: my-internal-package
    ecosystem: npm
    reason: "Internal fork, not on public registry"
  - name: legacy-tool
    ecosystem: pypi
    reason: "Approved exception, tracked in JIRA-1234"

Set a rule to false to disable it entirely. All other rules accept warning or error.


Output formats

Format Flag Best for
Table (default) --output table Terminal / CI logs
SARIF --output sarif GitHub Code Scanning
JSON --output json Custom integrations, dashboards

How it works

image

API responses are cached for 6 hours in .depenemy_cache/ to avoid rate limits on repeated runs. Use --no-cache to force fresh data.


GitHub Token

A GitHub token unlocks author account age (R001) and contributor count (R006) checks. Without it, those rules are skipped.

# CLI
depenemy scan . --github-token ghp_xxxx

# Or via environment variable
GITHUB_TOKEN=ghp_xxxx depenemy scan .

In GitHub Actions, ${{ secrets.GITHUB_TOKEN }} is available automatically.


License

MIT - see LICENSE

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

depenemy-0.1.0.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

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

depenemy-0.1.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: depenemy-0.1.0.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for depenemy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f74417e3bc34c77327f10d2ab2b0c69ca7c44415ebfe50bc8155bf5da9e39ce1
MD5 84bf10f2789004ec3b7c7daba5ef28dd
BLAKE2b-256 26cd6fff4b559fc4502fbbd242719aab87671f69ac648a8b0e7325039392777d

See more details on using hashes here.

Provenance

The following attestation bundles were made for depenemy-0.1.0.tar.gz:

Publisher: publish.yml on W3OSC/depenemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: depenemy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for depenemy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 731b4a3bdd3fb34010f5119857399192baace120d199d913ce5b50a0c09c6148
MD5 77862303a3954f4f2f77bb20e2f8ddd0
BLAKE2b-256 164832639905eea407497285241f64a95cf357177d83f30da6d7079f35bc8565

See more details on using hashes here.

Provenance

The following attestation bundles were made for depenemy-0.1.0-py3-none-any.whl:

Publisher: publish.yml on W3OSC/depenemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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