Skip to main content

RepoReaver

Pre-clone repo security scanner. Answers one question: "Can this codebase safely be cloned, reviewed, built, or executed?"

CI License: MIT Python 3.8+ PyPI version GitHub stars Code style: black Security: reporeaver OpenSSF Best Practices

Star History Chart


Quick Start

pip install reporeaver
reporeaver scan ./suspicious-repo
reporeaver scan project.zip --html report.html --sarif results.sarif

What It Catches

Category Threats Detected
SVG XXE, obfuscated JS in <script>, inline event handlers, data URIs, foreign objects, javascript: URIs, base64 payloads, C2 callbacks
Hardcoded Secrets AWS keys, GitHub PATs, Slack tokens, private keys, JWTs, DB connection strings, OpenAI keys, 20+ provider patterns
Unicode Zero-width chars, bidi overrides (Trojan Source CVE-2021-42574), homoglyph attacks, invisible chars in filenames
Dependencies Typo-squatting (edit-distance vs 50+ packages), URL-resolved packages, lockfile tampering, dependency confusion, postinstall chains
Build Scripts setup.py cmdclass/os.system, Cargo.toml git deps/build.rs, Dockerfile FROM latest/`curl
CI/CD Unpinned actions, remote exec, secrets exposure, self-hosted runners, artifact chains, reusable workflows, cron persistence
Binary WASM dangerous imports (emscripten_run_script, network), YARA rules (reverse shell, webshell, PowerShell encoded)
Behavioral Network C2, code execution, persistence, data exfiltration patterns
File Deception Extension mismatches, polyglot files, SVG/script in image extensions
Obfuscation Base64/hex encoding, high entropy, layered encodings, JS string obfuscation

Installation

# Core (includes YAML policy support)
pip install reporeaver

# With dashboard server
pip install reporeaver[dashboard]

# Everything
pip install reporeaver[all]

# From source
git clone https://github.com/srinathsankara/reporeaver.git
cd reporeaver
pip install -e ".[all]"

Usage

Scan Commands

reporeaver scan ./repo                          # Basic scan
reporeaver scan ./repo --verbose                 # Include medium-severity findings
reporeaver scan archive.zip --html report.html   # Scan archive, generate HTML dashboard
reporeaver scan . --diff-only                    # Only scan files changed in this branch
reporeaver scan . --skip entropy,behavioral      # Disable specific analyzers
reporeaver scan . --no-cache                     # Disable content-based caching
reporeaver scan . --policy my-policy.yaml        # Custom policy file

Output Formats

reporeaver scan ./repo --json                    # Machine-readable JSON
reporeaver scan ./repo --sarif results.sarif     # SARIF (GitHub Security tab)
reporeaver scan ./repo --html report.html        # Self-contained HTML dashboard

View History

reporeaver history --last 20                     # Recent scans
reporeaver history --stats                       # Aggregate stats
reporeaver history --delete 3                    # Delete a scan record

Dashboard Server

reporeaver dashboard                             # Launch at http://127.0.0.1:9520

# With auth token
REPOREAVER_DASHBOARD_TOKEN=my-secret reporeaver dashboard

# Custom host/port
reporeaver dashboard --host 0.0.0.0 --port 9000

Pre-commit Hook

reporeaver init-precommit                        # Installs hook into .git/hooks/
# Runs on staged files before every commit. Bypass with: git commit --no-verify

Configuration Files

RepoReaver auto-discovers these config files in order:

  1. ./reporeaver.yaml
  2. ./.reporeaver.yaml
  3. ~/.config/reporeaver/config.yaml

Example reporeaver.yaml:

severity_threshold: high
skip_analyzers:
  - entropy
  - yara
max_size_mb: 5
policy: my-policy.yaml

GitHub Action

# .github/workflows/reporeaver.yml
name: RepoReaver Security Gate
on: [push, pull_request]
jobs:
  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: reporeaver/reporeaver@v1
        with:
          target: .
          severity-threshold: high
          diff-only: true
          github-token: ${{ github.token }}

The Action:

  • Fails CI if risk score exceeds threshold
  • Posts a GitHub Check Run with score and summary
  • Uploads SARIF to GitHub Security tab
  • Attaches HTML/JSON/SARIF as workflow artifacts

Docker

docker build -t reporeaver .
docker run --rm -v "${PWD}:/scan" reporeaver scan /scan
docker run --rm -v "${PWD}:/scan" reporeaver scan /scan --html /scan/report.html

Architecture

reporeaver/
├── cli.py                 # argparse CLI: scan, dashboard, history, init-precommit
├── engine.py              # Orchestrator: ingest -> analyze -> score -> output
├── models.py              # Finding, RiskScore, FileEntry, ScanResult
├── policy.py              # YAML policy engine (allow/block/severity)
├── config.py              # Auto-discover reporeaver.yaml
├── logging.py             # Structured logging to file + console
├── history.py             # SQLite scan history (for dashboard)
├── feeds.py               # OSV, MalwareBazaar, C2 threat feed integration
├── hooks.py               # Pre-commit hook installer
├── analyzers/             # 15 plugin-based detection modules
│   ├── base.py            # Plugin base class + registry
│   ├── svg_analyzer.py, unicode_analyzer.py, secrets_analyzer.py, ...
├── deobfuscation/         # Unicode, encoding, JS deobfuscation
├── ingest/                # File, directory, archive (recursive) ingest
├── output/                # Report, SARIF, HTML dashboard
├── ui/                    # FastAPI dashboard server
└── utils/                 # MIME detection, sandbox

Security Model

  • Never executes repo code on host — all analysis is static
  • Offline by default — threat feeds are opt-in, cached locally
  • Sandboxed extraction — archives extracted to isolated temp dirs
  • No shell injection — all subprocess.run() calls use list form, never shell=True
  • Safe YAML — uses yaml.safe_load(), not yaml.load()
  • Minimal dependencies — core requires only pyyaml

Exit Codes

Code Meaning
0 Pass — risk score below threshold (no critical/high findings)
1 Fail — risk score >= 7.0 or policy violations found

Development

git clone https://github.com/srinathsankara/reporeaver.git
cd reporeaver
pip install -e ".[dev]"
python -m pytest tests/ -v
python -m reporeaver scan ./tests/fixtures

Contributing

See CONTRIBUTING.md. All contributions welcome — bugs, features, docs, tests.

License

MIT. See LICENSE.

Related Projects

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reporeaver-0.2.0.tar.gz (78.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reporeaver-0.2.0-py3-none-any.whl (81.7 kB view details)

Uploaded Python 3

File details

Details for the file reporeaver-0.2.0.tar.gz.

File metadata

  • Download URL: reporeaver-0.2.0.tar.gz
  • Upload date:
  • Size: 78.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for reporeaver-0.2.0.tar.gz
Algorithm Hash digest
SHA256 24fbdf4ae07da3e6b5ff1d310ee2219dddd479bd386191795d85e7d290998fcf
MD5 a3b12007aa6aafb28d0c49f4a579407c
BLAKE2b-256 6e9083f46665946b412117bfb15ae4e97d8a065e3472d6e8395c30a7d4183593

See more details on using hashes here.

File details

Details for the file reporeaver-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: reporeaver-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 81.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for reporeaver-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 960966e709357c4be83efd7c558373a7218f4b18b02b549d8795c9099dd31ed3
MD5 76c51f64f0f811d63f746c1e38ab1f61
BLAKE2b-256 2fc080512440c17b42cb8654d9cc37d1c39281dc705cab6199906ac698841294

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page