ohaswin/pyscan
关于
python dependency vulnerability scanner, written in Rust.
安全与隐私实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Pyscan
Pyscan is a highly concurrent vulnerability scanner written in Rust. It automatically traverses your Python project, extracts dependencies across various packaging formats, and cross-references them against the Open Source Vulnerabilities (OSV) database in a single asynchronous batch request.
Pyscan was engineered to solve the performance and memory bottlenecks of traditional Python-based security tools:
- Performance Gains: Achieves up to a 5.25x speedup against industry-standard tools like
pip-auditandsafetyon medium to large datasets. Pyscan's runtime operates on an $O(\text{vulns})$ time complexity model, execution time scales with the number of vulnerabilities found, not the number of dependencies you have. - Flat Memory Footprint: Pyscan's memory usage stays completely flat (~45MB) whether you're scanning 15 dependencies or 700+ dependencies. Pretty solid for memory-constrained CI/CD pipelines.
- Universal Support: Automatically resolves and extracts dependencies from SBOMs (CycloneDX, SPDX),
uv.lock,requirements.txt,pyproject.toml(Poetry, Hatch, PDM, Flit), or dynamically by parsing your raw.pysource code. - Reachability Analysis: Pyscan goes beyond static manifest parsing. It uses heuristics to scan your source code, locating and highlighting exactly where a vulnerable dependency is imported, providing instant context for remediation.
Read the deep-dive in Benchmarks Report.
Installation
You can install Pyscan via pipx, pip (compiled Python wheel) or cargo (native Rust binary):
# via pipx (recommended) (Note the "-rs" suffix)
pipx install pyscan-rs
# via pip (Note the "-rs" suffix)
pip install pyscan-rs
# via Cargo
cargo install pyscan
Usage
Simply run pyscan in your project's root directory, or point it to a specific source folder:
# Scan the current directory
pyscan
# Scan a specific directory
pyscan -d path/to/src
Dependency Resolution Precedence
If multiple source files are present, Pyscan extracts dependencies following this priority chain:
- SBOMs (
bom.json,spdx.json) uv.lockrequirements.txtpyproject.toml- Raw Source Code (
.py)
Pyscan will fall back to querying PyPI for the latest version if a dependency is found without a strictly pinned version, though adhering to PEP-508 syntax is highly recommended.
Building & Architecture
Pyscan requires a Rust toolchain >= v1.70 and leverages asynchronous networking via reqwest and tokio to parallelize OSV queries and maximize throughput. If you're interested in how the parser and scanner are structured, check out theArchitecture Overview.
Disclaimer
Pyscan is a highly optimized tool, but it hasn't been battle-hardened across every edge case yet. It does not guarantee your code is 100% safe from all vectors. I highly recommend using a layered security approach alongside tools like Dependabot, pip-audit, or Trivy. PRs and issues are warmly welcomed!
Roadmap (As of April 2026)
- Add cyclonedx and SPDX SBOM support.
- Persistent state representation of a project's security posture.
- Graphical DAG analysis of transitive dependencies.
- Improved reachability analysis for deep-nested imports.
Donate
I started this project when I was a broke high school student, and now I'm a broke college student. If Pyscan has saved your CI/CD pipelines some precious time and RAM, consider buying me a coffee:
探索相关项目
加载中…