bearscan 0.1.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.
Files changed (96) hide show
  1. bearscan-0.1.0/.gitignore +17 -0
  2. bearscan-0.1.0/CHANGELOG.md +36 -0
  3. bearscan-0.1.0/LICENSE +202 -0
  4. bearscan-0.1.0/PKG-INFO +239 -0
  5. bearscan-0.1.0/README.md +206 -0
  6. bearscan-0.1.0/docs/README.md +16 -0
  7. bearscan-0.1.0/docs/architecture.md +72 -0
  8. bearscan-0.1.0/docs/assets/banner.jpg +0 -0
  9. bearscan-0.1.0/docs/assets/demo-scan-path.svg +255 -0
  10. bearscan-0.1.0/docs/assets/demo-scan-url.svg +250 -0
  11. bearscan-0.1.0/docs/external-tools.md +135 -0
  12. bearscan-0.1.0/docs/installation.md +112 -0
  13. bearscan-0.1.0/docs/kali-linux.md +85 -0
  14. bearscan-0.1.0/docs/llm-triage.md +104 -0
  15. bearscan-0.1.0/docs/output-format.md +115 -0
  16. bearscan-0.1.0/docs/rules.md +124 -0
  17. bearscan-0.1.0/docs/schema/scan-run.schema.json +335 -0
  18. bearscan-0.1.0/docs/security-model.md +92 -0
  19. bearscan-0.1.0/docs/troubleshooting.md +69 -0
  20. bearscan-0.1.0/docs/usage.md +115 -0
  21. bearscan-0.1.0/pyproject.toml +87 -0
  22. bearscan-0.1.0/src/bearscan/__init__.py +6 -0
  23. bearscan-0.1.0/src/bearscan/adapters/__init__.py +0 -0
  24. bearscan-0.1.0/src/bearscan/adapters/base.py +91 -0
  25. bearscan-0.1.0/src/bearscan/adapters/errors.py +6 -0
  26. bearscan-0.1.0/src/bearscan/adapters/execution.py +95 -0
  27. bearscan-0.1.0/src/bearscan/adapters/gitleaks.py +78 -0
  28. bearscan-0.1.0/src/bearscan/adapters/mapping.py +65 -0
  29. bearscan-0.1.0/src/bearscan/adapters/osv.py +116 -0
  30. bearscan-0.1.0/src/bearscan/adapters/osv_schema.py +31 -0
  31. bearscan-0.1.0/src/bearscan/adapters/registry.py +15 -0
  32. bearscan-0.1.0/src/bearscan/adapters/secrets.py +58 -0
  33. bearscan-0.1.0/src/bearscan/adapters/semgrep.py +119 -0
  34. bearscan-0.1.0/src/bearscan/adapters/sslscan.py +158 -0
  35. bearscan-0.1.0/src/bearscan/adapters/testssl.py +106 -0
  36. bearscan-0.1.0/src/bearscan/adapters/trufflehog.py +62 -0
  37. bearscan-0.1.0/src/bearscan/adapters/web.py +60 -0
  38. bearscan-0.1.0/src/bearscan/adapters/whatweb.py +85 -0
  39. bearscan-0.1.0/src/bearscan/agents/__init__.py +0 -0
  40. bearscan-0.1.0/src/bearscan/agents/orchestrator.py +125 -0
  41. bearscan-0.1.0/src/bearscan/agents/prompts.py +81 -0
  42. bearscan-0.1.0/src/bearscan/agents/reviewer.py +128 -0
  43. bearscan-0.1.0/src/bearscan/checks/__init__.py +0 -0
  44. bearscan-0.1.0/src/bearscan/checks/builder.py +68 -0
  45. bearscan-0.1.0/src/bearscan/checks/catalog/javascript.toml +125 -0
  46. bearscan-0.1.0/src/bearscan/checks/catalog/python.toml +124 -0
  47. bearscan-0.1.0/src/bearscan/checks/catalog/secrets.toml +174 -0
  48. bearscan-0.1.0/src/bearscan/checks/engine.py +75 -0
  49. bearscan-0.1.0/src/bearscan/checks/entropy.py +9 -0
  50. bearscan-0.1.0/src/bearscan/checks/errors.py +6 -0
  51. bearscan-0.1.0/src/bearscan/checks/files.py +142 -0
  52. bearscan-0.1.0/src/bearscan/checks/jwt.py +32 -0
  53. bearscan-0.1.0/src/bearscan/checks/rules.py +80 -0
  54. bearscan-0.1.0/src/bearscan/checks/sources.py +37 -0
  55. bearscan-0.1.0/src/bearscan/checks/spans.py +22 -0
  56. bearscan-0.1.0/src/bearscan/cli/__init__.py +0 -0
  57. bearscan-0.1.0/src/bearscan/cli/app.py +92 -0
  58. bearscan-0.1.0/src/bearscan/cli/audits.py +47 -0
  59. bearscan-0.1.0/src/bearscan/cli/observer.py +28 -0
  60. bearscan-0.1.0/src/bearscan/core/__init__.py +0 -0
  61. bearscan-0.1.0/src/bearscan/core/fingerprint.py +17 -0
  62. bearscan-0.1.0/src/bearscan/core/models.py +46 -0
  63. bearscan-0.1.0/src/bearscan/core/process.py +22 -0
  64. bearscan-0.1.0/src/bearscan/core/redaction.py +37 -0
  65. bearscan-0.1.0/src/bearscan/core/run.py +29 -0
  66. bearscan-0.1.0/src/bearscan/core/severity.py +19 -0
  67. bearscan-0.1.0/src/bearscan/core/store.py +23 -0
  68. bearscan-0.1.0/src/bearscan/llm/__init__.py +0 -0
  69. bearscan-0.1.0/src/bearscan/llm/base.py +27 -0
  70. bearscan-0.1.0/src/bearscan/llm/claude_code.py +118 -0
  71. bearscan-0.1.0/src/bearscan/llm/codex.py +110 -0
  72. bearscan-0.1.0/src/bearscan/llm/errors.py +14 -0
  73. bearscan-0.1.0/src/bearscan/llm/factory.py +38 -0
  74. bearscan-0.1.0/src/bearscan/llm/http_client.py +43 -0
  75. bearscan-0.1.0/src/bearscan/llm/json_extract.py +18 -0
  76. bearscan-0.1.0/src/bearscan/llm/ollama.py +58 -0
  77. bearscan-0.1.0/src/bearscan/llm/openai_compat.py +70 -0
  78. bearscan-0.1.0/src/bearscan/report/__init__.py +0 -0
  79. bearscan-0.1.0/src/bearscan/report/terminal.py +118 -0
  80. bearscan-0.1.0/src/bearscan/report/theme.py +42 -0
  81. bearscan-0.1.0/tests/support.py +120 -0
  82. bearscan-0.1.0/tests/test_adapters_code.py +133 -0
  83. bearscan-0.1.0/tests/test_adapters_secrets.py +131 -0
  84. bearscan-0.1.0/tests/test_adapters_web.py +160 -0
  85. bearscan-0.1.0/tests/test_claude_code_provider.py +97 -0
  86. bearscan-0.1.0/tests/test_cli.py +86 -0
  87. bearscan-0.1.0/tests/test_codex_provider.py +95 -0
  88. bearscan-0.1.0/tests/test_core.py +46 -0
  89. bearscan-0.1.0/tests/test_docs.py +21 -0
  90. bearscan-0.1.0/tests/test_engine.py +126 -0
  91. bearscan-0.1.0/tests/test_execution.py +120 -0
  92. bearscan-0.1.0/tests/test_files.py +39 -0
  93. bearscan-0.1.0/tests/test_http_providers.py +82 -0
  94. bearscan-0.1.0/tests/test_orchestrator.py +129 -0
  95. bearscan-0.1.0/tests/test_reviewer.py +111 -0
  96. bearscan-0.1.0/uv.lock +667 -0
