sec-report-kit 0.2.2__tar.gz → 0.2.3__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.
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.gitignore +9 -0
- sec_report_kit-0.2.3/CHANGELOG.md +28 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/PKG-INFO +62 -4
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/README.md +59 -1
- sec_report_kit-0.2.3/check_assets.py +63 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/pyproject.toml +3 -3
- sec_report_kit-0.2.3/scripts/download_safety_db.bat +13 -0
- sec_report_kit-0.2.3/scripts/download_safety_db.py +125 -0
- sec_report_kit-0.2.3/scripts/download_safety_db.sh +13 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/install_external_clis.py +89 -17
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/install_tools.bat +12 -3
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/install_tools.sh +2 -2
- sec_report_kit-0.2.3/scripts/render_safety_html.bat +27 -0
- sec_report_kit-0.2.3/scripts/render_safety_html.sh +36 -0
- sec_report_kit-0.2.3/scripts/run_safety.bat +60 -0
- sec_report_kit-0.2.3/scripts/run_safety.sh +64 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_unit_tests_with_coverage.bat +2 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_unit_tests_with_coverage.sh +3 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/cli.py +14 -1
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/mcp/server.py +4 -1
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/__init__.py +14 -2
- sec_report_kit-0.2.3/src/sec_report_kit/parsers/safety.py +71 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/tests/test_cli.py +42 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/tests/test_mcp_server.py +23 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/tests/test_parsers.py +39 -0
- sec_report_kit-0.2.2/class_index.html +0 -341
- sec_report_kit-0.2.2/coverage_html_cb_188fc9a4.js +0 -735
- sec_report_kit-0.2.2/favicon_32_cb_c827f16f.png +0 -0
- sec_report_kit-0.2.2/function_index.html +0 -821
- sec_report_kit-0.2.2/index.html +0 -306
- sec_report_kit-0.2.2/keybd_closed_cb_900cfef5.png +0 -0
- sec_report_kit-0.2.2/status.json +0 -1
- sec_report_kit-0.2.2/style_cb_5c747636.css +0 -389
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0___init___py.html +0 -160
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_bandit_py.html +0 -132
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_checkov_py.html +0 -126
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_codeql_py.html +0 -173
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_gitleaks_py.html +0 -139
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_osv_scanner_py.html +0 -157
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_pip_audit_py.html +0 -161
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_semgrep_py.html +0 -139
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_tfsec_py.html +0 -132
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_trivy_py.html +0 -123
- sec_report_kit-0.2.2/z_04615a1dd1ce4db0_trufflehog_py.html +0 -154
- sec_report_kit-0.2.2/z_513b94261226dc0a___init___py.html +0 -98
- sec_report_kit-0.2.2/z_513b94261226dc0a_normalize_py.html +0 -113
- sec_report_kit-0.2.2/z_513b94261226dc0a_summarize_py.html +0 -121
- sec_report_kit-0.2.2/z_79d49abff220d1e3___init___py.html +0 -101
- sec_report_kit-0.2.2/z_79d49abff220d1e3___main___py.html +0 -102
- sec_report_kit-0.2.2/z_79d49abff220d1e3_cli_py.html +0 -317
- sec_report_kit-0.2.2/z_79d49abff220d1e3_models_py.html +0 -113
- sec_report_kit-0.2.2/z_b5cb2d0622dcf19f___init___py.html +0 -98
- sec_report_kit-0.2.2/z_b5cb2d0622dcf19f_html_renderer_py.html +0 -311
- sec_report_kit-0.2.2/z_dc88a0f48bfec113___init___py.html +0 -98
- sec_report_kit-0.2.2/z_dc88a0f48bfec113_server_py.html +0 -191
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.gitattributes +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.github/workflows/pip-audit.yml +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.github/workflows/publish-pypi.yml +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.github/workflows/publish-testpypi.yml +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.github/workflows/trivy-fs-audit.yml +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/.github/workflows/unit-test-coverage-gate.yml +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/bandit-gaps-vs-sast-open-source-tools.md +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_bandit_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_bandit_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_checkov_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_checkov_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_codeql_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_codeql_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_gitleaks_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_gitleaks_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_osv_scanner_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_osv_scanner_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_pip_audit_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_pip_audit_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_semgrep_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_semgrep_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_tfsec_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_tfsec_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_trivy_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_trivy_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_trufflehog_html.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/render_trufflehog_html.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_bandit.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_bandit.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_checkov.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_checkov.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_codeql.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_codeql.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_gitleaks.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_gitleaks.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_osv_scanner.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_osv_scanner.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_pip_audit.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_pip_audit.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_semgrep.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_semgrep.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_tfsec.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_tfsec.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_trivy.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_trivy.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_trufflehog.bat +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/scripts/run_trufflehog.sh +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/__init__.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/__main__.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/mcp/__init__.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/models.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/bandit.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/checkov.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/codeql.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/gitleaks.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/osv_scanner.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/pip_audit.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/semgrep.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/tfsec.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/trivy.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/trufflehog.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/report/__init__.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/report/html_renderer.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/services/__init__.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/services/normalize.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/src/sec_report_kit/services/summarize.py +0 -0
- {sec_report_kit-0.2.2 → sec_report_kit-0.2.3}/tests/test_html_renderer.py +0 -0
|
@@ -36,6 +36,15 @@ pip-delete-this-directory.txt
|
|
|
36
36
|
|
|
37
37
|
# Unit test / coverage reports
|
|
38
38
|
htmlcov/
|
|
39
|
+
class_index.html
|
|
40
|
+
function_index.html
|
|
41
|
+
index.html
|
|
42
|
+
status.json
|
|
43
|
+
coverage_html_*.js
|
|
44
|
+
favicon_32_*.png
|
|
45
|
+
keybd_closed_*.png
|
|
46
|
+
style_*.css
|
|
47
|
+
z_*.html
|
|
39
48
|
.tox/
|
|
40
49
|
.nox/
|
|
41
50
|
.coverage
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.2.3 - 2026-05-13
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Safety CLI parser support and HTML rendering flow.
|
|
9
|
+
- New CLI command: `srk render safety`.
|
|
10
|
+
- MCP support for `source_type="safety"`.
|
|
11
|
+
- Helper scripts for Safety scan and render:
|
|
12
|
+
- `scripts/run_safety.sh`
|
|
13
|
+
- `scripts/run_safety.bat`
|
|
14
|
+
- `scripts/render_safety_html.sh`
|
|
15
|
+
- `scripts/render_safety_html.bat`
|
|
16
|
+
- Offline Safety DB download helpers:
|
|
17
|
+
- `scripts/download_safety_db.py`
|
|
18
|
+
- `scripts/download_safety_db.sh`
|
|
19
|
+
- `scripts/download_safety_db.bat`
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Auto-detection now recognizes Safety JSON payloads.
|
|
23
|
+
- Tool installation scripts now install Safety CLI in the app venv.
|
|
24
|
+
- README updated with Safety usage and offline/local DB workflow guidance.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- Safety run scripts now avoid false success when network failures occur.
|
|
28
|
+
- JSON output validation improved for Safety execution paths.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sec-report-kit
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Generate HTML security reports from Trivy, pip-audit, Bandit, and Gitleaks JSON
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: Generate HTML security reports from Trivy, pip-audit, Safety, Bandit, and Gitleaks JSON
|
|
5
5
|
Author: Ravi Konduru
|
|
6
6
|
License: MIT
|
|
7
|
-
Keywords: cli,mcp,pip-audit,report,security,trivy
|
|
7
|
+
Keywords: cli,mcp,pip-audit,report,safety,security,trivy
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -29,10 +29,13 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
|
|
30
30
|
Generate HTML vulnerability reports from multiple security tools (SAST, SCA, IaC, and secrets) with a CLI and MCP server.
|
|
31
31
|
|
|
32
|
+
Release history: see `CHANGELOG.md`.
|
|
33
|
+
|
|
32
34
|
Supported source types:
|
|
33
35
|
|
|
34
36
|
- `trivy`
|
|
35
37
|
- `pip-audit`
|
|
38
|
+
- `safety`
|
|
36
39
|
- `bandit`
|
|
37
40
|
- `gitleaks`
|
|
38
41
|
- `semgrep`
|
|
@@ -73,6 +76,12 @@ Render pip-audit JSON:
|
|
|
73
76
|
srk render pip-audit --input pip-audit.json --output security_reports/report-pip-audit.html --target requirements.txt
|
|
74
77
|
```
|
|
75
78
|
|
|
79
|
+
Render Safety JSON:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
srk render safety --input security_reports/safety.json --output security_reports/report-safety.html --target requirements.txt
|
|
83
|
+
```
|
|
84
|
+
|
|
76
85
|
## Helper Scripts (bat/sh)
|
|
77
86
|
|
|
78
87
|
Cross-platform helper scripts are available in `scripts/`.
|
|
@@ -115,6 +124,39 @@ scripts\run_pip_audit.bat
|
|
|
115
124
|
scripts\run_pip_audit.bat reports requirements.txt
|
|
116
125
|
```
|
|
117
126
|
|
|
127
|
+
Run Safety CLI and write JSON output:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Linux/macOS (optional args: <report_dir> <requirements_file>)
|
|
131
|
+
bash scripts/run_safety.sh
|
|
132
|
+
bash scripts/run_safety.sh security_reports requirements.txt
|
|
133
|
+
|
|
134
|
+
# Windows (optional args: <report_dir> <requirements_file>)
|
|
135
|
+
scripts\run_safety.bat
|
|
136
|
+
scripts\run_safety.bat security_reports requirements.txt
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
> **Offline / local DB support**: Safety CLI requires network access by default. To enable offline scanning,
|
|
140
|
+
> download the vulnerability DB while online and cache it locally:
|
|
141
|
+
>
|
|
142
|
+
> ```bash
|
|
143
|
+
> # Linux/macOS — download once, reuse offline
|
|
144
|
+
> bash scripts/download_safety_db.sh
|
|
145
|
+
>
|
|
146
|
+
> # Windows
|
|
147
|
+
> scripts\download_safety_db.bat
|
|
148
|
+
> ```
|
|
149
|
+
>
|
|
150
|
+
> ```bash
|
|
151
|
+
> # Corporate/proxy environments with self-signed certificates
|
|
152
|
+
> bash scripts/download_safety_db.sh .tools/safety-db --no-verify-ssl
|
|
153
|
+
> scripts\download_safety_db.bat .tools\safety-db --no-verify-ssl
|
|
154
|
+
> ```
|
|
155
|
+
>
|
|
156
|
+
> The DB is saved to `.tools/safety-db/`. Both `run_safety.sh` and `run_safety.bat` automatically detect
|
|
157
|
+
> and use it on subsequent runs, skipping the network call. Re-run the download script periodically to
|
|
158
|
+
> refresh the DB with the latest vulnerabilities.
|
|
159
|
+
|
|
118
160
|
Run Bandit and write JSON output:
|
|
119
161
|
|
|
120
162
|
```bash
|
|
@@ -139,6 +181,18 @@ scripts\render_pip_audit_html.bat
|
|
|
139
181
|
scripts\render_pip_audit_html.bat reports requirements.txt
|
|
140
182
|
```
|
|
141
183
|
|
|
184
|
+
Convert Safety JSON report to HTML:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Linux/macOS (optional args: <report_dir> <target_name>)
|
|
188
|
+
bash scripts/render_safety_html.sh
|
|
189
|
+
bash scripts/render_safety_html.sh security_reports requirements.txt
|
|
190
|
+
|
|
191
|
+
# Windows (optional args: <report_dir> <target_name>)
|
|
192
|
+
scripts\render_safety_html.bat
|
|
193
|
+
scripts\render_safety_html.bat security_reports requirements.txt
|
|
194
|
+
```
|
|
195
|
+
|
|
142
196
|
These render helpers generate the HTML file and open it automatically in your default browser.
|
|
143
197
|
|
|
144
198
|
Convert sample Trivy JSON report to HTML:
|
|
@@ -189,6 +243,7 @@ The table below reflects what is currently implemented in `scripts/`:
|
|
|
189
243
|
| --- | --- | --- | --- |
|
|
190
244
|
| Trivy | `run_trivy.(sh/bat)` | `render_trivy_html.(sh/bat)` | `security_reports/trivy-image-report-v1.0.21.json` |
|
|
191
245
|
| pip-audit | `run_pip_audit.(sh/bat)` | `render_pip_audit_html.(sh/bat)` | `reports/pip-audit.json` |
|
|
246
|
+
| Safety | `run_safety.(sh/bat)` | `render_safety_html.(sh/bat)` | `security_reports/safety.json` |
|
|
192
247
|
| Bandit | `run_bandit.(sh/bat)` | `render_bandit_html.(sh/bat)` | `security_reports/bandit.json` |
|
|
193
248
|
| Gitleaks | `run_gitleaks.(sh/bat)` | `render_gitleaks_html.(sh/bat)` | `security_reports/gitleaks.json` |
|
|
194
249
|
| Semgrep | `run_semgrep.(sh/bat)` | `render_semgrep_html.(sh/bat)` | `security_reports/semgrep.json` |
|
|
@@ -217,6 +272,7 @@ scripts\render_bandit_html.bat security_reports my-python-project
|
|
|
217
272
|
```bash
|
|
218
273
|
# Linux/macOS
|
|
219
274
|
bash scripts/run_trivy.sh security_reports alpine:latest
|
|
275
|
+
bash scripts/run_safety.sh security_reports requirements.txt
|
|
220
276
|
bash scripts/run_gitleaks.sh security_reports .
|
|
221
277
|
bash scripts/run_semgrep.sh security_reports .
|
|
222
278
|
bash scripts/run_codeql.sh security_reports codeql-db codeql/python-queries
|
|
@@ -227,6 +283,7 @@ bash scripts/run_trufflehog.sh security_reports .
|
|
|
227
283
|
|
|
228
284
|
# Windows
|
|
229
285
|
scripts\run_trivy.bat security_reports alpine:latest
|
|
286
|
+
scripts\run_safety.bat security_reports requirements.txt
|
|
230
287
|
scripts\run_gitleaks.bat security_reports .
|
|
231
288
|
scripts\run_semgrep.bat security_reports .
|
|
232
289
|
scripts\run_codeql.bat security_reports codeql-db codeql/python-queries
|
|
@@ -262,6 +319,7 @@ Manual CLI render examples:
|
|
|
262
319
|
srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
|
|
263
320
|
srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
|
|
264
321
|
srk render osv-scanner --input security_reports/osv-scanner.json --output security_reports/osv-scanner-report.html --target requirements.txt
|
|
322
|
+
srk render safety --input security_reports/safety.json --output security_reports/safety-report.html --target requirements.txt
|
|
265
323
|
srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
|
|
266
324
|
srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
|
|
267
325
|
srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
|
|
@@ -286,7 +344,7 @@ srk mcp serve --transport stdio
|
|
|
286
344
|
| `render_report_from_json` | Parse JSON and render an HTML report to disk |
|
|
287
345
|
| `validate_input` | Validate that a JSON file is parseable and return finding count |
|
|
288
346
|
|
|
289
|
-
All tools accept `source_type` (`"trivy"`, `"pip-audit"`, `"bandit"`, `"gitleaks"`, `"semgrep"`, `"codeql"`, `"osv-scanner"`, `"checkov"`, `"tfsec"`, `"trufflehog"`, or `"auto"`) and `input_path` (absolute path to JSON file).
|
|
347
|
+
All tools accept `source_type` (`"trivy"`, `"pip-audit"`, `"safety"`, `"bandit"`, `"gitleaks"`, `"semgrep"`, `"codeql"`, `"osv-scanner"`, `"checkov"`, `"tfsec"`, `"trufflehog"`, or `"auto"`) and `input_path` (absolute path to JSON file).
|
|
290
348
|
|
|
291
349
|
---
|
|
292
350
|
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Generate HTML vulnerability reports from multiple security tools (SAST, SCA, IaC, and secrets) with a CLI and MCP server.
|
|
4
4
|
|
|
5
|
+
Release history: see `CHANGELOG.md`.
|
|
6
|
+
|
|
5
7
|
Supported source types:
|
|
6
8
|
|
|
7
9
|
- `trivy`
|
|
8
10
|
- `pip-audit`
|
|
11
|
+
- `safety`
|
|
9
12
|
- `bandit`
|
|
10
13
|
- `gitleaks`
|
|
11
14
|
- `semgrep`
|
|
@@ -46,6 +49,12 @@ Render pip-audit JSON:
|
|
|
46
49
|
srk render pip-audit --input pip-audit.json --output security_reports/report-pip-audit.html --target requirements.txt
|
|
47
50
|
```
|
|
48
51
|
|
|
52
|
+
Render Safety JSON:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
srk render safety --input security_reports/safety.json --output security_reports/report-safety.html --target requirements.txt
|
|
56
|
+
```
|
|
57
|
+
|
|
49
58
|
## Helper Scripts (bat/sh)
|
|
50
59
|
|
|
51
60
|
Cross-platform helper scripts are available in `scripts/`.
|
|
@@ -88,6 +97,39 @@ scripts\run_pip_audit.bat
|
|
|
88
97
|
scripts\run_pip_audit.bat reports requirements.txt
|
|
89
98
|
```
|
|
90
99
|
|
|
100
|
+
Run Safety CLI and write JSON output:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Linux/macOS (optional args: <report_dir> <requirements_file>)
|
|
104
|
+
bash scripts/run_safety.sh
|
|
105
|
+
bash scripts/run_safety.sh security_reports requirements.txt
|
|
106
|
+
|
|
107
|
+
# Windows (optional args: <report_dir> <requirements_file>)
|
|
108
|
+
scripts\run_safety.bat
|
|
109
|
+
scripts\run_safety.bat security_reports requirements.txt
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> **Offline / local DB support**: Safety CLI requires network access by default. To enable offline scanning,
|
|
113
|
+
> download the vulnerability DB while online and cache it locally:
|
|
114
|
+
>
|
|
115
|
+
> ```bash
|
|
116
|
+
> # Linux/macOS — download once, reuse offline
|
|
117
|
+
> bash scripts/download_safety_db.sh
|
|
118
|
+
>
|
|
119
|
+
> # Windows
|
|
120
|
+
> scripts\download_safety_db.bat
|
|
121
|
+
> ```
|
|
122
|
+
>
|
|
123
|
+
> ```bash
|
|
124
|
+
> # Corporate/proxy environments with self-signed certificates
|
|
125
|
+
> bash scripts/download_safety_db.sh .tools/safety-db --no-verify-ssl
|
|
126
|
+
> scripts\download_safety_db.bat .tools\safety-db --no-verify-ssl
|
|
127
|
+
> ```
|
|
128
|
+
>
|
|
129
|
+
> The DB is saved to `.tools/safety-db/`. Both `run_safety.sh` and `run_safety.bat` automatically detect
|
|
130
|
+
> and use it on subsequent runs, skipping the network call. Re-run the download script periodically to
|
|
131
|
+
> refresh the DB with the latest vulnerabilities.
|
|
132
|
+
|
|
91
133
|
Run Bandit and write JSON output:
|
|
92
134
|
|
|
93
135
|
```bash
|
|
@@ -112,6 +154,18 @@ scripts\render_pip_audit_html.bat
|
|
|
112
154
|
scripts\render_pip_audit_html.bat reports requirements.txt
|
|
113
155
|
```
|
|
114
156
|
|
|
157
|
+
Convert Safety JSON report to HTML:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Linux/macOS (optional args: <report_dir> <target_name>)
|
|
161
|
+
bash scripts/render_safety_html.sh
|
|
162
|
+
bash scripts/render_safety_html.sh security_reports requirements.txt
|
|
163
|
+
|
|
164
|
+
# Windows (optional args: <report_dir> <target_name>)
|
|
165
|
+
scripts\render_safety_html.bat
|
|
166
|
+
scripts\render_safety_html.bat security_reports requirements.txt
|
|
167
|
+
```
|
|
168
|
+
|
|
115
169
|
These render helpers generate the HTML file and open it automatically in your default browser.
|
|
116
170
|
|
|
117
171
|
Convert sample Trivy JSON report to HTML:
|
|
@@ -162,6 +216,7 @@ The table below reflects what is currently implemented in `scripts/`:
|
|
|
162
216
|
| --- | --- | --- | --- |
|
|
163
217
|
| Trivy | `run_trivy.(sh/bat)` | `render_trivy_html.(sh/bat)` | `security_reports/trivy-image-report-v1.0.21.json` |
|
|
164
218
|
| pip-audit | `run_pip_audit.(sh/bat)` | `render_pip_audit_html.(sh/bat)` | `reports/pip-audit.json` |
|
|
219
|
+
| Safety | `run_safety.(sh/bat)` | `render_safety_html.(sh/bat)` | `security_reports/safety.json` |
|
|
165
220
|
| Bandit | `run_bandit.(sh/bat)` | `render_bandit_html.(sh/bat)` | `security_reports/bandit.json` |
|
|
166
221
|
| Gitleaks | `run_gitleaks.(sh/bat)` | `render_gitleaks_html.(sh/bat)` | `security_reports/gitleaks.json` |
|
|
167
222
|
| Semgrep | `run_semgrep.(sh/bat)` | `render_semgrep_html.(sh/bat)` | `security_reports/semgrep.json` |
|
|
@@ -190,6 +245,7 @@ scripts\render_bandit_html.bat security_reports my-python-project
|
|
|
190
245
|
```bash
|
|
191
246
|
# Linux/macOS
|
|
192
247
|
bash scripts/run_trivy.sh security_reports alpine:latest
|
|
248
|
+
bash scripts/run_safety.sh security_reports requirements.txt
|
|
193
249
|
bash scripts/run_gitleaks.sh security_reports .
|
|
194
250
|
bash scripts/run_semgrep.sh security_reports .
|
|
195
251
|
bash scripts/run_codeql.sh security_reports codeql-db codeql/python-queries
|
|
@@ -200,6 +256,7 @@ bash scripts/run_trufflehog.sh security_reports .
|
|
|
200
256
|
|
|
201
257
|
# Windows
|
|
202
258
|
scripts\run_trivy.bat security_reports alpine:latest
|
|
259
|
+
scripts\run_safety.bat security_reports requirements.txt
|
|
203
260
|
scripts\run_gitleaks.bat security_reports .
|
|
204
261
|
scripts\run_semgrep.bat security_reports .
|
|
205
262
|
scripts\run_codeql.bat security_reports codeql-db codeql/python-queries
|
|
@@ -235,6 +292,7 @@ Manual CLI render examples:
|
|
|
235
292
|
srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
|
|
236
293
|
srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
|
|
237
294
|
srk render osv-scanner --input security_reports/osv-scanner.json --output security_reports/osv-scanner-report.html --target requirements.txt
|
|
295
|
+
srk render safety --input security_reports/safety.json --output security_reports/safety-report.html --target requirements.txt
|
|
238
296
|
srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
|
|
239
297
|
srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
|
|
240
298
|
srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
|
|
@@ -259,7 +317,7 @@ srk mcp serve --transport stdio
|
|
|
259
317
|
| `render_report_from_json` | Parse JSON and render an HTML report to disk |
|
|
260
318
|
| `validate_input` | Validate that a JSON file is parseable and return finding count |
|
|
261
319
|
|
|
262
|
-
All tools accept `source_type` (`"trivy"`, `"pip-audit"`, `"bandit"`, `"gitleaks"`, `"semgrep"`, `"codeql"`, `"osv-scanner"`, `"checkov"`, `"tfsec"`, `"trufflehog"`, or `"auto"`) and `input_path` (absolute path to JSON file).
|
|
320
|
+
All tools accept `source_type` (`"trivy"`, `"pip-audit"`, `"safety"`, `"bandit"`, `"gitleaks"`, `"semgrep"`, `"codeql"`, `"osv-scanner"`, `"checkov"`, `"tfsec"`, `"trufflehog"`, or `"auto"`) and `input_path` (absolute path to JSON file).
|
|
263
321
|
|
|
264
322
|
---
|
|
265
323
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import json
|
|
4
|
+
import re
|
|
5
|
+
import urllib.request
|
|
6
|
+
|
|
7
|
+
tool_matrix = {
|
|
8
|
+
"codeql": {
|
|
9
|
+
"repo": "github/codeql-action",
|
|
10
|
+
"patterns": [r"codeql-bundle-win64\.tar\.gz$", r"codeql-bundle-win64\.zip$"],
|
|
11
|
+
},
|
|
12
|
+
"tfsec": {
|
|
13
|
+
"repo": "aquasecurity/tfsec",
|
|
14
|
+
"patterns": [r"tfsec-windows-amd64(?:\.exe)?$"],
|
|
15
|
+
},
|
|
16
|
+
"gitleaks": {
|
|
17
|
+
"repo": "gitleaks/gitleaks",
|
|
18
|
+
"patterns": [r"gitleaks_.*_windows_x64\.zip$"],
|
|
19
|
+
},
|
|
20
|
+
"trufflehog": {
|
|
21
|
+
"repo": "trufflesecurity/trufflehog",
|
|
22
|
+
"patterns": [r"trufflehog_.*_windows_amd64\.tar\.gz$", r"trufflehog_.*_windows_amd64\.zip$"],
|
|
23
|
+
},
|
|
24
|
+
"osv-scanner": {
|
|
25
|
+
"repo": "google/osv-scanner",
|
|
26
|
+
"patterns": [r"osv-scanner_.*_windows_amd64(?:\.exe)?(?:\.zip)?$", r"osv-scanner-windows-amd64(?:\.exe)?$"],
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def check_tools():
|
|
31
|
+
for tool_name, cfg in tool_matrix.items():
|
|
32
|
+
repo = cfg["repo"]
|
|
33
|
+
patterns = cfg["patterns"]
|
|
34
|
+
try:
|
|
35
|
+
req = urllib.request.Request(
|
|
36
|
+
f"https://api.github.com/repos/{repo}/releases/latest",
|
|
37
|
+
headers={"Accept": "application/vnd.github+json", "User-Agent": "python-check-script"},
|
|
38
|
+
)
|
|
39
|
+
with urllib.request.urlopen(req, timeout=30) as resp:
|
|
40
|
+
release = json.load(resp)
|
|
41
|
+
|
|
42
|
+
assets = [a["name"] for a in release.get("assets", [])]
|
|
43
|
+
match_found = False
|
|
44
|
+
for pattern in patterns:
|
|
45
|
+
regex = re.compile(pattern)
|
|
46
|
+
for asset in assets:
|
|
47
|
+
if regex.search(asset):
|
|
48
|
+
print(f"{tool_name}: PASS (Matched asset: {asset})")
|
|
49
|
+
match_found = True
|
|
50
|
+
break
|
|
51
|
+
if match_found:
|
|
52
|
+
break
|
|
53
|
+
|
|
54
|
+
if not match_found:
|
|
55
|
+
print(f"{tool_name}: FAIL (No asset matched patterns)")
|
|
56
|
+
# Print available assets for debugging if call fails
|
|
57
|
+
# print(f" Available: {assets[:3]}...")
|
|
58
|
+
|
|
59
|
+
except Exception as e:
|
|
60
|
+
print(f"{tool_name}: FAIL (Error: {e})")
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
check_tools()
|
|
@@ -4,13 +4,13 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sec-report-kit"
|
|
7
|
-
version = "0.2.
|
|
8
|
-
description = "Generate HTML security reports from Trivy, pip-audit, Bandit, and Gitleaks JSON"
|
|
7
|
+
version = "0.2.3"
|
|
8
|
+
description = "Generate HTML security reports from Trivy, pip-audit, Safety, Bandit, and Gitleaks JSON"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = { text = "MIT" }
|
|
12
12
|
authors = [{ name = "Ravi Konduru" }]
|
|
13
|
-
keywords = ["security", "trivy", "pip-audit", "mcp", "cli", "report"]
|
|
13
|
+
keywords = ["security", "trivy", "pip-audit", "safety", "mcp", "cli", "report"]
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Development Status :: 3 - Alpha",
|
|
16
16
|
"Intended Audience :: Developers",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
|
|
4
|
+
set "PYTHON_BIN=python"
|
|
5
|
+
if exist "%~dp0..\.venv\Scripts\python.exe" set "PYTHON_BIN=%~dp0..\.venv\Scripts\python.exe"
|
|
6
|
+
|
|
7
|
+
set "OUTPUT_DIR=%~1"
|
|
8
|
+
if "%OUTPUT_DIR%"=="" set "OUTPUT_DIR=.tools\safety-db"
|
|
9
|
+
|
|
10
|
+
rem Pass remaining flags (e.g. --full, --no-verify-ssl) directly to the Python script
|
|
11
|
+
"%PYTHON_BIN%" "%~dp0download_safety_db.py" --output-dir "%OUTPUT_DIR%" %2 %3 %4
|
|
12
|
+
|
|
13
|
+
exit /b %ERRORLEVEL%
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Download the Safety CLI vulnerability database (schema 2.0.0) for offline use.
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
python scripts/download_safety_db.py [--output-dir .tools/safety-db] [--no-verify-ssl]
|
|
6
|
+
|
|
7
|
+
The script downloads insecure.json (and optionally insecure_full.json) from the
|
|
8
|
+
Safety free open mirror and saves them to a local directory that can be passed
|
|
9
|
+
to `safety check --db <dir>` for offline scanning.
|
|
10
|
+
"""
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import ssl
|
|
14
|
+
import sys
|
|
15
|
+
import urllib.request
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
OPEN_MIRROR = "https://pyup.io/aws/safety/free/2.0.0/"
|
|
19
|
+
SCHEMA_VERSION = "2.0.0"
|
|
20
|
+
DB_FILES = ["insecure.json", "insecure_full.json"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _make_ssl_context(verify: bool) -> ssl.SSLContext:
|
|
24
|
+
if verify:
|
|
25
|
+
ctx = ssl.create_default_context()
|
|
26
|
+
# Try to load certifi certs if available (helps in corporate environments)
|
|
27
|
+
try:
|
|
28
|
+
import certifi # type: ignore[import]
|
|
29
|
+
ctx = ssl.create_default_context(cafile=certifi.where())
|
|
30
|
+
except ImportError:
|
|
31
|
+
pass
|
|
32
|
+
else:
|
|
33
|
+
ctx = ssl.create_default_context()
|
|
34
|
+
ctx.check_hostname = False
|
|
35
|
+
ctx.verify_mode = ssl.CERT_NONE
|
|
36
|
+
return ctx
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def download_db(output_dir: str = ".tools/safety-db", full: bool = False, verify_ssl: bool = True) -> int:
|
|
40
|
+
"""
|
|
41
|
+
Download Safety vulnerability DB files to *output_dir*.
|
|
42
|
+
|
|
43
|
+
Returns 0 on success, 1 on failure.
|
|
44
|
+
"""
|
|
45
|
+
dest = Path(output_dir)
|
|
46
|
+
dest.mkdir(parents=True, exist_ok=True)
|
|
47
|
+
|
|
48
|
+
files_to_download = DB_FILES if full else [DB_FILES[0]]
|
|
49
|
+
|
|
50
|
+
headers = {
|
|
51
|
+
"schema-version": SCHEMA_VERSION,
|
|
52
|
+
"ecosystem": "python",
|
|
53
|
+
"User-Agent": "sec-report-kit/1.0 safety-db-downloader",
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ssl_ctx = _make_ssl_context(verify_ssl)
|
|
57
|
+
if not verify_ssl:
|
|
58
|
+
import warnings
|
|
59
|
+
warnings.warn("SSL certificate verification is disabled.", UserWarning, stacklevel=2)
|
|
60
|
+
|
|
61
|
+
success = True
|
|
62
|
+
for db_file in files_to_download:
|
|
63
|
+
url = OPEN_MIRROR + db_file
|
|
64
|
+
dest_file = dest / db_file
|
|
65
|
+
print(f"Downloading {url} ...", end=" ", flush=True)
|
|
66
|
+
try:
|
|
67
|
+
req = urllib.request.Request(url, headers=headers)
|
|
68
|
+
with urllib.request.urlopen(req, timeout=30, context=ssl_ctx) as response:
|
|
69
|
+
raw = response.read()
|
|
70
|
+
|
|
71
|
+
# Validate JSON and schema version
|
|
72
|
+
data = json.loads(raw)
|
|
73
|
+
schema = (data.get("meta") or {}).get("schema_version", "unknown")
|
|
74
|
+
if schema != SCHEMA_VERSION:
|
|
75
|
+
print(f"FAIL (unexpected schema version: {schema})")
|
|
76
|
+
success = False
|
|
77
|
+
continue
|
|
78
|
+
|
|
79
|
+
dest_file.write_bytes(raw)
|
|
80
|
+
size_kb = len(raw) // 1024
|
|
81
|
+
print(f"OK ({size_kb} KB, schema {schema})")
|
|
82
|
+
|
|
83
|
+
except Exception as exc:
|
|
84
|
+
print(f"FAIL ({exc})")
|
|
85
|
+
success = False
|
|
86
|
+
|
|
87
|
+
if success:
|
|
88
|
+
print(f"\nSafety DB saved to: {dest.resolve()}")
|
|
89
|
+
print(f"Use it with: safety check --db \"{dest.resolve()}\"")
|
|
90
|
+
else:
|
|
91
|
+
print("\nOne or more files failed to download.", file=sys.stderr)
|
|
92
|
+
if verify_ssl:
|
|
93
|
+
print(
|
|
94
|
+
"If you are behind a corporate proxy, try adding --no-verify-ssl",
|
|
95
|
+
file=sys.stderr,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return 0 if success else 1
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def main() -> int:
|
|
102
|
+
parser = argparse.ArgumentParser(
|
|
103
|
+
description="Download Safety CLI vulnerability DB for offline use."
|
|
104
|
+
)
|
|
105
|
+
parser.add_argument(
|
|
106
|
+
"--output-dir",
|
|
107
|
+
default=".tools/safety-db",
|
|
108
|
+
help="Directory to save DB files (default: .tools/safety-db)",
|
|
109
|
+
)
|
|
110
|
+
parser.add_argument(
|
|
111
|
+
"--full",
|
|
112
|
+
action="store_true",
|
|
113
|
+
help="Also download insecure_full.json (larger, includes CVE descriptions)",
|
|
114
|
+
)
|
|
115
|
+
parser.add_argument(
|
|
116
|
+
"--no-verify-ssl",
|
|
117
|
+
action="store_true",
|
|
118
|
+
help="Disable SSL certificate verification (use in corporate/proxy environments)",
|
|
119
|
+
)
|
|
120
|
+
args = parser.parse_args()
|
|
121
|
+
return download_db(output_dir=args.output_dir, full=args.full, verify_ssl=not args.no_verify_ssl)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if __name__ == "__main__":
|
|
125
|
+
sys.exit(main())
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
PYTHON_BIN="${PYTHON_BIN:-python}"
|
|
5
|
+
if [[ -x "$(dirname "$0")/../.venv/bin/python" ]]; then
|
|
6
|
+
PYTHON_BIN="$(dirname "$0")/../.venv/bin/python"
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
OUTPUT_DIR="${1:-.tools/safety-db}"
|
|
10
|
+
shift || true
|
|
11
|
+
|
|
12
|
+
# Pass remaining flags (e.g. --full, --no-verify-ssl) directly to the Python script
|
|
13
|
+
"${PYTHON_BIN}" "$(dirname "$0")/download_safety_db.py" --output-dir "${OUTPUT_DIR}" "$@"
|