whitebox-secure-scan 1.0.1__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 (31) hide show
  1. whitebox_secure_scan-1.0.1/LICENSE +10 -0
  2. whitebox_secure_scan-1.0.1/PKG-INFO +72 -0
  3. whitebox_secure_scan-1.0.1/README.md +31 -0
  4. whitebox_secure_scan-1.0.1/pyproject.toml +49 -0
  5. whitebox_secure_scan-1.0.1/setup.cfg +4 -0
  6. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/__init__.py +1 -0
  7. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/adapters.py +33 -0
  8. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/analyzer.py +486 -0
  9. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/cli.py +886 -0
  10. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/config.py +94 -0
  11. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/correlation.py +63 -0
  12. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/detectors.py +58 -0
  13. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/java_analyzer.py +655 -0
  14. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/javascript_analyzer.py +508 -0
  15. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/models.py +118 -0
  16. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/parsers.py +19 -0
  17. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/redaction.py +27 -0
  18. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/reporting.py +96 -0
  19. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/repository.py +157 -0
  20. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/rules.py +67 -0
  21. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/rules.yaml +29 -0
  22. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/subprocess_runner.py +31 -0
  23. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan/surface.py +25 -0
  24. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/PKG-INFO +72 -0
  25. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/SOURCES.txt +29 -0
  26. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/dependency_links.txt +1 -0
  27. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/entry_points.txt +2 -0
  28. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/requires.txt +12 -0
  29. whitebox_secure_scan-1.0.1/src/whitebox_secure_scan.egg-info/top_level.txt +1 -0
  30. whitebox_secure_scan-1.0.1/tests/test_safety.py +120 -0
  31. whitebox_secure_scan-1.0.1/tests/test_scanner.py +320 -0
