scan_directory_with_grype
Scan a project directory with Grype to detect known vulnerabilities in dependencies. Covers Cargo.lock, package.json, requirements.txt, and more ecosystems.
Instructions
Scan an entire project directory with Grype for dependency vulnerabilities.
This tool scans all dependency files in a directory (Cargo.lock, package.json, requirements.txt, etc.) and reports known vulnerabilities across all ecosystems.
Unlike scan_with_ash which scans code snippets, this tool scans the actual project directory to find vulnerabilities in all dependencies.
Supported ecosystems:
Rust (Cargo.lock)
Python (requirements.txt, setup.py, Pipfile.lock)
Node.js (package.json, package-lock.json, yarn.lock)
Java (pom.xml, build.gradle)
Go (go.mod)
Ruby (Gemfile.lock)
And many more
Args: directory_path: Path to the directory to scan (relative or absolute) severity_threshold: Minimum severity level to report (LOW, MEDIUM, HIGH, CRITICAL)
Returns: A dictionary with vulnerability findings from Grype
Note: Grype must be installed and available in PATH. Install with: - macOS: brew install grype - Linux: curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| return_output | No | Return full output instead of saving to file (default: False) | |
| directory_path | Yes | Path to the directory to scan | |
| severity_threshold | No | Minimum severity threshold (LOW, MEDIUM, HIGH, CRITICAL) | MEDIUM |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |