bearscan 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bearscan-0.3.0/CHANGELOG.md +131 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/PKG-INFO +57 -26
- {bearscan-0.2.0 → bearscan-0.3.0}/README.md +53 -25
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/README.md +5 -4
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/architecture.md +30 -21
- bearscan-0.3.0/docs/ci.md +104 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/docker.md +20 -13
- bearscan-0.3.0/docs/external-tools.md +205 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/installation.md +30 -6
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/kali-linux.md +20 -6
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/llm-triage.md +8 -3
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/output-format.md +29 -6
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/rules.md +30 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/schema/scan-run.schema.json +26 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/security-model.md +26 -3
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/troubleshooting.md +47 -2
- bearscan-0.3.0/docs/usage.md +232 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/pyproject.toml +10 -1
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/base.py +1 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/execution.py +10 -1
- bearscan-0.3.0/src/bearscan/adapters/nuclei.py +102 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/registry.py +3 -1
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/semgrep.py +10 -1
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/testssl.py +8 -9
- bearscan-0.3.0/src/bearscan/adapters/trivy.py +102 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/trufflehog.py +12 -3
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/web.py +2 -1
- bearscan-0.3.0/src/bearscan/agents/container.py +102 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/agents/orchestrator.py +50 -27
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/catalog/secrets.toml +1 -1
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/engine.py +1 -15
- bearscan-0.3.0/src/bearscan/checks/refine.py +64 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/cli/app.py +41 -7
- bearscan-0.3.0/src/bearscan/cli/audits.py +109 -0
- bearscan-0.3.0/src/bearscan/cli/bear.py +90 -0
- bearscan-0.3.0/src/bearscan/cli/ignore_command.py +78 -0
- bearscan-0.3.0/src/bearscan/cli/observer.py +66 -0
- bearscan-0.3.0/src/bearscan/cli/report_command.py +41 -0
- bearscan-0.3.0/src/bearscan/cli/update_command.py +51 -0
- bearscan-0.3.0/src/bearscan/core/ignore.py +86 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/models.py +6 -0
- bearscan-0.3.0/src/bearscan/core/progress.py +4 -0
- bearscan-0.3.0/src/bearscan/core/roles.py +41 -0
- bearscan-0.3.0/src/bearscan/core/store.py +48 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/installer/plan.py +27 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/installer/recipes.py +2 -0
- bearscan-0.3.0/src/bearscan/installer/self_install.py +38 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/installer/system.py +9 -1
- bearscan-0.3.0/src/bearscan/installer/versions.py +42 -0
- bearscan-0.3.0/src/bearscan/report/compliance.py +58 -0
- bearscan-0.3.0/src/bearscan/report/pdf.py +222 -0
- bearscan-0.3.0/src/bearscan/report/sarif.py +78 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/report/terminal.py +17 -3
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/report/theme.py +1 -0
- bearscan-0.3.0/src/bearscan/web/__init__.py +0 -0
- bearscan-0.3.0/src/bearscan/web/checks.py +94 -0
- bearscan-0.3.0/src/bearscan/web/crawl.py +146 -0
- bearscan-0.3.0/src/bearscan/web/exposure.py +73 -0
- bearscan-0.3.0/src/bearscan/web/headers.py +102 -0
- bearscan-0.3.0/src/bearscan/web/snapshot.py +65 -0
- bearscan-0.3.0/tests/e2e/fixture_site.py +83 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/e2e/kali_smoke.sh +18 -8
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/support.py +7 -0
- bearscan-0.3.0/tests/test_adapters_infra.py +150 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_adapters_web.py +2 -3
- bearscan-0.3.0/tests/test_ci_outputs.py +192 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_cli.py +7 -3
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_container.py +58 -9
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_engine.py +4 -2
- bearscan-0.3.0/tests/test_installer.py +253 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_orchestrator.py +14 -3
- bearscan-0.3.0/tests/test_progress.py +74 -0
- bearscan-0.3.0/tests/test_refine.py +187 -0
- bearscan-0.3.0/tests/test_report.py +87 -0
- bearscan-0.3.0/tests/test_web.py +187 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/uv.lock +327 -1
- bearscan-0.2.0/CHANGELOG.md +0 -75
- bearscan-0.2.0/docs/external-tools.md +0 -144
- bearscan-0.2.0/docs/usage.md +0 -129
- bearscan-0.2.0/src/bearscan/agents/container.py +0 -67
- bearscan-0.2.0/src/bearscan/cli/audits.py +0 -81
- bearscan-0.2.0/src/bearscan/cli/observer.py +0 -28
- bearscan-0.2.0/src/bearscan/core/store.py +0 -23
- bearscan-0.2.0/tests/test_installer.py +0 -121
- {bearscan-0.2.0 → bearscan-0.3.0}/.gitignore +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/LICENSE +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/assets/banner.jpg +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/assets/demo-scan-path.svg +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/docs/assets/demo-scan-url.svg +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/errors.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/gitleaks.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/mapping.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/osv.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/osv_schema.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/secrets.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/sslscan.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/standards.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/adapters/whatweb.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/agents/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/agents/prompts.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/agents/reviewer.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/builder.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/catalog/javascript.toml +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/catalog/llm.toml +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/catalog/python.toml +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/entropy.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/errors.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/files.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/jwt.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/rules.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/sources.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/checks/spans.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/cli/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/cli/setup_command.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/fingerprint.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/process.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/redaction.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/run.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/severity.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/core/standards.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/installer/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/installer/osv.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/base.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/claude_code.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/codex.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/errors.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/factory.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/http_client.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/json_extract.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/ollama.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/llm/openai_compat.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/src/bearscan/report/__init__.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_adapters_code.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_adapters_secrets.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_claude_code_provider.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_codex_provider.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_core.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_docs.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_execution.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_files.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_http_providers.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_llm_rules.py +0 -0
- {bearscan-0.2.0 → bearscan-0.3.0}/tests/test_reviewer.py +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
6
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2026-11-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Built-in `--url` checks that need no external tool: a headless Chromium (Playwright) maps up to 15
|
|
15
|
+
same-origin pages and the API calls they make, then bearscan checks security headers, cookie flags, CORS
|
|
16
|
+
(with a test `Origin`), sensitive fields such as `password_hash` in JSON responses (API3:2023), and secrets
|
|
17
|
+
in API responses, masked. Without Playwright it reads HTML links instead. Install it with
|
|
18
|
+
`bearscan[browser]` or `bearscan setup`.
|
|
19
|
+
- trivy for infrastructure-as-code misconfigurations (Dockerfiles, Kubernetes, Helm, Terraform,
|
|
20
|
+
CloudFormation) on `--path`, and nuclei with read-only exposure templates (`.env`, `.git/config`, and
|
|
21
|
+
similar) on `--url`. Both are installed by `bearscan setup` and shipped in the Kali image.
|
|
22
|
+
- `--sarif FILE` writes the open findings as SARIF 2.1.0 for GitHub code scanning, with
|
|
23
|
+
`security-severity` scores and stable fingerprints.
|
|
24
|
+
- `--fail-on SEVERITY` exits with code 3 when an open finding at or above that severity remains.
|
|
25
|
+
- A GitHub Action (`uses: cristhianzl/bearscan@v0.3.0`) that runs the Kali image on the checked-out
|
|
26
|
+
repository or a URL, writes SARIF, and fails on the chosen severity.
|
|
27
|
+
- `.bearscanignore` to accept findings per repository by fingerprint, rule, or path glob. Suppressed
|
|
28
|
+
findings stay in the JSON with `"suppressed": true` and are left out of the report, the review, SARIF,
|
|
29
|
+
and `--fail-on`. `bearscan ignore` writes the file, and `bearscan ignore --dismissed` records what the
|
|
30
|
+
reviewer called false positive in the last run. `--ignore-file` points to another file.
|
|
31
|
+
- `bearscan report --pdf FILE`: an executive PDF of a saved run with severity counts, top risks, OWASP Top 10
|
|
32
|
+
2025 and API/LLM/Agentic coverage, the findings, details of critical and high ones, the related ISO/IEC
|
|
33
|
+
27001:2022 and SOC 2 controls, and the methodology.
|
|
34
|
+
- `bearscan update` upgrades bearscan with the tool that installed it (uv, pipx, or pip) and checks that the
|
|
35
|
+
new version took; `--check` only reports.
|
|
36
|
+
- `--verify-secrets` lets trufflehog confirm candidate secrets with their providers; confirmed ones become
|
|
37
|
+
critical *Live secret confirmed by its provider* findings.
|
|
38
|
+
- `file_role`, `related_rules`, and `suppressed` fields on every finding.
|
|
39
|
+
- A live progress display: a walking bear, a description of the work that changes every few seconds, and the
|
|
40
|
+
real current stage with the elapsed time. It is hidden when the output is not a terminal.
|
|
41
|
+
- `bearscan scan --docker` streams each stage from inside the container (`Running gitleaks`,
|
|
42
|
+
`Running semgrep`, ...) to the progress display, and downloads the image first with its own message.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- Far fewer false positives before any LLM is involved:
|
|
47
|
+
- Findings on the same statement (same file and CWE within three lines) from several rules or tools are
|
|
48
|
+
merged into one, keeping the most severe and listing the others in `related_rules`.
|
|
49
|
+
- Findings in tests, migrations, fixtures, docs, and examples drop one severity level and show their role.
|
|
50
|
+
Secrets and vulnerable dependencies keep their severity anywhere.
|
|
51
|
+
- semgrep audit rules are reported as low, since they ask for a manual look rather than detect a flaw.
|
|
52
|
+
- Database URLs pointing at `localhost`, `127.0.0.1`, `0.0.0.0`, `[::1]`, or `host.docker.internal` are no
|
|
53
|
+
longer reported as leaked credentials.
|
|
54
|
+
- The reviewer sees production code first.
|
|
55
|
+
- testssl.sh header rows are no longer reported, because the built-in web checks cover headers on every URL
|
|
56
|
+
scan. TLS rows now carry CWE-326 by default.
|
|
57
|
+
- The Kali image now includes trivy, nuclei (with templates), Chromium, and Playwright. It is about 1 GB to
|
|
58
|
+
download and 3.7 GB on disk.
|
|
59
|
+
- `bearscan setup` also installs the browser for `--url`: Playwright in bearscan's environment, plus Kali's
|
|
60
|
+
`chromium` package or Playwright's Chromium download. A system Chromium is used automatically when
|
|
61
|
+
Playwright has no browser of its own; `BEARSCAN_CHROMIUM` picks one explicitly.
|
|
62
|
+
- `bearscan scan --docker` now says the scan runs in a local Kali container and names the image it downloads,
|
|
63
|
+
instead of "Scanning inside ghcr.io/...", which read as if the code were scanned on GitHub.
|
|
64
|
+
|
|
65
|
+
## [0.2.0] - 2026-11-29
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- `bearscan setup` installs the missing external tools: one `brew install` on macOS, and `apt-get`, `pipx`
|
|
70
|
+
(or `uv`), and a SHA-256-verified osv-scanner download on Kali, Debian, and Ubuntu. `--dry-run` only shows
|
|
71
|
+
the plan and `--yes` skips the confirmation.
|
|
72
|
+
- `bearscan scan --docker` runs every tool inside the official Kali image with the repository mounted
|
|
73
|
+
read-only, then triages the findings on the host with your own reviewer. `BEARSCAN_DOCKER_IMAGE` selects
|
|
74
|
+
another image.
|
|
75
|
+
- A Kali Linux image with bearscan and all seven tools, published to `ghcr.io/cristhianzl/bearscan` for
|
|
76
|
+
amd64 and arm64 on every release.
|
|
77
|
+
- An end-to-end workflow that runs every tool inside the image against real inputs on each change and every
|
|
78
|
+
week, to catch tools whose output format changes.
|
|
79
|
+
- Ten rules for LLM and AI agent applications: model output executed as code or rendered as raw HTML, agents
|
|
80
|
+
given shell or code interpreter tools, dangerous-code and unsafe-deserialization opt-ins, models loaded with
|
|
81
|
+
`trust_remote_code=True` or pickle, LLM SDKs and provider keys exposed to browsers, and user input placed in
|
|
82
|
+
system prompts.
|
|
83
|
+
- A `standards` field on every finding with the other OWASP lists it belongs to: API Security Top 10 2023,
|
|
84
|
+
Top 10 for LLM Applications 2025 and 2026, and Top 10 for Agentic Applications 2026. Tool findings get
|
|
85
|
+
labels from their CWE, and the report shows them next to the CWE and OWASP 2025 category.
|
|
86
|
+
|
|
87
|
+
## [0.1.2] - 2026-11-29
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
|
|
91
|
+
- `bearscan scan` without `--path` or `--url` now audits the current directory, so running it from inside a
|
|
92
|
+
repository is enough. Passing both options is still an error.
|
|
93
|
+
|
|
94
|
+
## [0.1.1] - 2026-11-29
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
- The PyPI project page now shows the banner, the demo, and working documentation links: the README uses
|
|
99
|
+
absolute URLs, and its pipeline diagram is plain text instead of Mermaid, which PyPI does not render.
|
|
100
|
+
|
|
101
|
+
## [0.1.0] - 2026-11-29
|
|
102
|
+
|
|
103
|
+
First public release.
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
|
|
107
|
+
- `bearscan scan --path` audits a local repository with 37 built-in rules for leaked secrets,
|
|
108
|
+
JavaScript/TypeScript, and Python, each mapped to CWE and OWASP Top 10 2025.
|
|
109
|
+
- Secret detection that masks values everywhere (`AKIA...[redacted:20]`), skips placeholders and
|
|
110
|
+
low-entropy strings, classifies Supabase JWTs (`service_role` is critical, `anon` is ignored), and
|
|
111
|
+
catches unquoted `KEY=value` credentials.
|
|
112
|
+
- LLM triage of every finding as *likely real*, *false positive*, or *uncertain*, with a confidence, a
|
|
113
|
+
rationale, counterevidence, and a fix. Backends: Claude Code CLI (default, runs headless with no
|
|
114
|
+
tools), Ollama, and any LiteLLM or OpenAI-compatible endpoint.
|
|
115
|
+
- Automatic use of external tools found on `PATH`: gitleaks and trufflehog for secrets in git history,
|
|
116
|
+
semgrep for AST-based analysis, and osv-scanner for vulnerable dependencies.
|
|
117
|
+
- `bearscan scan --url` for dev and staging URLs, using testssl.sh (or sslscan as a fallback) for TLS and
|
|
118
|
+
certificates, and whatweb for server version disclosure.
|
|
119
|
+
- One finding per secret across all tools, and semgrep results dropped when a built-in rule already
|
|
120
|
+
flags the same line and CWE.
|
|
121
|
+
- Rich terminal report, `--json` output, and a private JSON copy of every run in the user data
|
|
122
|
+
directory.
|
|
123
|
+
- Kali Linux support, including install instructions for every external tool.
|
|
124
|
+
- Published on PyPI: `pipx install bearscan`.
|
|
125
|
+
|
|
126
|
+
[Unreleased]: https://github.com/cristhianzl/bearscan/compare/v0.3.0...HEAD
|
|
127
|
+
[0.3.0]: https://github.com/cristhianzl/bearscan/compare/v0.2.0...v0.3.0
|
|
128
|
+
[0.2.0]: https://github.com/cristhianzl/bearscan/compare/v0.1.2...v0.2.0
|
|
129
|
+
[0.1.2]: https://github.com/cristhianzl/bearscan/compare/v0.1.1...v0.1.2
|
|
130
|
+
[0.1.1]: https://github.com/cristhianzl/bearscan/compare/v0.1.0...v0.1.1
|
|
131
|
+
[0.1.0]: https://github.com/cristhianzl/bearscan/releases/tag/v0.1.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bearscan
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Defensive AppSec scanner for code and staging environments you own, mapped to OWASP Top 10 2025 and triaged by an LLM.
|
|
5
5
|
Project-URL: Homepage, https://github.com/cristhianzl/bearscan
|
|
6
6
|
Project-URL: Documentation, https://github.com/cristhianzl/bearscan/tree/main/docs
|
|
@@ -27,8 +27,11 @@ Requires-Python: >=3.12
|
|
|
27
27
|
Requires-Dist: httpx>=0.27
|
|
28
28
|
Requires-Dist: platformdirs>=4.2
|
|
29
29
|
Requires-Dist: pydantic>=2.7
|
|
30
|
+
Requires-Dist: reportlab>=4.2
|
|
30
31
|
Requires-Dist: rich>=13.7
|
|
31
32
|
Requires-Dist: typer>=0.12
|
|
33
|
+
Provides-Extra: browser
|
|
34
|
+
Requires-Dist: playwright>=1.48; extra == 'browser'
|
|
32
35
|
Description-Content-Type: text/markdown
|
|
33
36
|
|
|
34
37
|
<p align="center">
|
|
@@ -37,7 +40,7 @@ Description-Content-Type: text/markdown
|
|
|
37
40
|
|
|
38
41
|
<p align="center">
|
|
39
42
|
<strong>Defensive AppSec scanner for the code and staging environments you own.</strong><br>
|
|
40
|
-
Secrets, insecure code, vulnerable dependencies, and
|
|
43
|
+
Secrets, insecure code, vulnerable dependencies, IaC, and live web exposure, mapped to OWASP and triaged by an LLM.
|
|
41
44
|
</p>
|
|
42
45
|
|
|
43
46
|
<p align="center">
|
|
@@ -58,9 +61,10 @@ Description-Content-Type: text/markdown
|
|
|
58
61
|
---
|
|
59
62
|
|
|
60
63
|
bearscan audits a repository or a staging URL with one command. It runs its own rules, drives the
|
|
61
|
-
open-source security tools already installed on your machine
|
|
62
|
-
|
|
63
|
-
your existing **Claude Code** or **Codex** login, or fully locally with **Ollama**.
|
|
64
|
+
open-source security tools already installed on your machine (or all of them from a Kali container), merges
|
|
65
|
+
everything into one report with CWE and OWASP labels, and asks an LLM to separate real problems from noise.
|
|
66
|
+
The reviewer runs on your existing **Claude Code** or **Codex** login, or fully locally with **Ollama**.
|
|
67
|
+
Results go to your terminal, JSON, SARIF for GitHub code scanning, or an executive PDF.
|
|
64
68
|
|
|
65
69
|
<p align="center">
|
|
66
70
|
<img src="https://raw.githubusercontent.com/cristhianzl/bearscan/main/docs/assets/demo-scan-path.svg" alt="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" width="900">
|
|
@@ -81,13 +85,23 @@ your existing **Claude Code** or **Codex** login, or fully locally with **Ollama
|
|
|
81
85
|
- **AI apps and agents.** Catches model output executed as code or rendered as HTML, agents with shell
|
|
82
86
|
tools, `trust_remote_code=True`, pickled models and vector stores, LLM keys shipped to browsers, and user
|
|
83
87
|
input in system prompts.
|
|
84
|
-
- **Vulnerable dependencies.** osv-scanner checks your lockfiles and names the version that fixes
|
|
85
|
-
advisory
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
- **Vulnerable dependencies and IaC.** osv-scanner checks your lockfiles and names the version that fixes
|
|
89
|
+
each advisory; trivy checks Dockerfiles, Kubernetes manifests, Helm charts, Terraform, and
|
|
90
|
+
CloudFormation.
|
|
91
|
+
- **Staging checks with a real browser.** `--url` maps the site with headless Chromium, records the API
|
|
92
|
+
calls each page makes, and checks security headers, cookie flags, CORS, and secrets or sensitive fields
|
|
93
|
+
(`password_hash`, tokens) in API responses. testssl.sh, whatweb, and nuclei's read-only exposure
|
|
94
|
+
templates add TLS, version disclosure, and exposed files such as `.env` and `.git/config`.
|
|
95
|
+
- **Less noise before any LLM.** The same statement flagged by several rules or tools is one finding;
|
|
96
|
+
tests, migrations, fixtures, docs, and examples drop a severity level; and a committed
|
|
97
|
+
[`.bearscanignore`](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md#cutting-noise) keeps
|
|
98
|
+
accepted findings quiet, with `bearscan ignore --dismissed` to accept what the reviewer dismissed.
|
|
88
99
|
- **Triage, not noise.** An [LLM reviewer](https://github.com/cristhianzl/bearscan/blob/main/docs/llm-triage.md) labels each finding *likely real*,
|
|
89
100
|
*false positive*, or *uncertain*, with a confidence, a rationale, and a fix. It can never change a
|
|
90
101
|
severity or hide a finding from the JSON.
|
|
102
|
+
- **Built for CI and audits.** `--sarif` for code scanning, `--fail-on high` for failing builds, a
|
|
103
|
+
[GitHub Action](https://github.com/cristhianzl/bearscan/blob/main/docs/ci.md), and `bearscan report --pdf`
|
|
104
|
+
with OWASP coverage and the related ISO 27001 and SOC 2 controls.
|
|
91
105
|
- **Everything in one command.** Every supported tool found on `PATH` is used automatically,
|
|
92
106
|
`bearscan setup` installs the missing ones (Homebrew on macOS, apt on [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md)),
|
|
93
107
|
and `bearscan scan --docker` runs all of them inside the official [Kali image](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) with
|
|
@@ -128,10 +142,12 @@ pipx install bearscan
|
|
|
128
142
|
uv tool install bearscan
|
|
129
143
|
```
|
|
130
144
|
|
|
131
|
-
Then add the external tools with one command, on macOS (Homebrew) or Kali,
|
|
145
|
+
Then add the external tools and the browser for `--url` with one command, on macOS (Homebrew) or Kali,
|
|
146
|
+
Debian, and Ubuntu (apt), and stay current with `bearscan update`:
|
|
132
147
|
|
|
133
148
|
```bash
|
|
134
149
|
bearscan setup
|
|
150
|
+
bearscan update
|
|
135
151
|
```
|
|
136
152
|
|
|
137
153
|
Prefer containers? `bearscan scan --docker` uses `ghcr.io/cristhianzl/bearscan`, a Kali image with every
|
|
@@ -147,9 +163,13 @@ bearscan scan --llm codex # triage with Codex
|
|
|
147
163
|
bearscan scan --llm ollama # triage with a local model
|
|
148
164
|
bearscan scan --no-review # deterministic checks only
|
|
149
165
|
bearscan scan --json > run.json # machine-readable output
|
|
150
|
-
bearscan scan --
|
|
166
|
+
bearscan scan --sarif out.sarif --fail-on high # CI: SARIF, and exit code 3 on high or critical
|
|
167
|
+
bearscan scan --url https://staging.example.com # browser crawl, headers, CORS, API exposure, TLS
|
|
151
168
|
bearscan scan --docker # every tool, inside the Kali image
|
|
169
|
+
bearscan ignore --dismissed # accept what the reviewer dismissed
|
|
170
|
+
bearscan report --pdf report.pdf # executive PDF of the last run
|
|
152
171
|
bearscan setup # install the missing tools
|
|
172
|
+
bearscan update # upgrade bearscan
|
|
153
173
|
```
|
|
154
174
|
|
|
155
175
|
| Option | Description |
|
|
@@ -160,6 +180,9 @@ bearscan setup # install the missing tools
|
|
|
160
180
|
| `--model`, `--llm-base-url` | Model and endpoint for the reviewer. |
|
|
161
181
|
| `--max-review N` | Most findings sent to the reviewer (default: 60). |
|
|
162
182
|
| `--json` | Print the run as JSON instead of the report. |
|
|
183
|
+
| `--sarif FILE` | Also write SARIF 2.1.0 for code scanning. |
|
|
184
|
+
| `--fail-on SEVERITY` | Exit with code 3 when an open finding is this severe or worse. |
|
|
185
|
+
| `--verify-secrets` | Let trufflehog confirm candidate secrets with their providers (sends them). |
|
|
163
186
|
| `--docker` | Run the tools inside the Kali image; the review still runs on your machine. |
|
|
164
187
|
|
|
165
188
|
Every option, environment variable, and exit code is in the [usage guide](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md).
|
|
@@ -170,9 +193,11 @@ Every option, environment variable, and exit code is in the [usage guide](https:
|
|
|
170
193
|
anything in `.gitignore`.
|
|
171
194
|
2. **Detect** with the built-in rules and every installed tool, then normalize each result to one severity
|
|
172
195
|
scale with CWE and OWASP Top 10 2025 labels.
|
|
173
|
-
3. **
|
|
174
|
-
|
|
175
|
-
|
|
196
|
+
3. **Refine:** one finding per secret and per statement, a severity step down outside production code,
|
|
197
|
+
and the `.bearscanignore` suppressions.
|
|
198
|
+
4. **Review** the open findings that have code context, production code first, with the LLM backend you
|
|
199
|
+
chose.
|
|
200
|
+
5. **Report** in the terminal, JSON, SARIF, or PDF, and save the run privately.
|
|
176
201
|
|
|
177
202
|
Deterministic checks decide what a finding is and how severe it is; the reviewer only adds a verdict and a
|
|
178
203
|
fix. See the [architecture](https://github.com/cristhianzl/bearscan/blob/main/docs/architecture.md) for the details.
|
|
@@ -184,10 +209,13 @@ fix. See the [architecture](https://github.com/cristhianzl/bearscan/blob/main/do
|
|
|
184
209
|
| [gitleaks](https://github.com/gitleaks/gitleaks) | `--path` | Secrets anywhere in git history |
|
|
185
210
|
| [trufflehog](https://github.com/trufflesecurity/trufflehog) | `--path` | Hundreds of extra secret detectors over git history |
|
|
186
211
|
| [semgrep](https://github.com/semgrep/semgrep) | `--path` | AST-based analysis with the `p/default` and `p/owasp-top-ten` rulesets |
|
|
212
|
+
| [trivy](https://github.com/aquasecurity/trivy) | `--path` | Misconfigurations in Dockerfiles, Kubernetes, Helm, Terraform, and CloudFormation |
|
|
187
213
|
| [osv-scanner](https://github.com/google/osv-scanner) | `--path` | Known CVEs in lockfiles and manifests |
|
|
188
|
-
| [
|
|
214
|
+
| [Playwright](https://github.com/microsoft/playwright-python) | `--url` | Browser crawl that maps pages and API calls for the built-in web checks |
|
|
215
|
+
| [testssl.sh](https://github.com/testssl/testssl.sh) | `--url` | Protocols, ciphers, certificates, TLS vulnerabilities |
|
|
189
216
|
| [sslscan](https://github.com/rbsec/sslscan) | `--url` | Fast TLS fallback when testssl.sh is unavailable |
|
|
190
217
|
| [whatweb](https://github.com/urbanadventurer/WhatWeb) | `--url` | Server and framework version disclosure |
|
|
218
|
+
| [nuclei](https://github.com/projectdiscovery/nuclei) | `--url` | Exposed files and misconfigurations, read-only templates only |
|
|
191
219
|
|
|
192
220
|
### LLM reviewers
|
|
193
221
|
|
|
@@ -204,25 +232,27 @@ text fenced as untrusted data. Details in [LLM triage](https://github.com/cristh
|
|
|
204
232
|
## Privacy and security
|
|
205
233
|
|
|
206
234
|
- The built-in scan sends nothing anywhere; `--no-review` with no tools installed is fully offline.
|
|
207
|
-
- trufflehog
|
|
208
|
-
code; osv-scanner sends only package names and versions.
|
|
235
|
+
- trufflehog verifies secrets with their providers only when you pass `--verify-secrets`; semgrep runs
|
|
236
|
+
with metrics off and never uploads code; osv-scanner sends only package names and versions.
|
|
237
|
+
- `--url` sends ordinary requests to the target: page loads, a few GET requests with a test `Origin`
|
|
238
|
+
header to check CORS, and nuclei's read-only templates, with no fuzzing, brute force, exploit payloads,
|
|
239
|
+
or out-of-band callbacks.
|
|
209
240
|
- Saved runs are written with `0600` permissions, because they map your weaknesses.
|
|
210
241
|
|
|
211
242
|
The full picture is in the [security model](https://github.com/cristhianzl/bearscan/blob/main/docs/security-model.md).
|
|
212
243
|
|
|
213
244
|
## Documentation
|
|
214
245
|
|
|
215
|
-
[Installation](https://github.com/cristhianzl/bearscan/blob/main/docs/installation.md) · [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md) · [Docker](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) · [Usage](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md) ·
|
|
246
|
+
[Installation](https://github.com/cristhianzl/bearscan/blob/main/docs/installation.md) · [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md) · [Docker](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) · [Usage](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md) · [CI](https://github.com/cristhianzl/bearscan/blob/main/docs/ci.md) ·
|
|
216
247
|
[LLM triage](https://github.com/cristhianzl/bearscan/blob/main/docs/llm-triage.md) · [External tools](https://github.com/cristhianzl/bearscan/blob/main/docs/external-tools.md) · [Rules](https://github.com/cristhianzl/bearscan/blob/main/docs/rules.md) ·
|
|
217
248
|
[Output format](https://github.com/cristhianzl/bearscan/blob/main/docs/output-format.md) · [Security model](https://github.com/cristhianzl/bearscan/blob/main/docs/security-model.md) ·
|
|
218
249
|
[Architecture](https://github.com/cristhianzl/bearscan/blob/main/docs/architecture.md) · [Troubleshooting](https://github.com/cristhianzl/bearscan/blob/main/docs/troubleshooting.md)
|
|
219
250
|
|
|
220
251
|
## Roadmap
|
|
221
252
|
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
- A pre-commit hook and a GitHub Action
|
|
253
|
+
- Authenticated `--url` crawling (login once, then scan behind it)
|
|
254
|
+
- `bearscan report --web` for a local dashboard
|
|
255
|
+
- A pre-commit hook
|
|
226
256
|
|
|
227
257
|
Ideas and votes are welcome in [issues](https://github.com/cristhianzl/bearscan/issues).
|
|
228
258
|
|
|
@@ -242,10 +272,11 @@ bearscan is a defensive tool. Scan only code and systems you own or are explicit
|
|
|
242
272
|
|
|
243
273
|
## Acknowledgements
|
|
244
274
|
|
|
245
|
-
bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, osv-scanner,
|
|
246
|
-
testssl.sh, sslscan, and
|
|
247
|
-
and [Typer](https://github.com/fastapi/typer),
|
|
248
|
-
|
|
275
|
+
bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, trivy, osv-scanner,
|
|
276
|
+
Playwright, testssl.sh, sslscan, whatweb, and nuclei. Its terminal output is built with
|
|
277
|
+
[Rich](https://github.com/Textualize/rich) and [Typer](https://github.com/fastapi/typer), its PDF with
|
|
278
|
+
[ReportLab](https://www.reportlab.com/), and its reviewer design borrows ideas from open-source AI security
|
|
279
|
+
agents such as Strix, Shannon, and PentAGI.
|
|
249
280
|
|
|
250
281
|
## License
|
|
251
282
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<strong>Defensive AppSec scanner for the code and staging environments you own.</strong><br>
|
|
7
|
-
Secrets, insecure code, vulnerable dependencies, and
|
|
7
|
+
Secrets, insecure code, vulnerable dependencies, IaC, and live web exposure, mapped to OWASP and triaged by an LLM.
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
bearscan audits a repository or a staging URL with one command. It runs its own rules, drives the
|
|
28
|
-
open-source security tools already installed on your machine
|
|
29
|
-
|
|
30
|
-
your existing **Claude Code** or **Codex** login, or fully locally with **Ollama**.
|
|
28
|
+
open-source security tools already installed on your machine (or all of them from a Kali container), merges
|
|
29
|
+
everything into one report with CWE and OWASP labels, and asks an LLM to separate real problems from noise.
|
|
30
|
+
The reviewer runs on your existing **Claude Code** or **Codex** login, or fully locally with **Ollama**.
|
|
31
|
+
Results go to your terminal, JSON, SARIF for GitHub code scanning, or an executive PDF.
|
|
31
32
|
|
|
32
33
|
<p align="center">
|
|
33
34
|
<img src="https://raw.githubusercontent.com/cristhianzl/bearscan/main/docs/assets/demo-scan-path.svg" alt="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" width="900">
|
|
@@ -48,13 +49,23 @@ your existing **Claude Code** or **Codex** login, or fully locally with **Ollama
|
|
|
48
49
|
- **AI apps and agents.** Catches model output executed as code or rendered as HTML, agents with shell
|
|
49
50
|
tools, `trust_remote_code=True`, pickled models and vector stores, LLM keys shipped to browsers, and user
|
|
50
51
|
input in system prompts.
|
|
51
|
-
- **Vulnerable dependencies.** osv-scanner checks your lockfiles and names the version that fixes
|
|
52
|
-
advisory
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
- **Vulnerable dependencies and IaC.** osv-scanner checks your lockfiles and names the version that fixes
|
|
53
|
+
each advisory; trivy checks Dockerfiles, Kubernetes manifests, Helm charts, Terraform, and
|
|
54
|
+
CloudFormation.
|
|
55
|
+
- **Staging checks with a real browser.** `--url` maps the site with headless Chromium, records the API
|
|
56
|
+
calls each page makes, and checks security headers, cookie flags, CORS, and secrets or sensitive fields
|
|
57
|
+
(`password_hash`, tokens) in API responses. testssl.sh, whatweb, and nuclei's read-only exposure
|
|
58
|
+
templates add TLS, version disclosure, and exposed files such as `.env` and `.git/config`.
|
|
59
|
+
- **Less noise before any LLM.** The same statement flagged by several rules or tools is one finding;
|
|
60
|
+
tests, migrations, fixtures, docs, and examples drop a severity level; and a committed
|
|
61
|
+
[`.bearscanignore`](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md#cutting-noise) keeps
|
|
62
|
+
accepted findings quiet, with `bearscan ignore --dismissed` to accept what the reviewer dismissed.
|
|
55
63
|
- **Triage, not noise.** An [LLM reviewer](https://github.com/cristhianzl/bearscan/blob/main/docs/llm-triage.md) labels each finding *likely real*,
|
|
56
64
|
*false positive*, or *uncertain*, with a confidence, a rationale, and a fix. It can never change a
|
|
57
65
|
severity or hide a finding from the JSON.
|
|
66
|
+
- **Built for CI and audits.** `--sarif` for code scanning, `--fail-on high` for failing builds, a
|
|
67
|
+
[GitHub Action](https://github.com/cristhianzl/bearscan/blob/main/docs/ci.md), and `bearscan report --pdf`
|
|
68
|
+
with OWASP coverage and the related ISO 27001 and SOC 2 controls.
|
|
58
69
|
- **Everything in one command.** Every supported tool found on `PATH` is used automatically,
|
|
59
70
|
`bearscan setup` installs the missing ones (Homebrew on macOS, apt on [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md)),
|
|
60
71
|
and `bearscan scan --docker` runs all of them inside the official [Kali image](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) with
|
|
@@ -95,10 +106,12 @@ pipx install bearscan
|
|
|
95
106
|
uv tool install bearscan
|
|
96
107
|
```
|
|
97
108
|
|
|
98
|
-
Then add the external tools with one command, on macOS (Homebrew) or Kali,
|
|
109
|
+
Then add the external tools and the browser for `--url` with one command, on macOS (Homebrew) or Kali,
|
|
110
|
+
Debian, and Ubuntu (apt), and stay current with `bearscan update`:
|
|
99
111
|
|
|
100
112
|
```bash
|
|
101
113
|
bearscan setup
|
|
114
|
+
bearscan update
|
|
102
115
|
```
|
|
103
116
|
|
|
104
117
|
Prefer containers? `bearscan scan --docker` uses `ghcr.io/cristhianzl/bearscan`, a Kali image with every
|
|
@@ -114,9 +127,13 @@ bearscan scan --llm codex # triage with Codex
|
|
|
114
127
|
bearscan scan --llm ollama # triage with a local model
|
|
115
128
|
bearscan scan --no-review # deterministic checks only
|
|
116
129
|
bearscan scan --json > run.json # machine-readable output
|
|
117
|
-
bearscan scan --
|
|
130
|
+
bearscan scan --sarif out.sarif --fail-on high # CI: SARIF, and exit code 3 on high or critical
|
|
131
|
+
bearscan scan --url https://staging.example.com # browser crawl, headers, CORS, API exposure, TLS
|
|
118
132
|
bearscan scan --docker # every tool, inside the Kali image
|
|
133
|
+
bearscan ignore --dismissed # accept what the reviewer dismissed
|
|
134
|
+
bearscan report --pdf report.pdf # executive PDF of the last run
|
|
119
135
|
bearscan setup # install the missing tools
|
|
136
|
+
bearscan update # upgrade bearscan
|
|
120
137
|
```
|
|
121
138
|
|
|
122
139
|
| Option | Description |
|
|
@@ -127,6 +144,9 @@ bearscan setup # install the missing tools
|
|
|
127
144
|
| `--model`, `--llm-base-url` | Model and endpoint for the reviewer. |
|
|
128
145
|
| `--max-review N` | Most findings sent to the reviewer (default: 60). |
|
|
129
146
|
| `--json` | Print the run as JSON instead of the report. |
|
|
147
|
+
| `--sarif FILE` | Also write SARIF 2.1.0 for code scanning. |
|
|
148
|
+
| `--fail-on SEVERITY` | Exit with code 3 when an open finding is this severe or worse. |
|
|
149
|
+
| `--verify-secrets` | Let trufflehog confirm candidate secrets with their providers (sends them). |
|
|
130
150
|
| `--docker` | Run the tools inside the Kali image; the review still runs on your machine. |
|
|
131
151
|
|
|
132
152
|
Every option, environment variable, and exit code is in the [usage guide](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md).
|
|
@@ -137,9 +157,11 @@ Every option, environment variable, and exit code is in the [usage guide](https:
|
|
|
137
157
|
anything in `.gitignore`.
|
|
138
158
|
2. **Detect** with the built-in rules and every installed tool, then normalize each result to one severity
|
|
139
159
|
scale with CWE and OWASP Top 10 2025 labels.
|
|
140
|
-
3. **
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
3. **Refine:** one finding per secret and per statement, a severity step down outside production code,
|
|
161
|
+
and the `.bearscanignore` suppressions.
|
|
162
|
+
4. **Review** the open findings that have code context, production code first, with the LLM backend you
|
|
163
|
+
chose.
|
|
164
|
+
5. **Report** in the terminal, JSON, SARIF, or PDF, and save the run privately.
|
|
143
165
|
|
|
144
166
|
Deterministic checks decide what a finding is and how severe it is; the reviewer only adds a verdict and a
|
|
145
167
|
fix. See the [architecture](https://github.com/cristhianzl/bearscan/blob/main/docs/architecture.md) for the details.
|
|
@@ -151,10 +173,13 @@ fix. See the [architecture](https://github.com/cristhianzl/bearscan/blob/main/do
|
|
|
151
173
|
| [gitleaks](https://github.com/gitleaks/gitleaks) | `--path` | Secrets anywhere in git history |
|
|
152
174
|
| [trufflehog](https://github.com/trufflesecurity/trufflehog) | `--path` | Hundreds of extra secret detectors over git history |
|
|
153
175
|
| [semgrep](https://github.com/semgrep/semgrep) | `--path` | AST-based analysis with the `p/default` and `p/owasp-top-ten` rulesets |
|
|
176
|
+
| [trivy](https://github.com/aquasecurity/trivy) | `--path` | Misconfigurations in Dockerfiles, Kubernetes, Helm, Terraform, and CloudFormation |
|
|
154
177
|
| [osv-scanner](https://github.com/google/osv-scanner) | `--path` | Known CVEs in lockfiles and manifests |
|
|
155
|
-
| [
|
|
178
|
+
| [Playwright](https://github.com/microsoft/playwright-python) | `--url` | Browser crawl that maps pages and API calls for the built-in web checks |
|
|
179
|
+
| [testssl.sh](https://github.com/testssl/testssl.sh) | `--url` | Protocols, ciphers, certificates, TLS vulnerabilities |
|
|
156
180
|
| [sslscan](https://github.com/rbsec/sslscan) | `--url` | Fast TLS fallback when testssl.sh is unavailable |
|
|
157
181
|
| [whatweb](https://github.com/urbanadventurer/WhatWeb) | `--url` | Server and framework version disclosure |
|
|
182
|
+
| [nuclei](https://github.com/projectdiscovery/nuclei) | `--url` | Exposed files and misconfigurations, read-only templates only |
|
|
158
183
|
|
|
159
184
|
### LLM reviewers
|
|
160
185
|
|
|
@@ -171,25 +196,27 @@ text fenced as untrusted data. Details in [LLM triage](https://github.com/cristh
|
|
|
171
196
|
## Privacy and security
|
|
172
197
|
|
|
173
198
|
- The built-in scan sends nothing anywhere; `--no-review` with no tools installed is fully offline.
|
|
174
|
-
- trufflehog
|
|
175
|
-
code; osv-scanner sends only package names and versions.
|
|
199
|
+
- trufflehog verifies secrets with their providers only when you pass `--verify-secrets`; semgrep runs
|
|
200
|
+
with metrics off and never uploads code; osv-scanner sends only package names and versions.
|
|
201
|
+
- `--url` sends ordinary requests to the target: page loads, a few GET requests with a test `Origin`
|
|
202
|
+
header to check CORS, and nuclei's read-only templates, with no fuzzing, brute force, exploit payloads,
|
|
203
|
+
or out-of-band callbacks.
|
|
176
204
|
- Saved runs are written with `0600` permissions, because they map your weaknesses.
|
|
177
205
|
|
|
178
206
|
The full picture is in the [security model](https://github.com/cristhianzl/bearscan/blob/main/docs/security-model.md).
|
|
179
207
|
|
|
180
208
|
## Documentation
|
|
181
209
|
|
|
182
|
-
[Installation](https://github.com/cristhianzl/bearscan/blob/main/docs/installation.md) · [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md) · [Docker](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) · [Usage](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md) ·
|
|
210
|
+
[Installation](https://github.com/cristhianzl/bearscan/blob/main/docs/installation.md) · [Kali Linux](https://github.com/cristhianzl/bearscan/blob/main/docs/kali-linux.md) · [Docker](https://github.com/cristhianzl/bearscan/blob/main/docs/docker.md) · [Usage](https://github.com/cristhianzl/bearscan/blob/main/docs/usage.md) · [CI](https://github.com/cristhianzl/bearscan/blob/main/docs/ci.md) ·
|
|
183
211
|
[LLM triage](https://github.com/cristhianzl/bearscan/blob/main/docs/llm-triage.md) · [External tools](https://github.com/cristhianzl/bearscan/blob/main/docs/external-tools.md) · [Rules](https://github.com/cristhianzl/bearscan/blob/main/docs/rules.md) ·
|
|
184
212
|
[Output format](https://github.com/cristhianzl/bearscan/blob/main/docs/output-format.md) · [Security model](https://github.com/cristhianzl/bearscan/blob/main/docs/security-model.md) ·
|
|
185
213
|
[Architecture](https://github.com/cristhianzl/bearscan/blob/main/docs/architecture.md) · [Troubleshooting](https://github.com/cristhianzl/bearscan/blob/main/docs/troubleshooting.md)
|
|
186
214
|
|
|
187
215
|
## Roadmap
|
|
188
216
|
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
- A pre-commit hook and a GitHub Action
|
|
217
|
+
- Authenticated `--url` crawling (login once, then scan behind it)
|
|
218
|
+
- `bearscan report --web` for a local dashboard
|
|
219
|
+
- A pre-commit hook
|
|
193
220
|
|
|
194
221
|
Ideas and votes are welcome in [issues](https://github.com/cristhianzl/bearscan/issues).
|
|
195
222
|
|
|
@@ -209,10 +236,11 @@ bearscan is a defensive tool. Scan only code and systems you own or are explicit
|
|
|
209
236
|
|
|
210
237
|
## Acknowledgements
|
|
211
238
|
|
|
212
|
-
bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, osv-scanner,
|
|
213
|
-
testssl.sh, sslscan, and
|
|
214
|
-
and [Typer](https://github.com/fastapi/typer),
|
|
215
|
-
|
|
239
|
+
bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, trivy, osv-scanner,
|
|
240
|
+
Playwright, testssl.sh, sslscan, whatweb, and nuclei. Its terminal output is built with
|
|
241
|
+
[Rich](https://github.com/Textualize/rich) and [Typer](https://github.com/fastapi/typer), its PDF with
|
|
242
|
+
[ReportLab](https://www.reportlab.com/), and its reviewer design borrows ideas from open-source AI security
|
|
243
|
+
agents such as Strix, Shannon, and PentAGI.
|
|
216
244
|
|
|
217
245
|
## License
|
|
218
246
|
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
| [Installation](installation.md) | Installing bearscan, an LLM reviewer, and the external tools on Linux and macOS. |
|
|
6
6
|
| [Kali Linux guide](kali-linux.md) | From a fresh Kali install to a full scan with every tool. |
|
|
7
7
|
| [Docker](docker.md) | `bearscan scan --docker` and the official Kali image with every tool installed. |
|
|
8
|
-
| [Usage](usage.md) | Commands, options, environment variables, the report, exit codes, and saved runs. |
|
|
8
|
+
| [Usage](usage.md) | Commands, options, environment variables, the report, cutting noise, the PDF report, updating, exit codes, and saved runs. |
|
|
9
|
+
| [CI and the GitHub Action](ci.md) | The GitHub Action, SARIF for code scanning, `--fail-on`, and other CI systems. |
|
|
9
10
|
| [LLM triage](llm-triage.md) | Claude Code, Codex, Ollama, and LiteLLM backends, verdicts, and what reaches the model. |
|
|
10
|
-
| [External tools](external-tools.md) |
|
|
11
|
-
| [Built-in rules](rules.md) | The 47 rules, their severities, and their CWE, OWASP Top 10 2025, API Security 2023, LLM 2025 and 2026, and Agentic 2026 mappings. |
|
|
12
|
-
| [Output format](output-format.md) | The JSON run format
|
|
11
|
+
| [External tools](external-tools.md) | The built-in web checks, and what gitleaks, trufflehog, semgrep, trivy, osv-scanner, testssl.sh, sslscan, whatweb, and nuclei add, and how. |
|
|
12
|
+
| [Built-in rules](rules.md) | The 47 rules, file roles and merged findings, their severities, and their CWE, OWASP Top 10 2025, API Security 2023, LLM 2025 and 2026, and Agentic 2026 mappings. |
|
|
13
|
+
| [Output format](output-format.md) | The JSON run format, its [schema](schema/scan-run.schema.json), and SARIF. |
|
|
13
14
|
| [Security model](security-model.md) | What leaves your machine, how secrets are handled, and how the reviewer is protected. |
|
|
14
15
|
| [Architecture](architecture.md) | The pipeline, the modules, and the design decisions behind them. |
|
|
15
16
|
| [Troubleshooting](troubleshooting.md) | Common errors and how to fix them. |
|
|
@@ -9,15 +9,17 @@ plain, testable Python.
|
|
|
9
9
|
```mermaid
|
|
10
10
|
flowchart LR
|
|
11
11
|
subgraph path ["bearscan scan --path"]
|
|
12
|
-
R[Built-in rules<br/>secrets, JS/TS, Python] --> M
|
|
13
|
-
T[Installed tools<br/>gitleaks, trufflehog,<br/>
|
|
14
|
-
M[
|
|
12
|
+
R[Built-in rules<br/>secrets, JS/TS, Python, LLM] --> M
|
|
13
|
+
T[Installed tools<br/>gitleaks, trufflehog, semgrep,<br/>trivy, osv-scanner] --> N[Normalize<br/>severity, CWE, OWASP] --> M
|
|
14
|
+
M[Refine<br/>merge, file roles] --> I[.bearscanignore] --> V[LLM reviewer<br/>Claude Code, Codex,<br/>Ollama, LiteLLM]
|
|
15
15
|
end
|
|
16
16
|
subgraph url ["bearscan scan --url"]
|
|
17
|
-
|
|
17
|
+
W[Built-in web checks<br/>Playwright crawl, headers,<br/>cookies, CORS, API exposure] --> M2
|
|
18
|
+
U[Installed tools<br/>testssl.sh or sslscan,<br/>whatweb, nuclei] --> N2[Normalize] --> M2[Merge] --> I2[.bearscanignore]
|
|
18
19
|
end
|
|
19
|
-
V --> O[Terminal report
|
|
20
|
-
|
|
20
|
+
V --> O[Terminal report, JSON,<br/>SARIF, saved run]
|
|
21
|
+
I2 --> O
|
|
22
|
+
O --> P[bearscan report --pdf]
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
For `--path`:
|
|
@@ -30,30 +32,36 @@ For `--path`:
|
|
|
30
32
|
3. **Run external tools.** Each installed tool runs in a private temporary directory with a timeout. Its
|
|
31
33
|
machine-readable output is parsed with typed models and converted into findings. A missing tool is
|
|
32
34
|
reported, a failed tool is warned about, and neither stops the run.
|
|
33
|
-
4. **
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
4. **Refine.** Findings flagged on the same statement (same file and CWE within three lines) by several
|
|
36
|
+
rules or tools become one, with the others in `related_rules`; each finding gets a file role, and
|
|
37
|
+
non-code roles drop one severity step (never for secrets or dependencies). Then findings are
|
|
38
|
+
deduplicated by fingerprint (secrets by file and value) and sorted.
|
|
39
|
+
5. **Suppress.** Entries in `.bearscanignore` mark matching findings as suppressed; they stay in the run.
|
|
40
|
+
6. **Review.** Open findings with code context go to the reviewer in batches of 20, production code first.
|
|
41
|
+
Dependency and suppressed findings skip it.
|
|
42
|
+
7. **Report.** The run is printed (or emitted as JSON), written as SARIF when asked, and saved with private
|
|
43
|
+
file permissions. `--fail-on` sets exit code 3 from the open findings.
|
|
38
44
|
|
|
39
|
-
For `--url`,
|
|
45
|
+
For `--url`, the built-in web checks map the site and inspect its responses first, then steps 3, 5, and 7
|
|
46
|
+
run with the URL tools; there is no review step.
|
|
40
47
|
|
|
41
48
|
With `--docker`, steps 1 to 4 run inside the official Kali image (`bearscan scan --no-review --json` with the
|
|
42
|
-
repository mounted read-only), and the host runs steps 5
|
|
43
|
-
the same
|
|
49
|
+
repository mounted read-only), and the host runs steps 5 to 7 on the returned findings. The suppress and
|
|
50
|
+
review stages are the same functions either way.
|
|
44
51
|
|
|
45
52
|
## Modules
|
|
46
53
|
|
|
47
54
|
| Package | Responsibility |
|
|
48
55
|
|---|---|
|
|
49
|
-
| `bearscan.cli` | Typer
|
|
56
|
+
| `bearscan.cli` | Typer commands (`scan`, `setup`, `ignore`, `report`, `update`), option validation, and the live progress display. |
|
|
50
57
|
| `bearscan.agents` | `orchestrator` runs the pipeline; `container` runs it inside the Kali image for `--docker`; `reviewer` batches findings for the LLM and applies the verdicts; `prompts` holds the reviewer instructions and JSON schema. |
|
|
51
|
-
| `bearscan.installer` | `bearscan setup`: install recipes per tool, the plan for the current system
|
|
52
|
-
| `bearscan.checks` | Rule loading and validation, the line engine, file collection, secret masking helpers, and the evidence reader that serves masked context to tool adapters. |
|
|
58
|
+
| `bearscan.installer` | `bearscan setup` and `bearscan update`: install recipes per tool, the plan for the current system (including the browser), the verified osv-scanner download, install-method detection, and the PyPI version check. |
|
|
59
|
+
| `bearscan.checks` | Rule loading and validation, the line engine, file collection, secret masking helpers, the refine stage (statement merging and file roles), and the evidence reader that serves masked context to tool adapters. |
|
|
53
60
|
| `bearscan.adapters` | One module per external tool, plus detection on `PATH` (`execution`), the registry of tools per target type, and shared mappings (OWASP 2021 to 2025, CWE, CVSS). |
|
|
61
|
+
| `bearscan.web` | The built-in `--url` checks: Playwright or HTML crawl, response snapshots, header, cookie, and CORS checks, and API data exposure. |
|
|
54
62
|
| `bearscan.llm` | Providers behind one small protocol: Claude Code, Codex, Ollama, and OpenAI-compatible endpoints. |
|
|
55
|
-
| `bearscan.report` | Rich terminal report and theme. |
|
|
56
|
-
| `bearscan.core` | Pydantic models (`Finding`, `ScanRun`, `ToolStatus`), fingerprints, redaction, process execution, and run storage. |
|
|
63
|
+
| `bearscan.report` | Rich terminal report and theme, SARIF writer, PDF report, and the ISO 27001 and SOC 2 mapping. |
|
|
64
|
+
| `bearscan.core` | Pydantic models (`Finding`, `ScanRun`, `ToolStatus`), file roles, the ignore file, fingerprints, redaction, process execution, and run storage. |
|
|
57
65
|
|
|
58
66
|
## Design decisions
|
|
59
67
|
|
|
@@ -74,5 +82,6 @@ the same function either way.
|
|
|
74
82
|
|
|
75
83
|
The suite runs without network access or external tools. Adapters are tested against output captured from
|
|
76
84
|
the real tools and trimmed to the relevant rows; providers are tested with recorded responses; the CLI is
|
|
77
|
-
tested end to end with Typer's runner
|
|
78
|
-
|
|
85
|
+
tested end to end with Typer's runner; the web checks run against a local insecure fixture site (and a real
|
|
86
|
+
Chromium when Playwright is installed). `tests/e2e/kali_smoke.sh` runs every tool from the Kali image
|
|
87
|
+
against real inputs, and the Docker workflow also runs the GitHub Action against that image.
|