safedep

๐Ÿ” vet

Community safedep
Updated

Next Generation Software Composition Analysis (SCA) with Malicious Package Detection, Code Context & Policy as Code

๐Ÿ” vet

๐Ÿš€ Enterprise grade open source software supply chain security

Download โ€ข Quick Start โ€ข Documentation โ€ข Community

Go Report CardLicenseReleaseOpenSSF ScorecardSLSA 3CodeQLGo Reference

๐ŸŽฏ Why vet?

70-90% of modern software constitute code from open sources โ€” How do we know if it's safe?

vet is an open source software supply chain security tool built for developers and security engineers who need:

โœ… Next-gen Software Composition Analysis โ€” Vulnerability and malicious package detection โœ… Policy as Code โ€” Express opinionated security policies using CEL โœ… Real-time malicious package detection โ€” Powered by SafeDep Cloud active scanning โœ… Multi-ecosystem support โ€” npm, PyPI, Maven, Go, Docker, GitHub Actions, and more โœ… CI/CD native โ€” Built for DevSecOps workflows with support for GitHub Actions, GitLab CI, and more โœ… MCP Server โ€” Run vet as a MCP server to vet open source packages from AI suggested code

โšก Quick Start

Install in seconds:

# macOS & Linux
brew install safedep/tap/vet

or download a pre-built binary

Scan your project:

# Scan current directory
vet scan -D .

# Scan a single file
vet scan -M package-lock.json

# Fail CI on critical vulnerabilities
vet scan -D . --filter 'vulns.critical.exists(p, true)' --filter-fail

# Fail CI on OpenSSF Scorecard requirements
vet scan -D . --filter 'scorecard.scores.Maintained < 5' --filter-fail

# Fail CI if a package is published from a GitHub repository with less than 5 stars
vet scan -D . --filter 'projects.exists(p, p.type == "GITHUB" && p.stars < 5)' --filter-fail

๐Ÿ”’ Key Features

๐Ÿ•ต๏ธ Code Analysis

Unlike dependency scanners that flood you with noise, vet analyzes your actual code usage to prioritize real risks. See dependency usage evidence for more details.

๐Ÿ›ก๏ธ Malicious Package Detection

Integrated with SafeDep Cloud for real-time protection against malicious packages in the wild. Free for open source projects. Fallback to Query Mode when API key is not provided. Read more about malicious package scanning.

๐Ÿ“‹ Policy as Code

Define security policies using CEL expressions to enforce context specific security requirements.

# Block packages with critical CVEs
vet scan \
--filter 'vulns.critical.exists(p, true)'

# Enforce license compliance
vet scan \
--filter 'licenses.contains_license("GPL-3.0")'

# Enforce OpenSSF Scorecard requirements
# Require minimum OpenSSF Scorecard scores
vet scan \
--filter 'scorecard.scores.Maintained < 5'

๐ŸŽฏ Multi-Format Support

  • Package Managers: npm, PyPI, Maven, Go, Ruby, Rust, PHP
  • Container Images: Docker, OCI
  • SBOMs: CycloneDX, SPDX
  • Binary Artifacts: JAR files, Python wheels
  • Source Code: Direct repository scanning

๐Ÿ”ฅ See vet in Action

๐Ÿš€ Production Ready Integrations

๐Ÿ“ฆ GitHub Actions

Zero config security guardrails against vulnerabilities and malicious packages in your CI/CD pipelinewith your own opinionated policies:

- uses: safedep/vet-action@v1
  with:
    policy: '.github/vet/policy.yml'

See more in vet-action documentation.

๐Ÿ”ง GitLab CI

Enterprise grade scanning with vet CI Component:

include:
  - component: gitlab.com/safedep/ci-components/vet@main

๐Ÿณ Container Integration

Run vet anywhere, even your internal developer platform or custom CI/CD environment using our container image.

docker run --rm -v $(pwd):/app ghcr.io/safedep/vet:latest scan -D /app

