Skip to main content

A cross-ecosystem dependency vulnerability scanner and guard.

Project description

Dep-Shield

Dep-Shield is a lightweight, cross-ecosystem dependency vulnerability scanner. It supports NPM (JavaScript/Node) and PyPI (Python).

Unlike passive scanners, Dep-Shield can act as an active guard, intercepting package installation commands (npm install, pip install) to detect and block vulnerabilities before they are written to your disk.

Features

  • Multi-Ecosystem: Parses package.json, package-lock.json, and requirements.txt.
  • Real-time Guard: Intercepts install commands to prevent vulnerable packages from entering your project.
  • Smart Recommendations: Suggests safe upgrade versions when vulnerabilities are detected.
  • CI/CD Ready: Outputs machine-readable JSON for pipeline integration.
  • Powered by OSV: Uses the Open Source Vulnerabilities (OSV) distributed database.

Installation

Requires Python 3.10+.

pip install dep-shield

Usage

1. Passive Scanning

Scan your current project manifests for known vulnerabilities.

# Scan a Node.js project
dep-shield scan package.json

# Scan a Python project
dep-shield scan requirements.txt

Options:

  • --json: Output results in JSON format (useful for CI/CD).
  • --fail-on-high: Exit with an error code if High/Critical vulnerabilities are found.

2. Active Guard Mode

Dep-Shield can wrap your package manager to screen dependencies before installation.

Manual Usage:

dep-shield guard npm install lodash@4.17.15
dep-shield guard pip install django==2.2

If a vulnerability is found, Dep-Shield will block the installation, display a security report, and offer to install a safe version (if available).

Automatic Setup (Aliases): To make this seamless, add the following aliases to your shell configuration (.bashrc, .zshrc, or .profile):

alias npm="dep-shield guard npm"
alias pip="dep-shield guard pip"
alias pnpm="dep-shield guard pnpm"

Once configured, your standard commands are automatically protected:

$ npm install react
> Dep-Shield Guard is analyzing...
> No vulnerabilities found. Proceeding with installation.

CI/CD Integration

Use the --json flag to integrate Dep-Shield into GitHub Actions, GitLab CI, or Jenkins.

Example: GitHub Actions

steps:
  - uses: actions/checkout@v3
  - name: Install Dep-Shield
    run: pip install dep-shield
  - name: Security Scan
    run: dep-shield scan package.json --fail-on-high

JSON Output Schema:

[
  {
    "dependency": {
      "name": "lodash",
      "version": "4.17.15",
      "ecosystem": "npm"
    },
    "vulnerabilities": [
      {
        "id": "GHSA-p6mc-m468-83gw",
        "severity": "HIGH",
        "fixed_in": "4.17.21",
        "summary": "Prototype Pollution in lodash"
      }
    ]
  }
]

Supported Files

Ecosystem Manifest File
Node.js package.json
Python requirements.txt

License

MIT 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

dep_shield-2.0.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

dep_shield-2.0.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file dep_shield-2.0.0.tar.gz.

File metadata

  • Download URL: dep_shield-2.0.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dep_shield-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e864886ad4f3121f02f5b1aab1c5e332fe3ff8bfda6d576a119a9bc0dedbf70d
MD5 b354f108e1e83d4ac4a23270abd3d642
BLAKE2b-256 c562334d6ca1b653a756ee4c3137534c7f82c4f0857cfb2b22c63bb7c5004b43

See more details on using hashes here.

File details

Details for the file dep_shield-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: dep_shield-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dep_shield-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e873889775ce4ce2ee215c50d0d7e1c62ecce959e227df690b48ac54363fb03
MD5 82d04eb921c30f089d1df4393357754a
BLAKE2b-256 39ec127161e09af9001c358667c54ce7d29f82b976d71a4dcc5bcbb4760aa86c

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