sec-report-kit 0.2.1__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.
Files changed (93) hide show
  1. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.gitignore +9 -0
  2. sec_report_kit-0.2.3/CHANGELOG.md +28 -0
  3. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/PKG-INFO +156 -24
  4. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/README.md +153 -21
  5. sec_report_kit-0.2.3/check_assets.py +63 -0
  6. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/pyproject.toml +3 -3
  7. sec_report_kit-0.2.3/scripts/download_safety_db.bat +13 -0
  8. sec_report_kit-0.2.3/scripts/download_safety_db.py +125 -0
  9. sec_report_kit-0.2.3/scripts/download_safety_db.sh +13 -0
  10. sec_report_kit-0.2.3/scripts/install_external_clis.py +286 -0
  11. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/install_tools.bat +19 -3
  12. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/install_tools.sh +6 -3
  13. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_bandit_html.bat +1 -1
  14. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_bandit_html.sh +2 -1
  15. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_checkov_html.bat +1 -1
  16. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_checkov_html.sh +2 -1
  17. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_codeql_html.bat +1 -1
  18. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_codeql_html.sh +2 -1
  19. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_gitleaks_html.bat +1 -1
  20. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_gitleaks_html.sh +2 -1
  21. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_osv_scanner_html.bat +1 -1
  22. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_osv_scanner_html.sh +2 -1
  23. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_pip_audit_html.bat +1 -1
  24. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_pip_audit_html.sh +2 -1
  25. sec_report_kit-0.2.3/scripts/render_safety_html.bat +27 -0
  26. sec_report_kit-0.2.3/scripts/render_safety_html.sh +36 -0
  27. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_semgrep_html.bat +1 -1
  28. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_semgrep_html.sh +2 -1
  29. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_tfsec_html.bat +1 -1
  30. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_tfsec_html.sh +2 -1
  31. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_trivy_html.bat +1 -1
  32. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_trivy_html.sh +2 -1
  33. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_trufflehog_html.bat +1 -1
  34. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/render_trufflehog_html.sh +2 -1
  35. sec_report_kit-0.2.3/scripts/run_bandit.bat +34 -0
  36. sec_report_kit-0.2.3/scripts/run_bandit.sh +35 -0
  37. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_codeql.sh +7 -2
  38. sec_report_kit-0.2.3/scripts/run_gitleaks.bat +35 -0
  39. sec_report_kit-0.2.3/scripts/run_gitleaks.sh +35 -0
  40. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_osv_scanner.sh +7 -2
  41. sec_report_kit-0.2.3/scripts/run_safety.bat +60 -0
  42. sec_report_kit-0.2.3/scripts/run_safety.sh +64 -0
  43. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_tfsec.sh +7 -2
  44. sec_report_kit-0.2.3/scripts/run_trivy.bat +27 -0
  45. sec_report_kit-0.2.3/scripts/run_trivy.sh +23 -0
  46. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_trufflehog.sh +7 -2
  47. sec_report_kit-0.2.3/scripts/run_unit_tests_with_coverage.bat +27 -0
  48. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_unit_tests_with_coverage.sh +3 -0
  49. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/__init__.py +1 -1
  50. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/cli.py +14 -1
  51. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/mcp/server.py +4 -1
  52. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/__init__.py +14 -2
  53. sec_report_kit-0.2.3/src/sec_report_kit/parsers/safety.py +71 -0
  54. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/tests/test_cli.py +42 -0
  55. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/tests/test_mcp_server.py +23 -0
  56. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/tests/test_parsers.py +39 -0
  57. sec_report_kit-0.2.1/scripts/run_unit_tests_with_coverage.bat +0 -14
  58. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.gitattributes +0 -0
  59. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.github/workflows/pip-audit.yml +0 -0
  60. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.github/workflows/publish-pypi.yml +0 -0
  61. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.github/workflows/publish-testpypi.yml +0 -0
  62. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.github/workflows/trivy-fs-audit.yml +0 -0
  63. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/.github/workflows/unit-test-coverage-gate.yml +0 -0
  64. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/bandit-gaps-vs-sast-open-source-tools.md +0 -0
  65. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_checkov.bat +0 -0
  66. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_checkov.sh +0 -0
  67. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_codeql.bat +0 -0
  68. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_osv_scanner.bat +0 -0
  69. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_pip_audit.bat +0 -0
  70. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_pip_audit.sh +0 -0
  71. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_semgrep.bat +0 -0
  72. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_semgrep.sh +0 -0
  73. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_tfsec.bat +0 -0
  74. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/scripts/run_trufflehog.bat +0 -0
  75. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/__main__.py +0 -0
  76. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/mcp/__init__.py +0 -0
  77. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/models.py +0 -0
  78. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/bandit.py +0 -0
  79. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/checkov.py +0 -0
  80. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/codeql.py +0 -0
  81. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/gitleaks.py +0 -0
  82. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/osv_scanner.py +0 -0
  83. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/pip_audit.py +0 -0
  84. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/semgrep.py +0 -0
  85. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/tfsec.py +0 -0
  86. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/trivy.py +0 -0
  87. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/parsers/trufflehog.py +0 -0
  88. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/report/__init__.py +0 -0
  89. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/report/html_renderer.py +0 -0
  90. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/services/__init__.py +0 -0
  91. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/services/normalize.py +0 -0
  92. {sec_report_kit-0.2.1 → sec_report_kit-0.2.3}/src/sec_report_kit/services/summarize.py +0 -0
  93. {sec_report_kit-0.2.1 → 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.1
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,10 +76,18 @@ 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/`.
79
88
 
89
+ When render helpers are called without an explicit `<target_name>`, they automatically use the repository root folder name as the report target label.
90
+
80
91
  Install this package and Python-installable scanners:
81
92
 
82
93
  ```bash
@@ -87,7 +98,7 @@ bash scripts/install_tools.sh
87
98
  scripts\install_tools.bat
88
99
  ```
89
100
 
90
- After cloning on a new machine, run the install script above to recreate the local `.tools/` directory and download required binaries. The `.tools/` folder is intentionally not committed to git.
101
+ After cloning on a new machine, run the install script above to recreate the local `.tools/` directory and install required external CLI binaries (`codeql`, `tfsec`, `gitleaks`, `trufflehog`, `osv-scanner`) alongside Python dependencies. The `.tools/` folder is intentionally not committed to git.
91
102
 
92
103
  Run all unit tests locally with coverage:
93
104
 
@@ -113,6 +124,51 @@ scripts\run_pip_audit.bat
113
124
  scripts\run_pip_audit.bat reports requirements.txt
114
125
  ```
115
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
+
160
+ Run Bandit and write JSON output:
161
+
162
+ ```bash
163
+ # Linux/macOS (optional args: <report_dir> <target_path>)
164
+ bash scripts/run_bandit.sh
165
+ bash scripts/run_bandit.sh security_reports src
166
+
167
+ # Windows (optional args: <report_dir> <target_path>)
168
+ scripts\run_bandit.bat
169
+ scripts\run_bandit.bat security_reports src
170
+ ```
171
+
116
172
  Convert pip-audit JSON report to HTML:
117
173
 
118
174
  ```bash
@@ -125,6 +181,18 @@ scripts\render_pip_audit_html.bat
125
181
  scripts\render_pip_audit_html.bat reports requirements.txt
126
182
  ```
127
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
+
128
196
  These render helpers generate the HTML file and open it automatically in your default browser.
129
197
 
130
198
  Convert sample Trivy JSON report to HTML:
@@ -167,37 +235,99 @@ By default, JSON is written to `reports/pip-audit.json` and HTML to `reports/pip
167
235
 
168
236
  ## Additional Tool Workflows
169
237
 
170
- Each workflow has paired run and render scripts in `scripts/`:
238
+ ### Script Coverage Matrix
171
239
 
172
- - Semgrep: `run_semgrep.(sh|bat)` and `render_semgrep_html.(sh|bat)`
173
- - CodeQL: `run_codeql.(sh|bat)` and `render_codeql_html.(sh|bat)`
174
- - OSV-Scanner: `run_osv_scanner.(sh|bat)` and `render_osv_scanner_html.(sh|bat)`
175
- - Checkov: `run_checkov.(sh|bat)` and `render_checkov_html.(sh|bat)`
176
- - tfsec: `run_tfsec.(sh|bat)` and `render_tfsec_html.(sh|bat)`
177
- - TruffleHog: `run_trufflehog.(sh|bat)` and `render_trufflehog_html.(sh|bat)`
240
+ The table below reflects what is currently implemented in `scripts/`:
178
241
 
179
- Manual CLI render examples:
242
+ | Tool | Run Script (JSON/SARIF) | Render Script (HTML) | Default JSON/SARIF Output |
243
+ | --- | --- | --- | --- |
244
+ | Trivy | `run_trivy.(sh/bat)` | `render_trivy_html.(sh/bat)` | `security_reports/trivy-image-report-v1.0.21.json` |
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` |
247
+ | Bandit | `run_bandit.(sh/bat)` | `render_bandit_html.(sh/bat)` | `security_reports/bandit.json` |
248
+ | Gitleaks | `run_gitleaks.(sh/bat)` | `render_gitleaks_html.(sh/bat)` | `security_reports/gitleaks.json` |
249
+ | Semgrep | `run_semgrep.(sh/bat)` | `render_semgrep_html.(sh/bat)` | `security_reports/semgrep.json` |
250
+ | CodeQL | `run_codeql.(sh/bat)` | `render_codeql_html.(sh/bat)` | `security_reports/codeql.sarif.json` |
251
+ | OSV-Scanner | `run_osv_scanner.(sh/bat)` | `render_osv_scanner_html.(sh/bat)` | `security_reports/osv-scanner.json` |
252
+ | Checkov | `run_checkov.(sh/bat)` | `render_checkov_html.(sh/bat)` | `security_reports/checkov.json` |
253
+ | tfsec | `run_tfsec.(sh/bat)` | `render_tfsec_html.(sh/bat)` | `security_reports/tfsec.json` |
254
+ | TruffleHog | `run_trufflehog.(sh/bat)` | `render_trufflehog_html.(sh/bat)` | `security_reports/trufflehog.json` |
255
+
256
+ ### Bandit End-To-End Example
257
+
258
+ Generate JSON first, then render HTML:
180
259
 
181
260
  ```bash
182
- srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
183
- srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
184
- srk render osv-scanner --input security_reports/osv-scanner.json --output security_reports/osv-scanner-report.html --target requirements.txt
185
- srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
186
- srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
187
- srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
261
+ # Linux/macOS
262
+ bash scripts/run_bandit.sh security_reports src
263
+ bash scripts/render_bandit_html.sh security_reports my-python-project
264
+
265
+ # Windows
266
+ scripts\run_bandit.bat security_reports src
267
+ scripts\render_bandit_html.bat security_reports my-python-project
268
+ ```
269
+
270
+ ### Other Run Script Usage
271
+
272
+ ```bash
273
+ # Linux/macOS
274
+ bash scripts/run_trivy.sh security_reports alpine:latest
275
+ bash scripts/run_safety.sh security_reports requirements.txt
276
+ bash scripts/run_gitleaks.sh security_reports .
277
+ bash scripts/run_semgrep.sh security_reports .
278
+ bash scripts/run_codeql.sh security_reports codeql-db codeql/python-queries
279
+ bash scripts/run_osv_scanner.sh security_reports .
280
+ bash scripts/run_checkov.sh security_reports .
281
+ bash scripts/run_tfsec.sh security_reports .
282
+ bash scripts/run_trufflehog.sh security_reports .
283
+
284
+ # Windows
285
+ scripts\run_trivy.bat security_reports alpine:latest
286
+ scripts\run_safety.bat security_reports requirements.txt
287
+ scripts\run_gitleaks.bat security_reports .
288
+ scripts\run_semgrep.bat security_reports .
289
+ scripts\run_codeql.bat security_reports codeql-db codeql/python-queries
290
+ scripts\run_osv_scanner.bat security_reports .
291
+ scripts\run_checkov.bat security_reports .
292
+ scripts\run_tfsec.bat security_reports .
293
+ scripts\run_trufflehog.bat security_reports .
188
294
  ```
189
295
 
190
- Render Bandit JSON:
296
+ ### Trivy and Gitleaks End-To-End
297
+
298
+ Generate JSON and then render HTML using wrapper scripts:
191
299
 
192
300
  ```bash
193
- srk render bandit --input bandit-report.json --output security_reports/report-bandit.html --target my-python-project
301
+ # Linux/macOS
302
+ bash scripts/run_trivy.sh security_reports your-image:tag
303
+ bash scripts/render_trivy_html.sh security_reports your-image:tag
304
+
305
+ bash scripts/run_gitleaks.sh security_reports .
306
+ bash scripts/render_gitleaks_html.sh security_reports my-repository
307
+
308
+ # Windows
309
+ scripts\run_trivy.bat security_reports your-image:tag
310
+ scripts\render_trivy_html.bat security_reports your-image:tag
311
+
312
+ scripts\run_gitleaks.bat security_reports .
313
+ scripts\render_gitleaks_html.bat security_reports my-repository
194
314
  ```
195
315
 
196
- Render Gitleaks JSON:
316
+ Manual CLI render examples:
197
317
 
198
318
  ```bash
199
- srk render gitleaks --input gitleaks-report.json --output security_reports/report-gitleaks.html --target my-repository
319
+ srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
320
+ srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
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
323
+ srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
324
+ srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
325
+ srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
326
+ srk render bandit --input security_reports/bandit.json --output security_reports/bandit-report.html --target my-python-project
327
+ srk render gitleaks --input security_reports/gitleaks.json --output security_reports/gitleaks-report.html --target my-repository
328
+ srk render trivy --input security_reports/trivy-image-report-v1.0.21.json --output security_reports/trivy-report.html --target my-image
200
329
  ```
330
+
201
331
  ## MCP Server
202
332
 
203
333
  Run MCP server over stdio:
@@ -209,12 +339,12 @@ srk mcp serve --transport stdio
209
339
  ### Available MCP Tools
210
340
 
211
341
  | Tool | Description |
212
- |---|---|
342
+ | --- | --- |
213
343
  | `summarize_json` | Summarize vulnerabilities by severity from a JSON file |
214
344
  | `render_report_from_json` | Parse JSON and render an HTML report to disk |
215
345
  | `validate_input` | Validate that a JSON file is parseable and return finding count |
216
346
 
217
- 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).
218
348
 