๐Ÿ“š Table of Contents

  • ๐ŸŽฏ Why vet?
  • โšก Quick Start
  • ๐Ÿ”’ Key Features
    • ๐Ÿ•ต๏ธ Code Analysis
    • ๐Ÿ›ก๏ธ Malicious Package Detection
    • ๐Ÿ“‹ Policy as Code
    • ๐ŸŽฏ Multi-Format Support
  • ๐Ÿ”ฅ See vet in Action
  • ๐Ÿš€ Production Ready Integrations
    • ๐Ÿ“ฆ GitHub Actions
    • ๐Ÿ”ง GitLab CI
    • ๐Ÿณ Container Integration
  • ๐Ÿ“š Table of Contents
  • ๐Ÿ“ฆ Installation Options
    • ๐Ÿบ Homebrew (Recommended)
    • ๐Ÿ“ฅ Direct Download
    • ๐Ÿน Go Install
    • ๐Ÿณ Container Image
    • โš™๏ธ Verify Installation
  • ๐ŸŽฎ Advanced Usage
    • ๐Ÿ” Scanning Options
    • ๐ŸŽฏ Policy Enforcement Examples
    • ๐Ÿ”ง SBOM Support
    • ๐Ÿ“Š Query Mode & Data Persistence
  • ๐Ÿ“Š Reporting
    • ๐Ÿ“‹ Report Formats
    • ๐ŸŽฏ Report Examples
    • ๐Ÿค– MCP Server
  • ๐Ÿ›ก๏ธ Malicious Package Detection
    • ๐Ÿš€ Quick Setup
    • ๐ŸŽฏ Advanced Malicious Package Analysis
    • ๐Ÿ”’ Security Features
  • ๐Ÿ“Š Privacy and Telemetry
  • ๐ŸŽŠ Community & Support
    • ๐ŸŒŸ Join the Community
    • ๐Ÿ’ก Get Help & Share Ideas
    • โญ Star History
    • ๐Ÿ™ Built With Open Source

๐Ÿ“ฆ Installation Options

๐Ÿบ Homebrew (Recommended)

brew tap safedep/tap
brew install safedep/tap/vet

๐Ÿ“ฅ Direct Download

See releases for the latest version.

๐Ÿน Go Install

go install github.com/safedep/vet@latest

๐Ÿณ Container Image

# Quick test
docker run --rm ghcr.io/safedep/vet:latest version

# Scan local directory
docker run --rm -v $(pwd):/workspace ghcr.io/safedep/vet:latest scan -D /workspace

โš™๏ธ Verify Installation

vet version
# Should display version and build information

๐ŸŽฎ Advanced Usage

๐Ÿ” Scanning Options

๐Ÿ“ Directory Scanning

# Scan current directory
vet scan

# Scan a given directory
vet scan -D /path/to/project

# Resolve and scan transitive dependencies
vet scan -D . --transitive

๐Ÿ“„ Manifest Files

# Package managers
vet scan -M package-lock.json
vet scan -M requirements.txt
vet scan -M pom.xml
vet scan -M go.mod
vet scan -M Gemfile.lock

๐Ÿ™ GitHub Integration

# Setup GitHub access
vet connect github

# Scan repositories
vet scan --github https://github.com/user/repo

# Organization scanning
vet scan --github-org https://github.com/org

๐Ÿ“ฆ Artifact Scanning

# Container images
vet scan --image nginx:latest
vet scan --image /path/to/image-saved-file.tar

# Binary artifacts
vet scan -M app.jar
vet scan -M package.whl

๐ŸŽฏ Policy Enforcement Examples

# Security-first scanning
vet scan -D . \
  --filter 'vulns.critical.exists(p, true) || vulns.high.exists(p, true)' \
  --filter-fail

# License compliance
vet scan -D . \
  --filter 'licenses.contains_license("GPL-3.0")' \
  --filter-fail

# OpenSSF Scorecard requirements
vet scan -D . \
  --filter 'scorecard.scores.Maintained < 5' \
  --filter-fail

# Popularity-based filtering
vet scan -D . \
  --filter 'projects.exists(p, p.type == "GITHUB" && p.stars < 50)' \
  --filter-fail

๐Ÿ”ง SBOM Support

# Scan a CycloneDX SBOM
vet scan -M sbom.json --type bom-cyclonedx

# Scan a SPDX SBOM
vet scan -M sbom.spdx.json --type bom-spdx

# Generate SBOM output
vet scan -D . --report-cdx=output.sbom.json

# Package URL scanning
vet scan --purl pkg:npm/[email protected]

๐Ÿ“Š Query Mode & Data Persistence

For large codebases and repeated analysis:

# Scan once, query multiple times
vet scan -D . --json-dump-dir ./scan-data

