Skip to content
sebastianjnuwuPublic

About

πŸ›‘οΈ Fast, cross-platform Rust CLI for multi-ecosystem dependency, license, and OSV vulnerability scanning.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

30 Commits

Folders and files

Repository files navigation

Sentinel

Sentinel

Blazing-fast, zero-bloat, cross-platform Rust CLI for multi-ecosystem dependency, license & vulnerability scanning.

Rust Platform OSV License: Apache-2.0

Preview β€’ Why Sentinel β€’ Ecosystems β€’ Installation β€’ Usage β€’ Configuration β€’ CI/CD


✨ Preview

Sentinel Terminal Preview

More output modes: --json & --sarif

Sentinel JSON Output Preview

Sentinel SARIF Output Preview


⚑ Why Sentinel?

  • Instant & Lightweight: Single native Rust binary with zero runtime dependencies, HTTP Keep-Alive pooling (rustls), bounded 16-worker concurrency, and an atomic 15-minute local cache (~0.01s–0.20s on cached runs).
  • Direct & Transitive Security: Parses 12 lockfile formats natively (no external CLIs or node_modules required) and queries Google OSV in batches for CVE, GHSA, RUSTSEC, GO, and PYSEC advisories.
  • License Visibility: Displays package licenses (MIT, Apache-2.0, ISC, etc.) and highlights copyleft licenses (GPL/AGPL).
  • CI/CD Ready: Built-in --json, SARIF 2.1.0 (--sarif for GitHub Security), and quality-gate flags (--fail-on-cve, --fail-on-major).
  • True Cross-Platform: Runs natively on Windows (with automatic UTF-8 console support), Linux, and macOS.

🌍 Supported Ecosystems

Ecosystem Manifest / Detection Lockfile (Transitive OSV) License OSV Advisories
🟩 JS / TS (npm, pnpm, yarn, bun) package.json package-lock.json, pnpm-lock.yaml, yarn.lock βœ… βœ…
🐹 Go go.mod go.sum β€” βœ…
πŸ¦€ Rust (cargo) Cargo.toml Cargo.lock βœ… βœ…
🐍 Python (uv, pip) pyproject.toml, requirements.txt uv.lock, poetry.lock βœ… βœ…
🐘 PHP (composer) composer.json composer.lock β€” βœ…
🟣 .NET (dotnet) *.csproj, *.fsproj packages.lock.json β€” βœ…
β˜• Java / Kotlin (maven, gradle) pom.xml, build.gradle(.kts) β€” β€” βœ…
πŸ’Ž Ruby (bundler) Gemfile Gemfile.lock βœ… βœ…
🐦 Dart / Flutter (pub) pubspec.yaml pubspec.lock β€” βœ…
⚑ Elixir (hex) mix.exs mix.lock βœ… βœ…
🍎 Swift / iOS (swiftpm) Package.resolved β€” β€” βœ…
🧱 Terraform .terraform.lock.hcl β€” β€” β€”
🐳 Docker Dockerfile, docker-compose.yml β€” β€” βœ…
πŸ™ GitHub Actions .github/workflows/*.yml β€” β€” βœ…

πŸ“¦ Installation

From crates.io

The crate is published as sentinel-scan; the installed binary is sentinel:

cargo install sentinel-scan

From Source (Cargo)

Requires Rust (Edition 2024):

cargo install --path . --force

Pre-built Binaries

Download the latest static release binaries and checksums.txt from the Releases page:

OS Architectures Assets
Linux (static musl) amd64, arm64, 386 (32-bit), armv7 sentinel-linux-{amd64,arm64,386,armv7}.tar.gz
Windows (msvc) amd64, arm64, 386 (32-bit) sentinel-windows-{amd64,arm64,386}.zip
macOS arm64 (Apple Silicon), amd64 (Intel) sentinel-macos-{arm64,amd64}.tar.gz

Docker / GitHub Packages (FROM scratch)

Run Sentinel directly from the official minimal container image without installing Rust:

# Linux / macOS
docker run --rm -v "$PWD:/workspace" ghcr.io/sebastianjnuwu/sentinel:latest /workspace

# Windows (PowerShell)
docker run --rm -v "${PWD}:/workspace" ghcr.io/sebastianjnuwu/sentinel:latest /workspace

πŸš€ Usage

# Scan the current directory (recursively up to 3 levels deep)
sentinel

# Scan a specific workspace
sentinel /path/to/workspace

# Force fresh registry & OSV queries (bypass 15-min cache)
sentinel --no-cache

# Output machine-readable JSON
sentinel --json /path/to/workspace

# Output SARIF 2.1.0 for GitHub Code Scanning
sentinel --sarif /path/to/workspace > sentinel.sarif

CLI Options

Flag Description
--json Output structured JSON to stdout
--sarif Output SARIF 2.1.0 for GitHub Security tab
--fail-on-cve Exit with code 1 if any CVE/GHSA advisory is found
--fail-on-major Exit with code 1 if any MAJOR update is found
--depth <N> Maximum recursive directory depth (default: 3)
--no-cache Bypass the 15-minute local registry & OSV cache
-u, --update Download and install the latest Sentinel release
-V, --version Print version
-h, --help Print help

Environment Variables

Variable Description
GITHUB_TOKEN Optional token for higher GitHub API rate limits when scanning .github/workflows/*.yml and Package.resolved.

βš™οΈ Configuration

Create an optional sentinel.toml in your project or workspace root:

ignore_packages = ["legacy-pkg", "ureq"]
ignore_dirs = ["examples", "fixtures"]
deny_licenses = ["GPL", "AGPL"]
check_updates = true   # set to false to disable background update check

πŸ”„ CI/CD Integration

Use Sentinel as a fast security gate in GitHub Actions and upload findings directly to GitHub Security β†’ Code Scanning:

- name: Run Sentinel Security Scan
  run: sentinel --sarif --fail-on-cve . > sentinel.sarif

- name: Upload SARIF to GitHub Security
  if: always()
  uses: github/codeql-action/upload-sarif@v4
  with:
    sarif_file: sentinel.sarif

πŸ—οΈ Architecture & Development

Every Rust source file strictly enforces a <= 70 lines modular limit (see AGENTS.md):

src/
β”œβ”€β”€ main.rs            # CLI entry point & parallel orchestration
β”œβ”€β”€ cli.rs             # Argument & flag parser
β”œβ”€β”€ config.rs          # sentinel.toml loader
β”œβ”€β”€ cache.rs           # Atomic 15-minute local disk cache
β”œβ”€β”€ http.rs            # Shared ureq Keep-Alive HTTP agent (rustls)
β”œβ”€β”€ pool.rs            # Bounded 16-worker thread pool
β”œβ”€β”€ discover.rs        # Recursive project discovery
β”œβ”€β”€ osv.rs             # Google OSV batch vulnerability client
β”œβ”€β”€ collectors/        # 14 per-ecosystem collectors
β”œβ”€β”€ lockfiles/         # 12 native lockfile parsers (transitive OSV)
└── output/            # Compact Unicode table, icons & SARIF 2.1.0
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo build --release

πŸ“„ License

Licensed under the Apache License, Version 2.0 β€” see LICENSE for details.

About

πŸ›‘οΈ Fast, cross-platform Rust CLI for multi-ecosystem dependency, license, and OSV vulnerability scanning.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages