Skip to main content

bearscan

Defensive AppSec scanner for the code and staging environments you own.
Secrets, insecure code, vulnerable dependencies, IaC, and live web exposure, mapped to OWASP and triaged by an LLM.

CI PyPI Python 3.12 | 3.13 | 3.14 OWASP Top 10 2025 License: Apache-2.0

Quick start · Documentation · Kali Linux guide · Changelog


bearscan audits a repository or a staging URL with one command. It runs its own rules, drives the open-source security tools already installed on your machine (or all of them from a Kali container), merges everything into one report with CWE and OWASP labels, and asks an LLM to separate real problems from noise. The reviewer runs on your existing Claude Code or Codex login, or fully locally with Ollama. Results go to your terminal, JSON, SARIF for GitHub code scanning, or an executive PDF.

bearscan terminal report: summary panel, findings table with LLM verdicts, and detail panels for a leaked AWS key and a Stripe key in git history

Real output: a demo repository scanned on Kali Linux with all four code tools installed, triaged by Claude Code.

Highlights

  • Secrets, now and in history. 15 secret detectors with masking everywhere, plus gitleaks and trufflehog to find keys in commits you deleted long ago. A key found by several tools is reported once.
  • Mapped to every relevant OWASP list. 47 built-in rules for secrets, JavaScript/TypeScript, Python, and LLM and AI agent applications, plus semgrep's security rulesets. Each finding carries its CWE, its OWASP Top 10 2025 category, and, where it applies, the OWASP API Security Top 10 2023, LLM Top 10 2025 and 2026, and Agentic Top 10 2026 labels (coverage).
  • AI apps and agents. Catches model output executed as code or rendered as HTML, agents with shell tools, trust_remote_code=True, pickled models and vector stores, LLM keys shipped to browsers, and user input in system prompts.
  • Vulnerable dependencies and IaC. osv-scanner checks your lockfiles and names the version that fixes each advisory; trivy checks Dockerfiles, Kubernetes manifests, Helm charts, Terraform, and CloudFormation.
  • Staging checks with a real browser. --url maps the site with headless Chromium, records the API calls each page makes, and checks security headers, cookie flags, CORS, and secrets or sensitive fields (password_hash, tokens) in API responses. testssl.sh, whatweb, and nuclei's read-only exposure templates add TLS, version disclosure, and exposed files such as .env and .git/config.
  • Less noise before any LLM. The same statement flagged by several rules or tools is one finding; tests, migrations, fixtures, docs, and examples drop a severity level; and a committed .bearscanignore keeps accepted findings quiet, with bearscan ignore --dismissed to accept what the reviewer dismissed.
  • Triage, not noise. An LLM reviewer labels each finding likely real, false positive, or uncertain, with a confidence, a rationale, and a fix. It can never change a severity or hide a finding from the JSON.
  • Built for CI and audits. --sarif for code scanning, --fail-on high for failing builds, a GitHub Action, and bearscan report --pdf with OWASP coverage and the related ISO 27001 and SOC 2 controls.
  • Everything in one command. Every supported tool found on PATH is used automatically, bearscan setup installs the missing ones (Homebrew on macOS, apt on Kali Linux), and bearscan scan --docker runs all of them inside the official Kali image with nothing to install but Docker.
  • Private by design. Secrets are masked before anything is printed, saved, or sent, and you can see exactly what leaves your machine.

Quick start

  1. Install bearscan (Python 3.12+):

    pipx install bearscan
    
  2. Scan the repository you are in. Without a reviewer installed, add --no-review:

    cd my-repo
    bearscan scan
    
  3. Go full: let bearscan install the external tools for git history, semgrep, dependency, and TLS checks, or run them all from the Kali image instead:

    bearscan setup             # installs what is missing, after asking
    bearscan scan              # now with every tool
    
    bearscan scan --docker     # or: no installs, every tool runs inside Kali
    

Installation

pipx install bearscan
# or
uv tool install bearscan

Then add the external tools and the browser for --url with one command, on macOS (Homebrew) or Kali, Debian, and Ubuntu (apt), and stay current with bearscan update:

bearscan setup
bearscan update

Prefer containers? bearscan scan --docker uses ghcr.io/cristhianzl/bearscan, a Kali image with every tool, for amd64 and arm64. Manual installs, reviewers, and upgrades are covered in the installation guide.

Usage

bearscan scan                                      # scan the current directory, triage with Claude Code
bearscan scan --path ./my-repo                     # scan another repository
bearscan scan --llm codex                          # triage with Codex
bearscan scan --llm ollama                         # triage with a local model
bearscan scan --no-review                          # deterministic checks only
bearscan scan --json > run.json                    # machine-readable output
bearscan scan --sarif out.sarif --fail-on high     # CI: SARIF, and exit code 3 on high or critical
bearscan scan --url https://staging.example.com    # browser crawl, headers, CORS, API exposure, TLS
bearscan scan --docker                             # every tool, inside the Kali image
bearscan ignore --dismissed                        # accept what the reviewer dismissed
bearscan report --pdf report.pdf                   # executive PDF of the last run
bearscan setup                                     # install the missing tools
bearscan update                                    # upgrade bearscan
Option Description
--path DIR / --url URL What to scan: a repository (default: the current directory) or a URL.
--review / --no-review Triage findings with an LLM (default: on).
--llm claude-code (default), codex, ollama, or litellm.
--model, --llm-base-url Model and endpoint for the reviewer.
--max-review N Most findings sent to the reviewer (default: 60).
--json Print the run as JSON instead of the report.
--sarif FILE Also write SARIF 2.1.0 for code scanning.
--fail-on SEVERITY Exit with code 3 when an open finding is this severe or worse.
--verify-secrets Let trufflehog confirm candidate secrets with their providers (sends them).
--docker Run the tools inside the Kali image; the review still runs on your machine.