219
349
  ---
220
350
 
@@ -307,6 +437,7 @@ Edit `~/.codeium/windsurf/mcp_config.json`:
307
437
  If the package is installed in a `.venv`, use the full path to avoid PATH issues:
308
438
 
309
439
  **Windows:**
440
+
310
441
  ```json
311
442
  {
312
443
  "command": "C:/MyProjects/sec-report-kit/.venv/Scripts/srk.exe",
@@ -315,6 +446,7 @@ If the package is installed in a `.venv`, use the full path to avoid PATH issues
315
446
  ```
316
447
 
317
448
  **macOS / Linux:**
449
+
318
450
  ```json
319
451
  {
320
452
  "command": "/home/user/sec-report-kit/.venv/bin/srk",
@@ -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,10 +49,18 @@ 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/`.
52
61
 
62
+ When render helpers are called without an explicit `<target_name>`, they automatically use the repository root folder name as the report target label.
63
+
53
64
  Install this package and Python-installable scanners:
54
65
 
55
66
  ```bash
@@ -60,7 +71,7 @@ bash scripts/install_tools.sh
60
71
  scripts\install_tools.bat
61
72
  ```
62
73
 
63
- After cloning on a new machine, run the install script above to recreate the local `.tools/` directory and download required binaries. The `.tools/` folder is intentionally not committed to git.
74
+ After cloning on a new machine, run the install script above to recreate the local `.tools/` directory and install required external CLI binaries (`codeql`, `tfsec`, `gitleaks`, `trufflehog`, `osv-scanner`) alongside Python dependencies. The `.tools/` folder is intentionally not committed to git.
64
75
 
