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.
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.
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).
- Reads your code like a security engineer. Deep analysis maps every route (FastAPI, Flask, Express, Next.js, Supabase Edge Functions) with its full URL, its guards, and the functions it calls across files, then has the reviewer trace each handler for missing ownership checks (IDOR), missing authentication, injection, SSRF, and logic flaws that line-based rules miss. Every finding must quote the exact line it is about, or bearscan discards it, and comes with counterevidence, a fix, and the test that proves it.
- 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.
--urlmaps 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.envand.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
.bearscanignorekeeps accepted findings quiet, withbearscan ignore --dismissedto 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.
--sariffor code scanning,--fail-on highfor failing builds, a GitHub Action, andbearscan report --pdfwith OWASP coverage and the related ISO 27001 and SOC 2 controls. - Everything in one command. Every supported tool found on
PATHis used automatically,bearscan setupinstalls the missing ones (Homebrew on macOS, apt on Kali Linux), andbearscan scan --dockerruns 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
-
Install bearscan (Python 3.12+):
pipx install bearscan
-
Scan the repository you are in. Without a reviewer installed, add
--no-review:cd my-repo bearscan scan
-
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, deep analysis and triage
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 --deep-budget 60 # deep analysis over more of a large application
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). |
--deep/--no-deep, --deep-budget N |
Deep analysis of routes and auth code (default: on, 20 units). |
--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
- Collect the files git tracks (or walk the tree outside git), skipping binaries, lockfiles, and
anything in
.gitignore. - 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.
- Refine: one finding per secret and per statement, a severity step down outside production code,
and the
.bearscanignoresuppressions. - Review with the LLM backend you chose: deep analysis reads every route, the code it calls, and its guards to find what rules miss, and triage labels the open findings, production code first.
- Report in the terminal, JSON, SARIF, or PDF, and save the run privately.
For rule and tool findings, deterministic checks decide what a finding is and how severe it is, and the reviewer only adds a verdict and a fix. Deep analysis findings come from the reviewer, but each must quote the exact line it is about, or bearscan discards it. 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-reviewwith 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. --urlsends ordinary requests to the target: page loads, a few GET requests with a testOriginheader 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
0600permissions, 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
--urlcrawling (login once, then scan behind it) bearscan report --webfor 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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bearscan-0.4.0.tar.gz | 394.2 kB | Without provenance | Details for bearscan-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bearscan-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for bearscan-0.4.0-py3-none-any.whl |
Total release size: 526.8 kB
Release files / bearscan-0.4.0.tar.gz
| Download URL | bearscan-0.4.0.tar.gz |
|---|---|
| Size | 394.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aed56d4d116c756fa57b449ae6a89ec95249f44027478bbe92457df221e0befc
|
|
BLAKE2b-256 checksum How to use checksums |
0066976d6205e98559397099f84d26ff1abf2c87dc013ecf69c92bbf45ac7939
|
| 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.4.0-py3-none-any.whl
| Download URL | bearscan-0.4.0-py3-none-any.whl |
|---|---|
| Size | 132.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91dbf8af67c074fc23f3558bbaf4937395d386896a594d2e95ecd72f078f26a0
|
|
BLAKE2b-256 checksum How to use checksums |
d4ae8a8b5544cfdf3c5eb421ff86a107f62b479daf953568dbb080e330717f39
|
| 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.4.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.