@@ -0,0 +1,10 @@
1
+ Copyright 2026 whitebox-secure-scan contributors
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed
8
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ specific language governing permissions and limitations under the License.
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: whitebox-secure-scan
3
+ Version: 1.0.1
4
+ Summary: Offline white-box secure-code triage for penetration testers.
5
+ Author: whitebox-secure-scan contributors
6
+ License: Copyright 2026 whitebox-secure-scan contributors
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software distributed
13
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
15
+ specific language governing permissions and limitations under the License.
16
+
17
+ Project-URL: Homepage, https://github.com/Waariss/whitebox-secure-scan
18
+ Project-URL: Repository, https://github.com/Waariss/whitebox-secure-scan
19
+ Project-URL: Issues, https://github.com/Waariss/whitebox-secure-scan/issues
20
+ Project-URL: Documentation, https://github.com/Waariss/whitebox-secure-scan#readme
21
+ Keywords: security,static-analysis,secure-coding,triage
22
+ Classifier: Development Status :: 5 - Production/Stable
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: License :: OSI Approved :: Apache Software License
27
+ Requires-Python: >=3.11
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: PyYAML>=6.0
31
+ Requires-Dist: jsonschema>=4.0
32
+ Provides-Extra: parsing
33
+ Requires-Dist: tree-sitter>=0.22; extra == "parsing"
34
+ Requires-Dist: tree-sitter-languages>=1.10; extra == "parsing"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=8; extra == "dev"
37
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
38
+ Requires-Dist: ruff>=0.6; extra == "dev"
39
+ Requires-Dist: mypy>=1.10; extra == "dev"
40
+ Dynamic: license-file
41
+
42
+ # whitebox-secure-scan
43
+
44
+ `whitebox-secure-scan` is an offline, read-only white-box secure-code triage tool for penetration testers. It identifies high-signal security review leads, records precise file and line evidence, groups related instances into root causes, and provides reviewer guidance.
45
+
46
+ It is designed to accelerate source-code review not to replace a penetration tester, confirm exploitability automatically, or generate a final pentest report. Every candidate requires independent verification by an authorized security engineer.
47
+
48
+ It scans Python 3.11+, JavaScript/TypeScript, Java, and Go locally. It does not import, execute, upload, or modify target code and does not contact package registries or external AI services during scans.
49
+
50
+ ## Install and run
51
+
52
+ ```bash
53
+ python3 -m venv .venv && . .venv/bin/activate
54
+ python -m pip install -e ".[dev]"
55
+ whitebox-secure-scan review /path/to/repository --output ./whitebox-results
56
+ ```
57
+
58
+ The normal `review` workflow keeps only the useful review outputs: `SUMMARY.md`, `report.md`, `findings.json`, `root-causes.json`, and `review-points.json`. Detailed inventory, routes, metadata, SARIF, and handoff packaging remain available through advanced compatibility commands. Results are review leads, not automatic vulnerability confirmations.
59
+
60
+ ## Scope
61
+
62
+ The engine combines Python AST parsing, structured lexical analysis for the other supported languages, framework evidence detection, conservative source/sink heuristics, secret redaction, confidence scoring, duplicate suppression, route inventory, normalized reporting, safety-bounded walking, and local adapter interfaces. Findings are review leads or review points, not confirmed vulnerabilities.
63
+
64
+ Java uses a structured lexical fallback that removes comments/Javadocs, masks string literals for API matching, and requires observable method or constructor invocation. It distinguishes code surfaces such as production, test, utility, demo, generated, and configuration. Findings include `verdict_candidate`, `code_surface`, `proof_gaps`, `counterevidence`, parser metadata, and source/sink diagnostics.
65
+
66
+ JavaScript and TypeScript use the same conservative structured-lexical approach when an optional AST parser is unavailable. Upload findings require both an uploaded-file source and a write/storage sink; blob responses, report downloads, browser exports, API wrappers, identifiers, comments, and UI labels are not upload or execution evidence. Dynamic execution requires an invocation of `eval`, `Function`, `vm`, or a `child_process` API. Literal-secret findings require a credential-shaped value, while environment-variable lookups and labels such as `Change Password` are excluded.
67
+
68
+ The normal command is `whitebox-secure-scan review /path/to/repository`. Other commands are advanced support utilities. See [the compact technical reference](docs/REFERENCE.md).
69
+
70
+ Triage commands are `sample-unreported` for deterministic negative-review candidates and `compare` for old/new result comparison. Use `--production-only` for production results, `--include-test-code` to inspect ordinary test code, `--include-test-secrets` to retain test-source secrets, and `--root-causes-only` when consuming grouped results.
71
+
72
+ The operational workflow is: scan to an output directory outside the target, inspect the concise summary and evidence, optionally send the bounded handoff package to an approved internal verifier, then manually validate candidates. Default controls are offline operation, redaction, no repository execution, no external tools, bounded file reads, no symlink following, and no writes to the target repository.
@@ -0,0 +1,31 @@
1
+ # whitebox-secure-scan
2
+
3
+ `whitebox-secure-scan` is an offline, read-only white-box secure-code triage tool for penetration testers. It identifies high-signal security review leads, records precise file and line evidence, groups related instances into root causes, and provides reviewer guidance.
4
+
5
+ It is designed to accelerate source-code review not to replace a penetration tester, confirm exploitability automatically, or generate a final pentest report. Every candidate requires independent verification by an authorized security engineer.
6
+
7
+ It scans Python 3.11+, JavaScript/TypeScript, Java, and Go locally. It does not import, execute, upload, or modify target code and does not contact package registries or external AI services during scans.
8
+
9
+ ## Install and run
10
+
11
+ ```bash
12
+ python3 -m venv .venv && . .venv/bin/activate
13
+ python -m pip install -e ".[dev]"
14
+ whitebox-secure-scan review /path/to/repository --output ./whitebox-results
15
+ ```
16
+
17
+ The normal `review` workflow keeps only the useful review outputs: `SUMMARY.md`, `report.md`, `findings.json`, `root-causes.json`, and `review-points.json`. Detailed inventory, routes, metadata, SARIF, and handoff packaging remain available through advanced compatibility commands. Results are review leads, not automatic vulnerability confirmations.
18
+
19
+ ## Scope
20
+
21
+ The engine combines Python AST parsing, structured lexical analysis for the other supported languages, framework evidence detection, conservative source/sink heuristics, secret redaction, confidence scoring, duplicate suppression, route inventory, normalized reporting, safety-bounded walking, and local adapter interfaces. Findings are review leads or review points, not confirmed vulnerabilities.
22
+
23
+ Java uses a structured lexical fallback that removes comments/Javadocs, masks string literals for API matching, and requires observable method or constructor invocation. It distinguishes code surfaces such as production, test, utility, demo, generated, and configuration. Findings include `verdict_candidate`, `code_surface`, `proof_gaps`, `counterevidence`, parser metadata, and source/sink diagnostics.
24
+
25
+ JavaScript and TypeScript use the same conservative structured-lexical approach when an optional AST parser is unavailable. Upload findings require both an uploaded-file source and a write/storage sink; blob responses, report downloads, browser exports, API wrappers, identifiers, comments, and UI labels are not upload or execution evidence. Dynamic execution requires an invocation of `eval`, `Function`, `vm`, or a `child_process` API. Literal-secret findings require a credential-shaped value, while environment-variable lookups and labels such as `Change Password` are excluded.
26
+
27
+ The normal command is `whitebox-secure-scan review /path/to/repository`. Other commands are advanced support utilities. See [the compact technical reference](docs/REFERENCE.md).
28
+
29
+ Triage commands are `sample-unreported` for deterministic negative-review candidates and `compare` for old/new result comparison. Use `--production-only` for production results, `--include-test-code` to inspect ordinary test code, `--include-test-secrets` to retain test-source secrets, and `--root-causes-only` when consuming grouped results.
30
+
31
+ The operational workflow is: scan to an output directory outside the target, inspect the concise summary and evidence, optionally send the bounded handoff package to an approved internal verifier, then manually validate candidates. Default controls are offline operation, redaction, no repository execution, no external tools, bounded file reads, no symlink following, and no writes to the target repository.
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "whitebox-secure-scan"
7
+ version = "1.0.1"
8
+ description = "Offline white-box secure-code triage for penetration testers."
9
+ readme = "README.md"
10
+ license = {file = "LICENSE"}
11
+ keywords = ["security", "static-analysis", "secure-coding", "triage"]
12
+ authors = [{name = "whitebox-secure-scan contributors"}]
13
+ classifiers = ["Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "License :: OSI Approved :: Apache Software License"]
14
+ requires-python = ">=3.11"
15
+ dependencies = ["PyYAML>=6.0", "jsonschema>=4.0"]
16
+
17
+ [project.optional-dependencies]
18
+ parsing = ["tree-sitter>=0.22", "tree-sitter-languages>=1.10"]
19
+ dev = ["pytest>=8", "pytest-cov>=5.0", "ruff>=0.6", "mypy>=1.10"]
20
+
21
+ [project.scripts]
22
+ whitebox-secure-scan = "whitebox_secure_scan.cli:main"
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/Waariss/whitebox-secure-scan"
26
+ Repository = "https://github.com/Waariss/whitebox-secure-scan"
27
+ Issues = "https://github.com/Waariss/whitebox-secure-scan/issues"
28
+ Documentation = "https://github.com/Waariss/whitebox-secure-scan#readme"
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["src"]
32
+
33
+ [tool.ruff]
34
+ line-length = 100
35
+ target-version = "py312"
36
+ exclude = [".venv", "htmlcov", "tests/fixtures"]
37
+
38
+ [tool.pytest.ini_options]
39
+ testpaths = ["tests"]
40
+ addopts = "-q"
41
+
42
+ [tool.mypy]
43
+ python_version = "3.12"
44
+ check_untyped_defs = true
45
+ disallow_untyped_defs = false
46
+ warn_unused_ignores = true
47
+
48
+ [tool.setuptools.package-data]
49
+ whitebox_secure_scan = ["*.yaml", "*.json"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "1.0.1"
@@ -0,0 +1,33 @@
1
+ from dataclasses import dataclass
2
+ from pathlib import Path
3
+ import shutil
4
+ from .models import Finding
5
+ from .subprocess_runner import run_local
6
+
7
+
8
+ @dataclass
9
+ class AdapterResult:
10
+ findings: list[Finding]
11
+ errors: list[str]
12
+
13
+
14
+ SUPPORTED = {"semgrep", "gitleaks", "trivy", "bandit", "gosec", "findsecbugs"}
15
+
16
+
17
+ def run_local_adapter(name: str, root: Path, timeout: int = 30) -> AdapterResult:
18
+ executable = shutil.which(name)
19
+ if name not in SUPPORTED or executable is None:
20
+ return AdapterResult([], [f"adapter unavailable or unsupported: {name}"])
21
+ # Adapters intentionally require explicit integration and never use a shell.
22
+ try:
23
+ proc = run_local(
24
+ [name, "--version"],
25
+ cwd=root,
26
+ timeout=timeout,
27
+ env={"PATH": str(Path(executable).parent)},
28
+ )
29
+ if proc.returncode != 0:
30
+ return AdapterResult([], [f"{name} exited {proc.returncode}"])
31
+ return AdapterResult([], [])
32
+ except (OSError, TimeoutError) as exc:
33
+ return AdapterResult([], [f"{name}: {exc}"])