65
76
  Run all unit tests locally with coverage:
66
77
 
@@ -86,6 +97,51 @@ scripts\run_pip_audit.bat
86
97
  scripts\run_pip_audit.bat reports requirements.txt
87
98
  ```
88
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
+
133
+ Run Bandit and write JSON output:
134
+
135
+ ```bash
136
+ # Linux/macOS (optional args: <report_dir> <target_path>)
137
+ bash scripts/run_bandit.sh
138
+ bash scripts/run_bandit.sh security_reports src
139
+
140
+ # Windows (optional args: <report_dir> <target_path>)
141
+ scripts\run_bandit.bat
142
+ scripts\run_bandit.bat security_reports src
143
+ ```
144
+
89
145
  Convert pip-audit JSON report to HTML:
90
146
 
91
147
  ```bash
@@ -98,6 +154,18 @@ scripts\render_pip_audit_html.bat
98
154
  scripts\render_pip_audit_html.bat reports requirements.txt
99
155
  ```
100
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
+
101
169
  These render helpers generate the HTML file and open it automatically in your default browser.
102
170
 
103
171
  Convert sample Trivy JSON report to HTML:
@@ -140,37 +208,99 @@ By default, JSON is written to `reports/pip-audit.json` and HTML to `reports/pip
140
208
 