@@ -0,0 +1,17 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Tool caches
13
+ .pytest_cache/
14
+ .ruff_cache/
15
+ .mypy_cache/
16
+ .coverage
17
+ .claude/
@@ -0,0 +1,36 @@
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.1.0] - 2026-11-29
11
+
12
+ First public release.
13
+
14
+ ### Added
15
+
16
+ - `bearscan scan --path` audits a local repository with 37 built-in rules for leaked secrets,
17
+ JavaScript/TypeScript, and Python, each mapped to CWE and OWASP Top 10 2025.
18
+ - Secret detection that masks values everywhere (`AKIA...[redacted:20]`), skips placeholders and
19
+ low-entropy strings, classifies Supabase JWTs (`service_role` is critical, `anon` is ignored), and
20
+ catches unquoted `KEY=value` credentials.
21
+ - LLM triage of every finding as *likely real*, *false positive*, or *uncertain*, with a confidence, a
22
+ rationale, counterevidence, and a fix. Backends: Claude Code CLI (default, runs headless with no
23
+ tools), Ollama, and any LiteLLM or OpenAI-compatible endpoint.
24
+ - Automatic use of external tools found on `PATH`: gitleaks and trufflehog for secrets in git history,
25
+ semgrep for AST-based analysis, and osv-scanner for vulnerable dependencies.
26
+ - `bearscan scan --url` for dev and staging URLs, using testssl.sh (or sslscan as a fallback) for TLS and
27
+ certificates, and whatweb for server version disclosure.
28
+ - One finding per secret across all tools, and semgrep results dropped when a built-in rule already
29
+ flags the same line and CWE.
30
+ - Rich terminal report, `--json` output, and a private JSON copy of every run in the user data
31
+ directory.
32
+ - Kali Linux support, including install instructions for every external tool.
33
+ - Published on PyPI: `pipx install bearscan`.
34
+
35
+ [Unreleased]: https://github.com/cristhianzl/bearscan/compare/v0.1.0...HEAD
36
+ [0.1.0]: https://github.com/cristhianzl/bearscan/releases/tag/v0.1.0
bearscan-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
@@ -0,0 +1,239 @@
1
+ Metadata-Version: 2.5
2
+ Name: bearscan
3
+ Version: 0.1.0
4
+ Summary: Defensive AppSec scanner for code and staging environments you own, mapped to OWASP Top 10 2025 and triaged by an LLM.
5
+ Project-URL: Homepage, https://github.com/cristhianzl/bearscan
6
+ Project-URL: Documentation, https://github.com/cristhianzl/bearscan/tree/main/docs
7
+ Project-URL: Repository, https://github.com/cristhianzl/bearscan
8
+ Project-URL: Issues, https://github.com/cristhianzl/bearscan/issues
9
+ Project-URL: Changelog, https://github.com/cristhianzl/bearscan/blob/main/CHANGELOG.md
10
+ Author: Cristhian Zanforlin Lousa
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: appsec,claude-code,devsecops,kali-linux,llm,owasp,sast,secret-scanning,security
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Information Technology
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Security
25
+ Classifier: Topic :: Software Development :: Quality Assurance
26
+ Requires-Python: >=3.12
27
+ Requires-Dist: httpx>=0.27
28
+ Requires-Dist: platformdirs>=4.2
29
+ Requires-Dist: pydantic>=2.7
30
+ Requires-Dist: rich>=13.7
31
+ Requires-Dist: typer>=0.12
32
+ Description-Content-Type: text/markdown
33
+
34
+ <p align="center">
35
+ <img src="docs/assets/banner.jpg" alt="bearscan" width="640">
36
+ </p>
37
+
38
+ <p align="center">
39
+ <strong>Defensive AppSec scanner for the code and staging environments you own.</strong><br>
40
+ Secrets, insecure code, vulnerable dependencies, and TLS, mapped to OWASP Top 10 2025 and triaged by an LLM.
41
+ </p>
42
+
43
+ <p align="center">
44
+ <a href="https://github.com/cristhianzl/bearscan/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/cristhianzl/bearscan/ci.yml?branch=main&label=CI"></a>
45
+ <a href="https://pypi.org/project/bearscan/"><img alt="PyPI" src="https://img.shields.io/pypi/v/bearscan"></a>
46
+ <img alt="Python 3.12 | 3.13 | 3.14" src="https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14-3776AB">
47
+ <img alt="OWASP Top 10 2025" src="https://img.shields.io/badge/OWASP%20Top%2010-2025-1f6feb">
48
+ <a href="LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/github/license/cristhianzl/bearscan"></a>
49
+ </p>
50
+
51
+ <p align="center">
52
+ <a href="#quick-start">Quick start</a> ·
53
+ <a href="docs/README.md">Documentation</a> ·
54
+ <a href="docs/kali-linux.md">Kali Linux guide</a> ·
55
+ <a href="CHANGELOG.md">Changelog</a>
56
+ </p>
57
+
58
+ ---
59
+
60
+ 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, merges everything into one report with CWE
62
+ and OWASP Top 10 2025 labels, and asks an LLM to separate real problems from noise. The reviewer runs on
63
+ your existing **Claude Code** or **Codex** login, or fully locally with **Ollama**.
64
+
65
+ <p align="center">
66
+ <img src="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">
67
+ </p>
68
+
69
+ <p align="center"><sub>Real output: a demo repository scanned on Kali Linux with all four code tools installed, triaged by Claude Code.</sub></p>
70
+
71
+ ## Highlights
72
+
73
+ - **Secrets, now and in history.** 15 secret detectors with masking everywhere, plus
74
+ [gitleaks and trufflehog](docs/external-tools.md#tools-for---path) to find keys in commits you deleted
75
+ long ago. A key found by several tools is reported once.
76
+ - **Code weaknesses mapped to standards.** [37 built-in rules](docs/rules.md) for secrets,
77
+ JavaScript/TypeScript, and Python, plus semgrep's security rulesets, all labeled with CWE and
78
+ [OWASP Top 10 2025](docs/rules.md#owasp-top-10-2025-coverage).
79
+ - **Vulnerable dependencies.** osv-scanner checks your lockfiles and names the version that fixes each
80
+ advisory.
81
+ - **Staging checks.** `--url` runs testssl.sh (or sslscan) and whatweb for protocols, ciphers,
82
+ certificates, HSTS, and version disclosure.
83
+ - **Triage, not noise.** An [LLM reviewer](docs/llm-triage.md) labels each finding *likely real*,
84
+ *false positive*, or *uncertain*, with a confidence, a rationale, and a fix. It can never change a
85
+ severity or hide a finding from the JSON.
86
+ - **Adapts to your machine.** Every supported tool found on `PATH` is used automatically; missing ones are
87
+ listed with their install command. On [Kali Linux](docs/kali-linux.md), nearly all of them are one
88
+ `apt install` away.
89
+ - **Private by design.** Secrets are masked before anything is printed, saved, or sent, and you can see
90
+ [exactly what leaves your machine](docs/security-model.md#what-leaves-your-machine).
91
+
92
+ ## Quick start
93
+
94
+ 1. **Install** bearscan (Python 3.12+):
95
+
96
+ ```bash
97
+ pipx install bearscan
98
+ ```
99
+
100
+ 2. **Scan** a repository. Without a reviewer installed, add `--no-review`:
101
+
102
+ ```bash
103
+ bearscan scan --path ./my-repo
104
+ ```
105
+
106
+ 3. **Go further:** install the [external tools](docs/installation.md#add-external-tools) for history,
107
+ semgrep, and dependency checks, and point `--url` at a staging environment you own:
108
+
109
+ ```bash
110
+ bearscan scan --url https://staging.example.com
111
+ ```
112
+
113
+ ## Installation
114
+
115
+ ```bash
116
+ pipx install bearscan
117
+ # or
118
+ uv tool install bearscan
119
+ ```
120
+
121
+ On Kali Linux, add the packaged external tools in one go:
122
+
123
+ ```bash
124
+ sudo apt install -y pipx git gitleaks trufflehog testssl.sh sslscan whatweb
125
+ pipx install semgrep
126
+ ```
127
+
128
+ osv-scanner, macOS with Homebrew, installing from source, reviewers, and upgrades are covered in the
129
+ [installation guide](docs/installation.md).
130
+
131
+ ## Usage
132
+
133
+ ```bash
134
+ bearscan scan --path ./my-repo # scan and triage with Claude Code
135
+ bearscan scan --path ./my-repo --llm codex # triage with Codex
136
+ bearscan scan --path ./my-repo --llm ollama # triage with a local model
137
+ bearscan scan --path ./my-repo --no-review # deterministic checks only
138
+ bearscan scan --path ./my-repo --json > run.json # machine-readable output
139
+ bearscan scan --url https://staging.example.com # TLS, certificate, and server checks
140
+ ```
141
+
142
+ | Option | Description |
143
+ |---|---|
144
+ | `--path DIR` / `--url URL` | What to scan. Pass exactly one. |
145
+ | `--review / --no-review` | Triage findings with an LLM (default: on). |
146
+ | `--llm` | `claude-code` (default), `codex`, `ollama`, or `litellm`. |
147
+ | `--model`, `--llm-base-url` | Model and endpoint for the reviewer. |
148
+ | `--max-review N` | Most findings sent to the reviewer (default: 60). |
149
+ | `--json` | Print the run as JSON instead of the report. |
150
+
151
+ Every option, environment variable, and exit code is in the [usage guide](docs/usage.md).
152
+
153
+ ## How it works
154
+
155
+ ```mermaid
156
+ flowchart LR
157
+ A[Built-in rules] --> C[Normalize<br/>CWE + OWASP 2025]
158
+ B[Installed tools] --> C
159
+ C --> D[Merge duplicates]
160
+ D --> E[LLM reviewer]
161
+ E --> F[Report + JSON]
162
+ ```
163
+
164
+ Deterministic checks decide what a finding is and how severe it is; the reviewer only adds a verdict and a
165
+ fix. See the [architecture](docs/architecture.md) for the details.
166
+
167
+ ### External tools
168
+
169
+ | Tool | Target | Adds |
170
+ |---|---|---|
171
+ | [gitleaks](https://github.com/gitleaks/gitleaks) | `--path` | Secrets anywhere in git history |
172
+ | [trufflehog](https://github.com/trufflesecurity/trufflehog) | `--path` | Hundreds of extra secret detectors over git history |
173
+ | [semgrep](https://github.com/semgrep/semgrep) | `--path` | AST-based analysis with the `p/default` and `p/owasp-top-ten` rulesets |
174
+ | [osv-scanner](https://github.com/google/osv-scanner) | `--path` | Known CVEs in lockfiles and manifests |
175
+ | [testssl.sh](https://github.com/testssl/testssl.sh) | `--url` | Protocols, ciphers, certificates, TLS vulnerabilities, HSTS |
176
+ | [sslscan](https://github.com/rbsec/sslscan) | `--url` | Fast TLS fallback when testssl.sh is unavailable |
177
+ | [whatweb](https://github.com/urbanadventurer/WhatWeb) | `--url` | Server and framework version disclosure |
178
+
179
+ ### LLM reviewers
180
+
181
+ | `--llm` | Runs on | How bearscan calls it |
182
+ |---|---|---|
183
+ | `claude-code` | your Claude Code login | Headless, no tools, restricted mode, empty working directory |
184
+ | `codex` | your Codex login | `codex exec` in a read-only sandbox, shell and web search off |
185
+ | `ollama` | your machine | Local API with a JSON schema, temperature 0 |
186
+ | `litellm` | any OpenAI-compatible endpoint | Chat completions with a JSON schema |
187
+
188
+ Only the flagged line and two lines of context on each side are sent, with secrets masked and repository
189
+ text fenced as untrusted data. Details in [LLM triage](docs/llm-triage.md).
190
+
191
+ ## Privacy and security
192
+
193
+ - The built-in scan sends nothing anywhere; `--no-review` with no tools installed is fully offline.
194
+ - trufflehog never verifies secrets with their providers; semgrep runs with metrics off and never uploads
195
+ code; osv-scanner sends only package names and versions.
196
+ - Saved runs are written with `0600` permissions, because they map your weaknesses.
197
+
198
+ The full picture is in the [security model](docs/security-model.md).
199
+
200
+ ## Documentation
201
+
202
+ [Installation](docs/installation.md) · [Kali Linux](docs/kali-linux.md) · [Usage](docs/usage.md) ·
203
+ [LLM triage](docs/llm-triage.md) · [External tools](docs/external-tools.md) · [Rules](docs/rules.md) ·
204
+ [Output format](docs/output-format.md) · [Security model](docs/security-model.md) ·
205
+ [Architecture](docs/architecture.md) · [Troubleshooting](docs/troubleshooting.md)
206
+
207
+ ## Roadmap
208
+
209
+ - Built-in `--url` checks with Playwright: CSP, CORS, cookie flags, and data exposure in API responses
210
+ - `--fail-on <severity>` exit codes and SARIF output for CI pipelines
211
+ - `bearscan report --pdf` for an executive summary and `bearscan report --web` for a local dashboard
212
+ - A pre-commit hook and a GitHub Action
213
+
214
+ Ideas and votes are welcome in [issues](https://github.com/cristhianzl/bearscan/issues).
215
+
216
+ ## Contributing
217
+
218
+ Contributions are welcome, from rule reports to new tool adapters. Read [CONTRIBUTING.md](CONTRIBUTING.md)
219
+ to set up the project, and follow the [Code of Conduct](CODE_OF_CONDUCT.md).
220
+
221
+ ## Security
222
+
223
+ Found a vulnerability in bearscan itself? Please report it privately as described in
224
+ [SECURITY.md](SECURITY.md).
225
+
226
+ ## Responsible use
227
+
228
+ bearscan is a defensive tool. Scan only code and systems you own or are explicitly authorized to test.
229
+
230
+ ## Acknowledgements
231
+
232
+ bearscan stands on the shoulders of the tools it drives: gitleaks, trufflehog, semgrep, osv-scanner,
233
+ testssl.sh, sslscan, and whatweb. Its terminal output is built with [Rich](https://github.com/Textualize/rich)
234
+ and [Typer](https://github.com/fastapi/typer), and its reviewer design borrows ideas from open-source AI
235
+ security agents such as Strix, Shannon, and PentAGI.
236
+
237
+ ## License
238
+
239
+ Licensed under the [Apache License 2.0](LICENSE).