Home

Awesome

<h1 align="center"> <img alt="SafeDep Vet" src="docs/static/img/vet-logo.png" width="150" /> </h1> <p align="center"> 🙌 Refer to <b><a href="https://safedep.io/docs/">https://safedep.io/docs</a></b> for the documentation 📖 </p>

Go Report Card License Release OpenSSF Scorecard CodeQL SLSA 3 Scorecard supply-chain security Twitter

vet banner

Automate Open Source Package Vetting in CI/CD

vet is a tool for identifying risks in open source software supply chain. It goes beyond just vulnerabilities and provides visibility on OSS package risks due to it's license, popularity, security hygiene, and more. vet is designed with the goal of enabling trusted OSS package consumption by integrating with CI/CD and policy as code as guardrails.

🔥 vet in action

vet Demo

Getting Started

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

Ensure $(go env GOPATH)/bin is in your $PATH

go install github.com/safedep/vet@latest
docker run --rm -it ghcr.io/safedep/vet:latest version

Note: Container image is built for x86_64 Linux only. Use a pre-built binary or build from source for other platforms.

Running Scan

vet scan -D /path/to/repository

vet scan directory

vet scan -M /path/to/pom.xml
vet scan -M /path/to/requirements.txt
vet scan -M /path/to/package-lock.json

Note: --lockfiles is generalized to -M or --manifests to support additional types of package manifests or other artifacts in future.

Scanning Binary Artifacts

vet scan -M /path/to/app.jar

Suitable for scanning bootable JARs with embedded dependencies

vet scan -D /path/to/jars --type jar

Scanning SBOM

vet scan -M /path/to/cyclonedx-sbom.json --type bom-cyclonedx
vet scan -M /path/to/spdx-sbom.json --type bom-spdx

Note: --type is a generalized version of --lockfile-as to support additional artifact types in future.

Note: SBOM scanning feature is currently in experimental stage

Scanning Github Repositories

vet connect github

Alternatively, set GITHUB_TOKEN environment variable with Github PAT

vet scan --github https://github.com/safedep/vet

Note: You may need to enable Dependency Graph at repository or organization level for Github repository scanning to work.

Scanning Github Organization

You must setup the required access for scanning private repositories before scanning organizations

vet scan --github-org https://github.com/safedep

Note: vet will block and wait if it encounters Github secondary rate limit.

Scanning Package URL

vet scan --purl pkg:/gem/nokogiri@1.10.4

Available Parsers

vet scan parsers --experimental

Policy as Code

vet uses Common Expressions Language (CEL) as the policy language. Policies can be defined to build guardrails preventing introduction of insecure components.

vet scan -D /path/to/code \
    --filter 'vulns.critical.exists(p, true) || vulns.high.exists(p, true)' \
    --filter-fail
vet scan -D /path/to/code \
    --filter 'licenses.exists(p, p == "GPL-2.0")' \
    --filter-fail
vet scan -D /path/to/code \
    --filter 'scorecard.scores.Maintained == 0' \
    --filter-fail

For more examples, refer to documentation

Query Mode

vet scan -D /path/to/code --json-dump-dir /path/to/dump
vet query --from /path/to/dump \
    --filter 'vulns.critical.exists(p, true) || vulns.high.exists(p, true)'
vet query --from /path/to/dump --report-json /path/to/report.json

Reporting

vet supports generating reports in multiple formats during scan or query execution.

FormatDescription
MarkdownHuman readable report for vulnerabilities, licenses, and more
CSVExport data to CSV format for manual slicing and dicing
JSONMachine readable JSON format following internal schema (maximum data)
SARIFUseful for integration with Github Code Scanning and other tools
GraphDependency graph in DOT format for risk and package relationship visualization
SummaryDefault console report with summary of vulnerabilities, licenses, and more

CI/CD Integration

📦 GitHub Action

🚀 GitLab CI

🛠️ Advanced Usage

📖 Documentation

vet docs

🎊 Community

First of all, thank you so much for showing interest in vet, we appreciate it ❤️

SafeDep Discord

💻 Development

Refer to CONTRIBUTING.md

Star History

Star History Chart

🔖 References