141
209
  ## Additional Tool Workflows
142
210
 
143
- Each workflow has paired run and render scripts in `scripts/`:
211
+ ### Script Coverage Matrix
144
212
 
145
- - Semgrep: `run_semgrep.(sh|bat)` and `render_semgrep_html.(sh|bat)`
146
- - CodeQL: `run_codeql.(sh|bat)` and `render_codeql_html.(sh|bat)`
147
- - OSV-Scanner: `run_osv_scanner.(sh|bat)` and `render_osv_scanner_html.(sh|bat)`
148
- - Checkov: `run_checkov.(sh|bat)` and `render_checkov_html.(sh|bat)`
149
- - tfsec: `run_tfsec.(sh|bat)` and `render_tfsec_html.(sh|bat)`
150
- - TruffleHog: `run_trufflehog.(sh|bat)` and `render_trufflehog_html.(sh|bat)`
213
+ The table below reflects what is currently implemented in `scripts/`:
151
214
 
152
- Manual CLI render examples:
215
+ | Tool | Run Script (JSON/SARIF) | Render Script (HTML) | Default JSON/SARIF Output |
216
+ | --- | --- | --- | --- |
217
+ | Trivy | `run_trivy.(sh/bat)` | `render_trivy_html.(sh/bat)` | `security_reports/trivy-image-report-v1.0.21.json` |
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` |
220
+ | Bandit | `run_bandit.(sh/bat)` | `render_bandit_html.(sh/bat)` | `security_reports/bandit.json` |
221
+ | Gitleaks | `run_gitleaks.(sh/bat)` | `render_gitleaks_html.(sh/bat)` | `security_reports/gitleaks.json` |
222
+ | Semgrep | `run_semgrep.(sh/bat)` | `render_semgrep_html.(sh/bat)` | `security_reports/semgrep.json` |
223
+ | CodeQL | `run_codeql.(sh/bat)` | `render_codeql_html.(sh/bat)` | `security_reports/codeql.sarif.json` |
224
+ | OSV-Scanner | `run_osv_scanner.(sh/bat)` | `render_osv_scanner_html.(sh/bat)` | `security_reports/osv-scanner.json` |
225
+ | Checkov | `run_checkov.(sh/bat)` | `render_checkov_html.(sh/bat)` | `security_reports/checkov.json` |
226
+ | tfsec | `run_tfsec.(sh/bat)` | `render_tfsec_html.(sh/bat)` | `security_reports/tfsec.json` |
227
+ | TruffleHog | `run_trufflehog.(sh/bat)` | `render_trufflehog_html.(sh/bat)` | `security_reports/trufflehog.json` |
228
+
229
+ ### Bandit End-To-End Example
230
+
231
+ Generate JSON first, then render HTML:
153
232
 
154
233
  ```bash