Every option, environment variable, and exit code is in the usage guide.

How it works

  1. Collect the files git tracks (or walk the tree outside git), skipping binaries, lockfiles, and anything in .gitignore.
  2. Detect with the built-in rules and every installed tool, then normalize each result to one severity scale with CWE and OWASP Top 10 2025 labels.
  3. Refine: one finding per secret and per statement, a severity step down outside production code, and the .bearscanignore suppressions.
  4. Review the open findings that have code context, production code first, with the LLM backend you chose.
  5. Report in the terminal, JSON, SARIF, or PDF, and save the run privately.

Deterministic checks decide what a finding is and how severe it is; the reviewer only adds a verdict and a fix. See the architecture for the details.

External tools

Tool Target Adds
gitleaks --path Secrets anywhere in git history
trufflehog --path Hundreds of extra secret detectors over git history
semgrep --path AST-based analysis with the p/default and p/owasp-top-ten rulesets
trivy --path Misconfigurations in Dockerfiles, Kubernetes, Helm, Terraform, and CloudFormation
osv-scanner --path Known CVEs in lockfiles and manifests
Playwright --url Browser crawl that maps pages and API calls for the built-in web checks
testssl.sh --url Protocols, ciphers, certificates, TLS vulnerabilities
sslscan --url Fast TLS fallback when testssl.sh is unavailable
whatweb --url Server and framework version disclosure
nuclei --url Exposed files and misconfigurations, read-only templates only

LLM reviewers

--llm Runs on How bearscan calls it
claude-code your Claude Code login Headless, no tools, restricted mode, empty working directory
codex your Codex login codex exec in a read-only sandbox, shell and web search off
ollama your machine Local API with a JSON schema, temperature 0
litellm any OpenAI-compatible endpoint Chat completions with a JSON schema

Only the flagged line and two lines of context on each side are sent, with secrets masked and repository text fenced as untrusted data. Details in LLM triage.

Privacy and security

  • The built-in scan sends nothing anywhere; --no-review with no tools installed is fully offline.
  • trufflehog verifies secrets with their providers only when you pass --verify-secrets; semgrep runs with metrics off and never uploads code; osv-scanner sends only package names and versions.
  • --url sends ordinary requests to the target: page loads, a few GET requests with a test Origin header to check CORS, and nuclei's read-only templates, with no fuzzing, brute force, exploit payloads, or out-of-band callbacks.
  • Saved runs are written with 0600 permissions, because they map your weaknesses.

The full picture is in the security model.

Documentation

Installation · Kali Linux · Docker · Usage · CI · LLM triage · External tools · Rules · Output format · Security model · Architecture · Troubleshooting

Roadmap

  • Authenticated --url crawling (login once, then scan behind it)
  • bearscan report --web for a local dashboard
  • A pre-commit hook

Ideas and votes are welcome in issues.

Contributing

Contributions are welcome, from rule reports to new tool adapters. Read CONTRIBUTING.md to set up the project, and follow the Code of Conduct.

Security

Found a vulnerability in bearscan itself? Please report it privately as described in SECURITY.md.

Responsible use

bearscan is a defensive tool. Scan only code and systems you own or are explicitly authorized to test.

Acknowledgements

bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, trivy, osv-scanner, Playwright, testssl.sh, sslscan, whatweb, and nuclei. Its terminal output is built with Rich and Typer, its PDF with ReportLab, and its reviewer design borrows ideas from open-source AI security agents such as Strix, Shannon, and PentAGI.

License

Licensed under the Apache License 2.0.

Metadata

Release files for bearscan 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bearscan 0.3.0
File Size Uploaded Provenance Actions
bearscan-0.3.0.tar.gz 363.3 kB Without provenance Details for bearscan-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bearscan 0.3.0
File Interpreter ABI Platform Actions
bearscan-0.3.0-py3-none-any.whl Python 3 none any Details for bearscan-0.3.0-py3-none-any.whl

Total release size: 470.3 kB

Release files / bearscan-0.3.0.tar.gz

Download URL bearscan-0.3.0.tar.gz
Size 363.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe82a2d3eef5a62d973cdf85a169fe267ef66f3641af6a9b5ea698e0fcbc6be
BLAKE2b-256 checksum
How to use checksums
18b6b9bc5b655f018850af49e82180751248f84aa50b2eed6dad00a9c4dc949b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bearscan-0.3.0-py3-none-any.whl

Download URL bearscan-0.3.0-py3-none-any.whl
Size 107.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42d901418e10e5c08be4a8add8ed469bd05f0d69264cba926f49dc550d17ba60
BLAKE2b-256 checksum
How to use checksums
35ada5b93f61db1cf887cefde475d8042d05deb51cd5efba945bcda6d654dda0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bearscan 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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