# Query with different filters
vet query --from ./scan-data \
  --filter 'vulns.critical.exists(p, true)'

# Generate focused reports
vet query --from ./scan-data \
  --filter 'licenses.contains_license("GPL")' \
  --report-json license-violations.json

๐Ÿ“Š Reporting

vet generate reports that are tailored for different stakeholders:

๐Ÿ“‹ Report Formats

๐Ÿ” For Security Teams
# SARIF for GitHub Security tab
vet scan -D . --report-sarif=report.sarif

# JSON for custom tooling
vet scan -D . --report-json=report.json

# CSV for spreadsheet analysis
vet scan -D . --report-csv=report.csv
๐Ÿ“– For Developers
# Markdown reports for PRs
vet scan -D . --report-markdown=report.md

# Console summary (default)
vet scan -D . --report-summary
๐Ÿข For Compliance
# SBOM generation
vet scan -D . --report-cdx=sbom.json

# Dependency graphs
vet scan -D . --report-graph=dependencies.dot

๐ŸŽฏ Report Examples

# Multi-format output
vet scan -D . \
  --report-json=report.json \
  --report-sarif=report.sarif \
  --report-markdown=report.md

# Focus on specific issues
vet scan -D . \
  --filter 'vulns.high.exists(p, true)' \
  --report-json=report.json

๐Ÿค– MCP Server

vet can be used as an MCP server to vet open source packages from AI suggested code.

# Start the MCP server with SSE transport
vet server mcp --server-type sse

For more details, see vet MCP Server documentation.

๐Ÿ›ก๏ธ Malicious Package Detection

Malicious package detection through active scanning and code analysis powered bySafeDep Cloud. vet requires an APIkey for active scanning of unknown packages. When API key is not provided, vet willfallback to Query Mode which detects known malicious packages from SafeDepand OSV databases.

  • Grab a free API key from SafeDep Platform App or use vet cloud quickstart
  • API access is free forever for open source projects
  • No proprietary code is collected for malicious package detection
  • Only open source package scanning from public repositories is supported

๐Ÿš€ Quick Setup

Malicious package detection requires an API key for SafeDep Cloud.

# One-time setup
vet cloud quickstart

# Enable malware scanning
vet scan -D . --malware

# Query for known malicious packages without API key
vet scan -D . --malware-query

Example malicious packages detected and reported by SafeDep Cloudmalicious package detection:

๐ŸŽฏ Advanced Malicious Package Analysis

๐Ÿ” Scan packages with malicious package detection enabled

# Real-time scanning
vet scan -D . --malware

# Timeout adjustment
vet scan -D . --malware \
  --malware-analysis-timeout=300s

# Batch analysis
vet scan -D . --malware \
  --json-dump-dir=./analysis

๐ŸŽญ Specialized Scans

# VS Code extensions
vet scan --vsx --malware

# GitHub Actions
vet scan -D .github/workflows --malware

# Container Images
vet scan --image nats:2.10 --malware

# Scan a single package and fail if its malicious
vet scan --purl pkg:/npm/[email protected] --fail-fast

# Active scanning of a single package (requires API key)
vet inspect malware \
  --purl pkg:npm/[email protected]

๐Ÿ”’ Security Features

  • โœ… Real-time analysis of packages against known malware databases
  • โœ… Behavioral analysis using static and dynamic analysis
  • โœ… Zero day protection through active code scanning
  • โœ… Human in the loop for triaging and investigation of high impact findings
  • โœ… Real time analysis with public analysis log

๐Ÿ“Š Privacy and Telemetry

vet collects anonymous usage telemetry to improve the product. Your code and package information is never transmitted.

# Disable telemetry (optional)
export VET_DISABLE_TELEMETRY=true

๐ŸŽŠ Community & Support

๐ŸŒŸ Join the Community

DiscordGitHub DiscussionsTwitter Follow

๐Ÿ’ก Get Help & Share Ideas

โญ Star History

Star History Chart

๐Ÿ™ Built With Open Source

vet stands on the shoulders of giants:

OSV โ€ข OpenSSF Scorecard โ€ข SLSA โ€ข OSV-SCALIBR โ€ข Syft

โšก Secure your supply chain today. Star the repo โญ and get started!

Created with โค๏ธ by SafeDep and the open source community

MCP Server ยท Populars

MCP Server ยท New