155
- srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
156
- srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
157
- srk render osv-scanner --input security_reports/osv-scanner.json --output security_reports/osv-scanner-report.html --target requirements.txt
158
- srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
159
- srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
160
- srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
234
+ # Linux/macOS
235
+ bash scripts/run_bandit.sh security_reports src
236
+ bash scripts/render_bandit_html.sh security_reports my-python-project
237
+
238
+ # Windows
239
+ scripts\run_bandit.bat security_reports src
240
+ scripts\render_bandit_html.bat security_reports my-python-project
241
+ ```
242
+
243
+ ### Other Run Script Usage
244
+
245
+ ```bash
246
+ # Linux/macOS
247
+ bash scripts/run_trivy.sh security_reports alpine:latest
248
+ bash scripts/run_safety.sh security_reports requirements.txt
249
+ bash scripts/run_gitleaks.sh security_reports .
250
+ bash scripts/run_semgrep.sh security_reports .
251
+ bash scripts/run_codeql.sh security_reports codeql-db codeql/python-queries
252
+ bash scripts/run_osv_scanner.sh security_reports .
253
+ bash scripts/run_checkov.sh security_reports .
254
+ bash scripts/run_tfsec.sh security_reports .
255
+ bash scripts/run_trufflehog.sh security_reports .
256
+
257
+ # Windows
258
+ scripts\run_trivy.bat security_reports alpine:latest
259
+ scripts\run_safety.bat security_reports requirements.txt
260
+ scripts\run_gitleaks.bat security_reports .
261
+ scripts\run_semgrep.bat security_reports .
262
+ scripts\run_codeql.bat security_reports codeql-db codeql/python-queries
263
+ scripts\run_osv_scanner.bat security_reports .
264
+ scripts\run_checkov.bat security_reports .
265
+ scripts\run_tfsec.bat security_reports .
266
+ scripts\run_trufflehog.bat security_reports .
161
267
  ```
162
268
 
163
- Render Bandit JSON:
269
+ ### Trivy and Gitleaks End-To-End
270
+
271
+ Generate JSON and then render HTML using wrapper scripts:
164
272
 
165
273
  ```bash
