On GitHub, DataDog/guarddog has picked up 1.2k stars, Backend, Python. :snake: :mag: GuardDog is a CLI tool to Identify malicious PyPI and npm packages
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
GuardDog is a CLI tool that identifies malicious PyPI and npm packages, Go modules, Rust crates, RubyGems, GitHub actions, or VSCode extensions. It runs static analysis on package source code (through YARA rules) and analyzes package metadata to detect supply chain attacks.
What makes GuardDog different: Instead of just listing suspicious patterns, GuardDog correlates findings to identify actual risks based on attack chains. A package needs both the capability to perform an action (e.g., network access) and a threat indicator (e.g., suspicious domain) in the same file to be flagged as high risk.
It downloads and scans code from:
NPM: Packages hosted in npmjs.org
PyPI: Source files (tar.gz) packages hosted in PyPI.org
Go: GoLang source files of repositories hosted in GitHub.com
Rust: Crates hosted on crates.io
RubyGems: Gem packages hosted in rubygems.org
GitHub Actions: Javascript source files of repositories hosted in GitHub.com
VSCode Extensions: Extensions (.vsix) packages hosted in marketplace.visualstudio.com
How GuardDog Works
GuardDog uses a risk-based detection model that correlates code capabilities with threat indicators:
Detection: Rules identify either capabilities (what code can do) or threats (suspicious indicators)
Correlation: Capabilities and threats found in the same file form risks (cross-file matches also form risks, with downgraded severity)
Scoring: Risks are scored (0-10) based on attack chain completeness and sophistication
Reporting: Packages receive a severity rating (low/medium/high) with detailed risk breakdown
Why This Approach?
Traditional SAST tools flag every suspicious pattern independently, leading to alert fatigue. GuardDog understands that:
Capability alone isn't malicious (network libraries should make HTTP requests)
Threat indicators alone might be false positives (test fixtures, documentation)
Capability + Threat together indicates actual risk (code that can and will do something malicious)
Risk Scoring
Packages receive a score from 0-10 based on four factors:
Factor
Weight
Description
Severity
30%
Highest severity finding (low/medium/high)
Attack Chain
20%
Presence of complete attack stages (early → mid/late)
Specificity
30%
How specific patterns are to malware vs legitimate code
Check out the new Datadog Agent integration and Cloud SIEM content pack for GuardDog.
Getting started
Installation
The easiest way to run GuardDog is to use uvx:
uvx guarddog pypi scan requests
To install it locally:
uv tool install guarddog
# or
pip install guarddog
Or use the Docker image:
docker pull ghcr.io/datadog/guarddog
alias guarddog='docker run --rm ghcr.io/datadog/guarddog'
Note: On Windows, the only supported installation method is Docker.
Sample usage
# Scan the most recent version of the 'requests' package
guarddog pypi scan requests
# Scan a specific version of the 'requests' package
guarddog pypi scan requests --version 2.28.1
# Scan the 'request' package using 2 specific heuristics
guarddog pypi scan requests --rules exec-base64 --rules code-execution
# Scan the 'requests' package using all rules but one
guarddog pypi scan requests --exclude-rules exec-base64
# Scan a local package archive
guarddog pypi scan /tmp/triage.tar.gz
# Scan a local package directory
guarddog pypi scan /tmp/triage/
# Scan a package stored in S3 (a folder/prefix or a single archive object)
guarddog pypi scan s3://my-bucket/path/to/package/
guarddog pypi scan s3://my-bucket/path/to/package.tar.gz
# Scan every package referenced in a requirements.txt file of a local folder
guarddog pypi verify workspace/guarddog/requirements.txt
# Scan every package referenced in a requirements.txt file and output a sarif file - works only for verify
guarddog pypi verify --output-format=sarif workspace/guarddog/requirements.txt
# Output JSON to standard output - works for every command
guarddog pypi scan requests --output-format=json
# All the commands also work on npm, go, crates, rubygems
guarddog npm scan express
guarddog go scan github.com/DataDog/dd-trace-go
guarddog go verify /tmp/repo/go.mod
# Scan Rust crates
guarddog crates scan serde
guarddog crates verify /tmp/repo/Cargo.lock
# Scan RubyGems packages
guarddog rubygems scan rails
guarddog rubygems verify /tmp/repo/Gemfile.lock
# Additionally can support scanning GitHub actions that are implemented in JavaScript
guarddog github_action scan DataDog/synthetics-ci-github-action
guarddog github_action verify /tmp/repo/.github/workflows/main.yml
# Scan VSCode extensions from the marketplace
guarddog extension scan ms-python.python
# Scan a specific version of a VSCode extension
guarddog extension scan ms-python.python --version 2023.20.0
# Scan a local VSCode extension directory or VSIX archive
guarddog extension scan /tmp/my-extension/
# Run in debug mode
guarddog --log-level debug npm scan express
Sandboxed Scanning
When scanning packages, GuardDog runs source code analysis inside a kernel-level sandbox (Linux via Landlock, macOS via Seatbelt, using nono). The sandbox blocks all network access and restricts filesystem operations to only the paths needed for analysis. This protects against malicious packages that attempt to execute code during archive extraction or scanning.
By default, the sandbox is required: if it's not available on the platform, the scan fails instead of running unprotected. To scan without it, you must explicitly pass --no-sandbox:
# Default: require the sandbox, exit with an error if it's unavailable
guarddog pypi scan requests
# Explicitly disable the sandbox
guarddog pypi scan requests --no-sandbox
For remote packages, three phases run with different privilege levels:
Download and metadata analysis run without sandbox (need network access)
Archive extraction runs in a sandboxed subprocess (network blocked, filesystem restricted)
Source code analysis (YARA) runs in the main process after a sandbox is applied (network blocked, filesystem restricted to extracted files)
The sandbox was introduced to mitigate path traversal and code execution vulnerabilities during archive extraction (CVE-2022-23530, CVE-2022-23531, CVE-2026-22870, CVE-2026-22871).
Scanning packages from S3
GuardDog can scan a package stored in S3, either as a folder/prefix or a single archive object:
This uses your existing AWS credentials (environment variables, ~/.aws, SSO, or an IAM role). GuardDog verifies authentication via STS before doing anything and exits with an error if no valid credentials are found. The objects are synced to a temporary directory, scanned under the sandbox like any other untrusted content, and removed from disk afterward.
Rules
GuardDog uses two types of detection rules, both participating in the risk-based scoring engine:
Source code rules (YARA): Static analysis of package source code detecting capabilities and threats
GuardDog's behavior can be customized using environment variables:
General Configuration
Environment Variable
Description
Default Value
GUARDDOG_PARALLELISM
Number of threads to use for parallel processing
Number of CPUs available
GUARDDOG_VERIFY_EXHAUSTIVE_DEPENDENCIES
Analyze all possible versions of dependencies (true/false)
false
GUARDDOG_NPM_INCLUDE_DEV_DEPENDENCIES
Include devDependencies when scanning npm package.json files (true/false); can also be toggled per-invocation with guarddog npm verify --include-dev-dependencies
false
GUARDDOG_TOP_PACKAGES_CACHE_LOCATION
Location of the top packages cache directory
guarddog/analyzer/metadata/resources
GUARDDOG_YARA_EXT_EXCLUDE
Comma-separated list of file extensions to exclude from YARA scanning
Minimum risk score for a newly introduced dependency to flag the parent package in the risky_new_dependency rule
5.0
Archive Extraction Security Limits
GuardDog implements multiple security checks when extracting package archives to protect against compression bombs and file descriptor exhaustion attacks:
Environment Variable
Description
Default Value
GUARDDOG_MAX_UNCOMPRESSED_SIZE
Maximum allowed uncompressed size in bytes (prevents disk space exhaustion)
2147483648 (2 GB)
GUARDDOG_MAX_COMPRESSION_RATIO
Maximum allowed compression ratio (detects suspicious compression patterns)
100 (100:1)
GUARDDOG_MAX_FILE_COUNT
Maximum number of files allowed in an archive (prevents file descriptor/inode exhaustion)
100000
Maintainers
Sebastian Obregoso
Ian Kretz
Tesnim Hamdouni
Authors
Ellen Wang
Christophe Tafani-Dereeper
Acknowledgments
Inspiration:
Backstabber’s Knife Collection: A Review of Open Source Software Supply Chain Attacks
What are Weak Links in the npm Supply Chain?
A Survey on Common Threats in npm and PyPi Registries
A Benchmark Comparison of Python Malware Detection Approaches
Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
The most recent commit recorded on DataDog/guarddog was 3 months ago, based on the GitHub push timestamp. The repository has 126 forks — one of the better signals of community interest.
How does DataDog/guarddog compare to other Backend projects?
DataDog/guarddog is tracked by TopGit in the Backend category, with 1.2k GitHub stars and written in Python. Browse the Backend topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does DataDog/guarddog have?
DataDog/guarddog has 1.2k GitHub stars — refresh the page for the live number, or check github.com/DataDog/guarddog. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What is DataDog/guarddog?
DataDog/guarddog (DataDog/guarddog) is a Python project on GitHub. From the project's own README: :snake: :mag: GuardDog is a CLI tool to Identify malicious PyPI and npm packages
What language is DataDog/guarddog written in?
DataDog/guarddog is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is DataDog/guarddog associated with?
GitHub's repository topics for DataDog/guarddog: "malicious-packages", "npm", "npm-packages", "pypi-packages", "python", "python-security", "software-supply-chain-security". TopGit's editorial category is Backend.
Why is DataDog/guarddog categorized under Backend?
TopGit places DataDog/guarddog in the Backend category based on its GitHub topics and description (tagged: "malicious-packages", "npm", "npm-packages"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Want a second opinion on guarddog?
Ask an AI that can read this page — one click and you get its take on guarddog.