breakpoint-scan 1.0.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.
- breakpoint_scan-1.0.0/LICENSE +21 -0
- breakpoint_scan-1.0.0/PKG-INFO +115 -0
- breakpoint_scan-1.0.0/README.md +93 -0
- breakpoint_scan-1.0.0/breakpoint_scan.egg-info/PKG-INFO +115 -0
- breakpoint_scan-1.0.0/breakpoint_scan.egg-info/SOURCES.txt +9 -0
- breakpoint_scan-1.0.0/breakpoint_scan.egg-info/dependency_links.txt +1 -0
- breakpoint_scan-1.0.0/breakpoint_scan.egg-info/entry_points.txt +2 -0
- breakpoint_scan-1.0.0/breakpoint_scan.egg-info/top_level.txt +1 -0
- breakpoint_scan-1.0.0/breakpoint_scan.py +1358 -0
- breakpoint_scan-1.0.0/pyproject.toml +38 -0
- breakpoint_scan-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Harshitraiii2005
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: breakpoint-scan
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Local, zero-dependency full-stack bug scanner and release gate: code, secrets, API contract, deployment, CVEs, live probing.
|
|
5
|
+
Author: Harshitraiii2005
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Harshitraiii2005/breakpoint
|
|
8
|
+
Project-URL: Issues, https://github.com/Harshitraiii2005/breakpoint/issues
|
|
9
|
+
Keywords: static-analysis,security,linter,sast,ci,sarif,release-gate
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# breakpoint
|
|
24
|
+
|
|
25
|
+
A bug scanner and release gate that runs locally. It scans code, secrets, the frontend/backend API contract, Docker and compose files, and config. Optionally it also checks dependency CVEs, probes the running app, and runs an AI review. It needs no dependencies, only Python 3.11+.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pipx install breakpoint-scan # or: pip install breakpoint-scan (or run the single file: python breakpoint_scan.py scan .)
|
|
29
|
+
breakpoint scan . # full report; exits 1 if anything is HIGH or worse
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What it checks
|
|
33
|
+
|
|
34
|
+
| Area | Examples |
|
|
35
|
+
|---|---|
|
|
36
|
+
| Secrets | AWS/GitHub/Slack/Stripe/API keys, private keys, hardcoded passwords |
|
|
37
|
+
| Python (AST) | SQL injection, `eval`, `shell=True`, unsafe pickle/yaml, missing timeouts, `verify=False`, bare/swallowed excepts, blocking calls in `async def`, **unawaited coroutines**, **always-true tuple asserts**, **return in finally**, **duplicate dict keys**, **discarded `str.strip()`/`sorted()` results** |
|
|
38
|
+
| JS/TS, Go, Rust | XSS sinks, SQL/command injection, TLS off, tokens in localStorage, `async` forEach/useEffect/Promise executors, `=== NaN`, unhandled promises, ignored Go errors, `unwrap()` |
|
|
39
|
+
| API contract | Frontend `fetch`/`axios` calls with no matching backend route or the wrong HTTP method (FastAPI, Flask, Express, Next.js), and write routes with no visible auth |
|
|
40
|
+
| Deployment | Dockerfile (root user, unpinned base image, `curl \| sh`, baked secrets), compose (privileged, docker.sock, exposed DB ports), `.env` tracked or not gitignored, wildcard CORS, `DEBUG=True` |
|
|
41
|
+
| `--deps` | Known CVEs in npm/yarn/pnpm, pip/poetry/uv/Pipfile, Cargo, Go, Composer and Bundler lockfiles via [OSV](https://osv.dev), with the minimum version that clears them all |
|
|
42
|
+
| `--url` | Security headers, CORS reflection, leaked stack traces, exposed `/.env` and `/.git`, 500s on plain GETs. Adding `--fuzz` also sends malformed bodies to POST/PUT/PATCH routes. **This writes data, so use staging only.** |
|
|
43
|
+
| `--llm` | AI review of the riskiest files (or only the changed ones with `--diff`) through the Anthropic API. Needs `ANTHROPIC_API_KEY`; pick the model with `--model` or `BREAKPOINT_MODEL`. |
|
|
44
|
+
|
|
45
|
+
Scanner failures (a manifest it can't parse, OSV unreachable, an AI review the model declined) appear as `BREAKPOINT-*` findings. A check that didn't run is never reported as a pass.
|
|
46
|
+
|
|
47
|
+
## Rolling it out on an existing codebase
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
breakpoint scan . --write-baseline breakpoint-baseline.json # accept today's findings; commit this file
|
|
51
|
+
breakpoint scan . --baseline breakpoint-baseline.json # CI fails only on NEW findings
|
|
52
|
+
breakpoint scan . --diff origin/main # PRs: only lines this branch changed
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Baseline entries use content fingerprints, not line numbers, so they still match when code moves. In `--diff` mode the API contract is re-checked whenever a route file changes, so deleting a route the frontend still calls is caught.
|
|
56
|
+
|
|
57
|
+
## Config: `.breakpoint.toml` (optional, at the scan root)
|
|
58
|
+
|
|
59
|
+
```toml
|
|
60
|
+
exclude = ["migrations/*", "*.generated.ts"] # fnmatch globs against repo-relative paths
|
|
61
|
+
disable = ["JS-CONSOLE", "TODO"] # rule IDs; globs like "JS-*" work
|
|
62
|
+
fail_on = "HIGH" # CRITICAL | HIGH | MEDIUM | LOW | INFO
|
|
63
|
+
min_severity = "LOW" # display only; never weakens the gate
|
|
64
|
+
|
|
65
|
+
[severity] # re-rank rules for your codebase
|
|
66
|
+
PY-PRINT = "LOW"
|
|
67
|
+
"API-NO-AUTH" = "CRITICAL"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Any key not in this list is an error, so a misspelled `disable` can't quietly leave a check on. To silence one line, add a `breakpoint-ignore` comment on it.
|
|
71
|
+
|
|
72
|
+
## CI
|
|
73
|
+
|
|
74
|
+
**GitHub Actions** (findings show up as code-scanning alerts on the PR):
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
name: breakpoint
|
|
78
|
+
on: [pull_request]
|
|
79
|
+
permissions: { contents: read, security-events: write }
|
|
80
|
+
jobs:
|
|
81
|
+
scan:
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v5
|
|
85
|
+
with: { fetch-depth: 0 } # --diff needs history to find the merge-base
|
|
86
|
+
- uses: actions/setup-python@v6
|
|
87
|
+
with: { python-version: "3.12" }
|
|
88
|
+
- run: pip install breakpoint-scan
|
|
89
|
+
- run: breakpoint scan . --diff origin/${{ github.base_ref }} --deps --format sarif -o breakpoint.sarif
|
|
90
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
91
|
+
if: always()
|
|
92
|
+
with: { sarif_file: breakpoint.sarif }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**GitLab / Jenkins / anything else:** `breakpoint scan . --baseline breakpoint-baseline.json --format json -o breakpoint.json`. The exit code is the gate.
|
|
96
|
+
|
|
97
|
+
**pre-commit** (blocks the commit locally):
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
- repo: local
|
|
101
|
+
hooks:
|
|
102
|
+
- id: breakpoint
|
|
103
|
+
name: breakpoint
|
|
104
|
+
entry: breakpoint scan . --diff HEAD
|
|
105
|
+
language: system
|
|
106
|
+
pass_filenames: false
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Reference
|
|
110
|
+
|
|
111
|
+
- Exit codes: `0` pass, `1` a finding at or above `--fail-on`, `2` usage or config error.
|
|
112
|
+
- Output: `--format text|json|sarif`, `-o FILE`.
|
|
113
|
+
- Speed: the per-file pass runs on every CPU (`-j N`), and git repos are listed through `git ls-files` so `.gitignore` is respected. Python's 2,500-file standard library scans in about 5s on 8 cores.
|
|
114
|
+
- Tests: `python test_breakpoint.py`
|
|
115
|
+
- License: MIT
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# breakpoint
|
|
2
|
+
|
|
3
|
+
A bug scanner and release gate that runs locally. It scans code, secrets, the frontend/backend API contract, Docker and compose files, and config. Optionally it also checks dependency CVEs, probes the running app, and runs an AI review. It needs no dependencies, only Python 3.11+.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pipx install breakpoint-scan # or: pip install breakpoint-scan (or run the single file: python breakpoint_scan.py scan .)
|
|
7
|
+
breakpoint scan . # full report; exits 1 if anything is HIGH or worse
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## What it checks
|
|
11
|
+
|
|
12
|
+
| Area | Examples |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Secrets | AWS/GitHub/Slack/Stripe/API keys, private keys, hardcoded passwords |
|
|
15
|
+
| Python (AST) | SQL injection, `eval`, `shell=True`, unsafe pickle/yaml, missing timeouts, `verify=False`, bare/swallowed excepts, blocking calls in `async def`, **unawaited coroutines**, **always-true tuple asserts**, **return in finally**, **duplicate dict keys**, **discarded `str.strip()`/`sorted()` results** |
|
|
16
|
+
| JS/TS, Go, Rust | XSS sinks, SQL/command injection, TLS off, tokens in localStorage, `async` forEach/useEffect/Promise executors, `=== NaN`, unhandled promises, ignored Go errors, `unwrap()` |
|
|
17
|
+
| API contract | Frontend `fetch`/`axios` calls with no matching backend route or the wrong HTTP method (FastAPI, Flask, Express, Next.js), and write routes with no visible auth |
|
|
18
|
+
| Deployment | Dockerfile (root user, unpinned base image, `curl \| sh`, baked secrets), compose (privileged, docker.sock, exposed DB ports), `.env` tracked or not gitignored, wildcard CORS, `DEBUG=True` |
|
|
19
|
+
| `--deps` | Known CVEs in npm/yarn/pnpm, pip/poetry/uv/Pipfile, Cargo, Go, Composer and Bundler lockfiles via [OSV](https://osv.dev), with the minimum version that clears them all |
|
|
20
|
+
| `--url` | Security headers, CORS reflection, leaked stack traces, exposed `/.env` and `/.git`, 500s on plain GETs. Adding `--fuzz` also sends malformed bodies to POST/PUT/PATCH routes. **This writes data, so use staging only.** |
|
|
21
|
+
| `--llm` | AI review of the riskiest files (or only the changed ones with `--diff`) through the Anthropic API. Needs `ANTHROPIC_API_KEY`; pick the model with `--model` or `BREAKPOINT_MODEL`. |
|
|
22
|
+
|
|
23
|
+
Scanner failures (a manifest it can't parse, OSV unreachable, an AI review the model declined) appear as `BREAKPOINT-*` findings. A check that didn't run is never reported as a pass.
|
|
24
|
+
|
|
25
|
+
## Rolling it out on an existing codebase
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
breakpoint scan . --write-baseline breakpoint-baseline.json # accept today's findings; commit this file
|
|
29
|
+
breakpoint scan . --baseline breakpoint-baseline.json # CI fails only on NEW findings
|
|
30
|
+
breakpoint scan . --diff origin/main # PRs: only lines this branch changed
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Baseline entries use content fingerprints, not line numbers, so they still match when code moves. In `--diff` mode the API contract is re-checked whenever a route file changes, so deleting a route the frontend still calls is caught.
|
|
34
|
+
|
|
35
|
+
## Config: `.breakpoint.toml` (optional, at the scan root)
|
|
36
|
+
|
|
37
|
+
```toml
|
|
38
|
+
exclude = ["migrations/*", "*.generated.ts"] # fnmatch globs against repo-relative paths
|
|
39
|
+
disable = ["JS-CONSOLE", "TODO"] # rule IDs; globs like "JS-*" work
|
|
40
|
+
fail_on = "HIGH" # CRITICAL | HIGH | MEDIUM | LOW | INFO
|
|
41
|
+
min_severity = "LOW" # display only; never weakens the gate
|
|
42
|
+
|
|
43
|
+
[severity] # re-rank rules for your codebase
|
|
44
|
+
PY-PRINT = "LOW"
|
|
45
|
+
"API-NO-AUTH" = "CRITICAL"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Any key not in this list is an error, so a misspelled `disable` can't quietly leave a check on. To silence one line, add a `breakpoint-ignore` comment on it.
|
|
49
|
+
|
|
50
|
+
## CI
|
|
51
|
+
|
|
52
|
+
**GitHub Actions** (findings show up as code-scanning alerts on the PR):
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
name: breakpoint
|
|
56
|
+
on: [pull_request]
|
|
57
|
+
permissions: { contents: read, security-events: write }
|
|
58
|
+
jobs:
|
|
59
|
+
scan:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v5
|
|
63
|
+
with: { fetch-depth: 0 } # --diff needs history to find the merge-base
|
|
64
|
+
- uses: actions/setup-python@v6
|
|
65
|
+
with: { python-version: "3.12" }
|
|
66
|
+
- run: pip install breakpoint-scan
|
|
67
|
+
- run: breakpoint scan . --diff origin/${{ github.base_ref }} --deps --format sarif -o breakpoint.sarif
|
|
68
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
69
|
+
if: always()
|
|
70
|
+
with: { sarif_file: breakpoint.sarif }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**GitLab / Jenkins / anything else:** `breakpoint scan . --baseline breakpoint-baseline.json --format json -o breakpoint.json`. The exit code is the gate.
|
|
74
|
+
|
|
75
|
+
**pre-commit** (blocks the commit locally):
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- repo: local
|
|
79
|
+
hooks:
|
|
80
|
+
- id: breakpoint
|
|
81
|
+
name: breakpoint
|
|
82
|
+
entry: breakpoint scan . --diff HEAD
|
|
83
|
+
language: system
|
|
84
|
+
pass_filenames: false
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Reference
|
|
88
|
+
|
|
89
|
+
- Exit codes: `0` pass, `1` a finding at or above `--fail-on`, `2` usage or config error.
|
|
90
|
+
- Output: `--format text|json|sarif`, `-o FILE`.
|
|
91
|
+
- Speed: the per-file pass runs on every CPU (`-j N`), and git repos are listed through `git ls-files` so `.gitignore` is respected. Python's 2,500-file standard library scans in about 5s on 8 cores.
|
|
92
|
+
- Tests: `python test_breakpoint.py`
|
|
93
|
+
- License: MIT
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: breakpoint-scan
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Local, zero-dependency full-stack bug scanner and release gate: code, secrets, API contract, deployment, CVEs, live probing.
|
|
5
|
+
Author: Harshitraiii2005
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Harshitraiii2005/breakpoint
|
|
8
|
+
Project-URL: Issues, https://github.com/Harshitraiii2005/breakpoint/issues
|
|
9
|
+
Keywords: static-analysis,security,linter,sast,ci,sarif,release-gate
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# breakpoint
|
|
24
|
+
|
|
25
|
+
A bug scanner and release gate that runs locally. It scans code, secrets, the frontend/backend API contract, Docker and compose files, and config. Optionally it also checks dependency CVEs, probes the running app, and runs an AI review. It needs no dependencies, only Python 3.11+.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pipx install breakpoint-scan # or: pip install breakpoint-scan (or run the single file: python breakpoint_scan.py scan .)
|
|
29
|
+
breakpoint scan . # full report; exits 1 if anything is HIGH or worse
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What it checks
|
|
33
|
+
|
|
34
|
+
| Area | Examples |
|
|
35
|
+
|---|---|
|
|
36
|
+
| Secrets | AWS/GitHub/Slack/Stripe/API keys, private keys, hardcoded passwords |
|
|
37
|
+
| Python (AST) | SQL injection, `eval`, `shell=True`, unsafe pickle/yaml, missing timeouts, `verify=False`, bare/swallowed excepts, blocking calls in `async def`, **unawaited coroutines**, **always-true tuple asserts**, **return in finally**, **duplicate dict keys**, **discarded `str.strip()`/`sorted()` results** |
|
|
38
|
+
| JS/TS, Go, Rust | XSS sinks, SQL/command injection, TLS off, tokens in localStorage, `async` forEach/useEffect/Promise executors, `=== NaN`, unhandled promises, ignored Go errors, `unwrap()` |
|
|
39
|
+
| API contract | Frontend `fetch`/`axios` calls with no matching backend route or the wrong HTTP method (FastAPI, Flask, Express, Next.js), and write routes with no visible auth |
|
|
40
|
+
| Deployment | Dockerfile (root user, unpinned base image, `curl \| sh`, baked secrets), compose (privileged, docker.sock, exposed DB ports), `.env` tracked or not gitignored, wildcard CORS, `DEBUG=True` |
|
|
41
|
+
| `--deps` | Known CVEs in npm/yarn/pnpm, pip/poetry/uv/Pipfile, Cargo, Go, Composer and Bundler lockfiles via [OSV](https://osv.dev), with the minimum version that clears them all |
|
|
42
|
+
| `--url` | Security headers, CORS reflection, leaked stack traces, exposed `/.env` and `/.git`, 500s on plain GETs. Adding `--fuzz` also sends malformed bodies to POST/PUT/PATCH routes. **This writes data, so use staging only.** |
|
|
43
|
+
| `--llm` | AI review of the riskiest files (or only the changed ones with `--diff`) through the Anthropic API. Needs `ANTHROPIC_API_KEY`; pick the model with `--model` or `BREAKPOINT_MODEL`. |
|
|
44
|
+
|
|
45
|
+
Scanner failures (a manifest it can't parse, OSV unreachable, an AI review the model declined) appear as `BREAKPOINT-*` findings. A check that didn't run is never reported as a pass.
|
|
46
|
+
|
|
47
|
+
## Rolling it out on an existing codebase
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
breakpoint scan . --write-baseline breakpoint-baseline.json # accept today's findings; commit this file
|
|
51
|
+
breakpoint scan . --baseline breakpoint-baseline.json # CI fails only on NEW findings
|
|
52
|
+
breakpoint scan . --diff origin/main # PRs: only lines this branch changed
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Baseline entries use content fingerprints, not line numbers, so they still match when code moves. In `--diff` mode the API contract is re-checked whenever a route file changes, so deleting a route the frontend still calls is caught.
|
|
56
|
+
|
|
57
|
+
## Config: `.breakpoint.toml` (optional, at the scan root)
|
|
58
|
+
|
|
59
|
+
```toml
|
|
60
|
+
exclude = ["migrations/*", "*.generated.ts"] # fnmatch globs against repo-relative paths
|
|
61
|
+
disable = ["JS-CONSOLE", "TODO"] # rule IDs; globs like "JS-*" work
|
|
62
|
+
fail_on = "HIGH" # CRITICAL | HIGH | MEDIUM | LOW | INFO
|
|
63
|
+
min_severity = "LOW" # display only; never weakens the gate
|
|
64
|
+
|
|
65
|
+
[severity] # re-rank rules for your codebase
|
|
66
|
+
PY-PRINT = "LOW"
|
|
67
|
+
"API-NO-AUTH" = "CRITICAL"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Any key not in this list is an error, so a misspelled `disable` can't quietly leave a check on. To silence one line, add a `breakpoint-ignore` comment on it.
|
|
71
|
+
|
|
72
|
+
## CI
|
|
73
|
+
|
|
74
|
+
**GitHub Actions** (findings show up as code-scanning alerts on the PR):
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
name: breakpoint
|
|
78
|
+
on: [pull_request]
|
|
79
|
+
permissions: { contents: read, security-events: write }
|
|
80
|
+
jobs:
|
|
81
|
+
scan:
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v5
|
|
85
|
+
with: { fetch-depth: 0 } # --diff needs history to find the merge-base
|
|
86
|
+
- uses: actions/setup-python@v6
|
|
87
|
+
with: { python-version: "3.12" }
|
|
88
|
+
- run: pip install breakpoint-scan
|
|
89
|
+
- run: breakpoint scan . --diff origin/${{ github.base_ref }} --deps --format sarif -o breakpoint.sarif
|
|
90
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
91
|
+
if: always()
|
|
92
|
+
with: { sarif_file: breakpoint.sarif }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**GitLab / Jenkins / anything else:** `breakpoint scan . --baseline breakpoint-baseline.json --format json -o breakpoint.json`. The exit code is the gate.
|
|
96
|
+
|
|
97
|
+
**pre-commit** (blocks the commit locally):
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
- repo: local
|
|
101
|
+
hooks:
|
|
102
|
+
- id: breakpoint
|
|
103
|
+
name: breakpoint
|
|
104
|
+
entry: breakpoint scan . --diff HEAD
|
|
105
|
+
language: system
|
|
106
|
+
pass_filenames: false
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Reference
|
|
110
|
+
|
|
111
|
+
- Exit codes: `0` pass, `1` a finding at or above `--fail-on`, `2` usage or config error.
|
|
112
|
+
- Output: `--format text|json|sarif`, `-o FILE`.
|
|
113
|
+
- Speed: the per-file pass runs on every CPU (`-j N`), and git repos are listed through `git ls-files` so `.gitignore` is respected. Python's 2,500-file standard library scans in about 5s on 8 cores.
|
|
114
|
+
- Tests: `python test_breakpoint.py`
|
|
115
|
+
- License: MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
breakpoint_scan.py
|
|
4
|
+
pyproject.toml
|
|
5
|
+
breakpoint_scan.egg-info/PKG-INFO
|
|
6
|
+
breakpoint_scan.egg-info/SOURCES.txt
|
|
7
|
+
breakpoint_scan.egg-info/dependency_links.txt
|
|
8
|
+
breakpoint_scan.egg-info/entry_points.txt
|
|
9
|
+
breakpoint_scan.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
breakpoint_scan
|