166
- srk render bandit --input bandit-report.json --output security_reports/report-bandit.html --target my-python-project
274
+ # Linux/macOS
275
+ bash scripts/run_trivy.sh security_reports your-image:tag
276
+ bash scripts/render_trivy_html.sh security_reports your-image:tag
277
+
278
+ bash scripts/run_gitleaks.sh security_reports .
279
+ bash scripts/render_gitleaks_html.sh security_reports my-repository
280
+
281
+ # Windows
282
+ scripts\run_trivy.bat security_reports your-image:tag
283
+ scripts\render_trivy_html.bat security_reports your-image:tag
284
+
285
+ scripts\run_gitleaks.bat security_reports .
286
+ scripts\render_gitleaks_html.bat security_reports my-repository
167
287
  ```
168
288
 
169
- Render Gitleaks JSON:
289
+ Manual CLI render examples:
170
290
 
171
291
  ```bash
172
- srk render gitleaks --input gitleaks-report.json --output security_reports/report-gitleaks.html --target my-repository
292
+ srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
293
+ srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
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
296
+ srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
297
+ srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
298
+ srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
299
+ srk render bandit --input security_reports/bandit.json --output security_reports/bandit-report.html --target my-python-project
300
+ srk render gitleaks --input security_reports/gitleaks.json --output security_reports/gitleaks-report.html --target my-repository
301
+ srk render trivy --input security_reports/trivy-image-report-v1.0.21.json --output security_reports/trivy-report.html --target my-image
173
302
  ```
303
+
174
304
  ## MCP Server
175
305
 
176
306
  Run MCP server over stdio:
@@ -182,12 +312,12 @@ srk mcp serve --transport stdio
182
312
  ### Available MCP Tools
183
313
 
184
314
  | Tool | Description |
185
- |---|---|
315
+ | --- | --- |
186
316
  | `summarize_json` | Summarize vulnerabilities by severity from a JSON file |
187
317
  | `render_report_from_json` | Parse JSON and render an HTML report to disk |
188
318
  | `validate_input` | Validate that a JSON file is parseable and return finding count |
189
319
 
190
- 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).
191
321
 
192
322
  ---
193
323
 
@@ -280,6 +410,7 @@ Edit `~/.codeium/windsurf/mcp_config.json`:
280
410
  If the package is installed in a `.venv`, use the full path to avoid PATH issues:
281
411
 
282
412
  **Windows:**
413
+
283
414
  ```json
284
415
  {
285
416
  "command": "C:/MyProjects/sec-report-kit/.venv/Scripts/srk.exe",
@@ -288,6 +419,7 @@ If the package is installed in a `.venv`, use the full path to avoid PATH issues
288
419
  ```
289
420
 
290
421
  **macOS / Linux:**
422
+
291
423
  ```json
292
424
  {
293
425
  "command": "/home/user/sec-report-kit/.venv/bin/srk",
@@ -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.1"
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%