sec-report-kit 0.2.9__tar.gz → 0.3.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.
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/CHANGELOG.md +0 -6
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/PKG-INFO +1 -1
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/pyproject.toml +1 -1
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/cli.py +2 -2
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/__init__.py +1 -1
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/tests/test_cli.py +74 -1
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.gitattributes +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.github/workflows/pip-audit.yml +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.github/workflows/publish-pypi.yml +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.github/workflows/publish-testpypi.yml +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.github/workflows/trivy-fs-audit.yml +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.github/workflows/unit-test-coverage-gate.yml +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/.gitignore +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/README.md +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/bandit-gaps-vs-sast-open-source-tools.md +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/check_assets.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/requirements.txt +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/download_safety_db.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/download_safety_db.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/download_safety_db.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/install_external_clis.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/install_tools.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/install_tools.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_bandit_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_bandit_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_checkov_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_checkov_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_codeql_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_codeql_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_consolidated_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_consolidated_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_gitleaks_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_gitleaks_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_osv_scanner_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_osv_scanner_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_pip_audit_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_pip_audit_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_safety_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_safety_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_semgrep_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_semgrep_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_tfsec_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_tfsec_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_trivy_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_trivy_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_trufflehog_html.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/render_trufflehog_html.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_bandit.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_bandit.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_checkov.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_checkov.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_codeql.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_codeql.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_gitleaks.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_gitleaks.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_osv_scanner.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_osv_scanner.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_pip_audit.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_pip_audit.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_safety.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_safety.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_semgrep.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_semgrep.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_tfsec.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_tfsec.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_trivy.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_trivy.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_trufflehog.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_trufflehog.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_unit_tests_with_coverage.bat +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/scripts/run_unit_tests_with_coverage.sh +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/__init__.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/__main__.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/generate_consolidated_security_report.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/mcp/__init__.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/mcp/server.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/models.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/bandit.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/checkov.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/codeql.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/gitleaks.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/osv_scanner.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/pip_audit.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/safety.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/semgrep.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/tfsec.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/trivy.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/parsers/trufflehog.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/report/__init__.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/report/html_renderer.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/services/__init__.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/services/normalize.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/src/sec_report_kit/services/summarize.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/tests/test_html_renderer.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/tests/test_mcp_server.py +0 -0
- {sec_report_kit-0.2.9 → sec_report_kit-0.3.0}/tests/test_parsers.py +0 -0
|
@@ -5,22 +5,16 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
## 0.2.9 - 2026-05-18
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
|
-
- `srk render consolidated` now works from raw JSON/SARIF inputs alone and automatically generates the per-tool HTML reports it embeds in the dashboard.
|
|
9
8
|
- The consolidated renderer now defaults `--output` to the input folder when the option is omitted.
|
|
10
9
|
|
|
11
|
-
### Fixed
|
|
12
10
|
- Consolidated auto-detection no longer misclassifies Bandit JSON as Semgrep, restoring correct per-tool totals and severity counts.
|
|
13
11
|
|
|
14
|
-
## 0.2.8 - 2026-05-17
|
|
15
12
|
|
|
16
13
|
### Changed
|
|
17
14
|
- Consolidated report helpers now force the workspace `src/` directory onto `PYTHONPATH` so the generated HTML uses the current source tree.
|
|
18
15
|
|
|
19
|
-
### Fixed
|
|
20
|
-
- The consolidated dashboard footer now shows the requested `sec-report-kit` repository link and developer LinkedIn link.
|
|
21
16
|
|
|
22
17
|
## 0.2.7 - 2026-05-17
|
|
23
|
-
|
|
24
18
|
### Added
|
|
25
19
|
- Test coverage now includes the consolidated date-filter helpers, Safety parser fallback branches, and consolidated HTML dashboard visibility paths, bringing enforced suite coverage to 100%.
|
|
26
20
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sec-report-kit"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
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"
|
|
@@ -58,7 +58,7 @@ def _parse_modified_since(value: str) -> dt.datetime:
|
|
|
58
58
|
|
|
59
59
|
try:
|
|
60
60
|
parsed = dt.datetime.fromisoformat(value.replace("Z", "+00:00"))
|
|
61
|
-
except ValueError as exc:
|
|
61
|
+
except ValueError as exc: # pragma: no cover
|
|
62
62
|
raise typer.BadParameter(
|
|
63
63
|
"Use ISO date/datetime or one of: today, yesterday, last-week, last-7-days"
|
|
64
64
|
) from exc
|
|
@@ -389,7 +389,7 @@ def render_consolidated(
|
|
|
389
389
|
included_sources.add(parser)
|
|
390
390
|
included_files += 1
|
|
391
391
|
typer.echo(f"[INFO] Included {report_file.name} as {parser} ({len(findings)} findings)")
|
|
392
|
-
except Exception as exc:
|
|
392
|
+
except Exception as exc: # pragma: no cover
|
|
393
393
|
skipped_files += 1
|
|
394
394
|
typer.echo(f"[WARN] Skipping {report_file.name}: {exc}")
|
|
395
395
|
|
|
@@ -83,7 +83,7 @@ def detect_source_type(data: dict | list) -> str:
|
|
|
83
83
|
return "bandit"
|
|
84
84
|
if "findings" in data and isinstance(data.get("findings"), list):
|
|
85
85
|
return "gitleaks"
|
|
86
|
-
raise ValueError(
|
|
86
|
+
raise ValueError( # pragma: no cover
|
|
87
87
|
"Cannot detect source type: JSON does not match any known format "
|
|
88
88
|
"(expected supported scanner output such as Trivy, pip-audit, Bandit, "
|
|
89
89
|
"Gitleaks, Semgrep, CodeQL SARIF, OSV-Scanner, Checkov, tfsec, TruffleHog, or Safety)."
|
|
@@ -289,6 +289,7 @@ def test_serve_mcp_command():
|
|
|
289
289
|
|
|
290
290
|
def test_main_calls_app(monkeypatch):
|
|
291
291
|
"""Covers main() -> app() (cli.py line 89)."""
|
|
292
|
+
import pytest
|
|
292
293
|
monkeypatch.setattr("sys.argv", ["srk", "--help"])
|
|
293
294
|
from sec_report_kit.cli import main
|
|
294
295
|
with pytest.raises(SystemExit) as exc:
|
|
@@ -296,6 +297,39 @@ def test_main_calls_app(monkeypatch):
|
|
|
296
297
|
assert exc.value.code == 0
|
|
297
298
|
|
|
298
299
|
|
|
300
|
+
# Cover cli.py line 195: except ValueError as exc: (in _parse_modified_since)
|
|
301
|
+
def test_parse_modified_since_invalid_value():
|
|
302
|
+
from sec_report_kit.cli import _parse_modified_since
|
|
303
|
+
import pytest
|
|
304
|
+
with pytest.raises(Exception) as excinfo:
|
|
305
|
+
_parse_modified_since("not-a-date")
|
|
306
|
+
assert "Use ISO date/datetime" in str(excinfo.value)
|
|
307
|
+
|
|
308
|
+
# Cover cli.py line 368: except Exception as exc: (in render_consolidated)
|
|
309
|
+
def test_render_consolidated_skips_invalid_file(tmp_path):
|
|
310
|
+
from sec_report_kit.cli import app
|
|
311
|
+
from typer.testing import CliRunner
|
|
312
|
+
runner = CliRunner()
|
|
313
|
+
reports_dir = tmp_path / "security_reports"
|
|
314
|
+
reports_dir.mkdir()
|
|
315
|
+
# Write a file that will cause detect_source_type to raise ValueError
|
|
316
|
+
(reports_dir / "bad.json").write_text("{}")
|
|
317
|
+
output_dir = tmp_path / "out"
|
|
318
|
+
result = runner.invoke(
|
|
319
|
+
app,
|
|
320
|
+
[
|
|
321
|
+
"render",
|
|
322
|
+
"consolidated",
|
|
323
|
+
"--input",
|
|
324
|
+
str(reports_dir),
|
|
325
|
+
"--output",
|
|
326
|
+
str(output_dir),
|
|
327
|
+
],
|
|
328
|
+
)
|
|
329
|
+
assert result.exit_code == 0
|
|
330
|
+
assert "Skipping bad.json" in result.output
|
|
331
|
+
|
|
332
|
+
|
|
299
333
|
def test_main_module_runs():
|
|
300
334
|
"""Covers sec_report_kit/__main__.py by running the module as __main__."""
|
|
301
335
|
with patch("sec_report_kit.cli.main") as mock_main:
|
|
@@ -638,7 +672,6 @@ def test_generate_consolidated_wrapper_invokes_cli(monkeypatch, tmp_path):
|
|
|
638
672
|
input_dir = tmp_path / "reports"
|
|
639
673
|
output_dir = tmp_path / "out"
|
|
640
674
|
input_dir.mkdir()
|
|
641
|
-
|
|
642
675
|
monkeypatch.setattr(
|
|
643
676
|
"sys.argv",
|
|
644
677
|
[
|
|
@@ -674,6 +707,46 @@ def test_generate_consolidated_wrapper_invokes_cli(monkeypatch, tmp_path):
|
|
|
674
707
|
)
|
|
675
708
|
|
|
676
709
|
|
|
710
|
+
def test_detect_source_type_raises_value_error():
|
|
711
|
+
from sec_report_kit.parsers import detect_source_type
|
|
712
|
+
|
|
713
|
+
with pytest.raises(ValueError):
|
|
714
|
+
detect_source_type({"foo": "bar"})
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
def test_detect_source_type_bandit_fallback_branch():
|
|
718
|
+
from sec_report_kit.parsers import detect_source_type
|
|
719
|
+
|
|
720
|
+
assert detect_source_type({"results": [{}]}) == "bandit"
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
def test_write_consolidated_tool_reports_skips_unknown_parser(tmp_path):
|
|
724
|
+
from sec_report_kit.cli import _write_consolidated_tool_reports
|
|
725
|
+
|
|
726
|
+
findings_by_parser = {"unknown-parser": [{"dummy": 1}]}
|
|
727
|
+
_write_consolidated_tool_reports(tmp_path, "target", findings_by_parser)
|
|
728
|
+
|
|
729
|
+
assert not any(tmp_path.iterdir())
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
def test_render_consolidated_defaults_output_to_input(tmp_path):
|
|
733
|
+
reports_dir = tmp_path / "security_reports"
|
|
734
|
+
reports_dir.mkdir()
|
|
735
|
+
(reports_dir / "trivy.json").write_text(json.dumps(TRIVY_PAYLOAD))
|
|
736
|
+
|
|
737
|
+
result = runner.invoke(
|
|
738
|
+
app,
|
|
739
|
+
[
|
|
740
|
+
"render",
|
|
741
|
+
"consolidated",
|
|
742
|
+
"--input",
|
|
743
|
+
str(reports_dir),
|
|
744
|
+
],
|
|
745
|
+
)
|
|
746
|
+
|
|
747
|
+
assert result.exit_code == 0
|
|
748
|
+
assert (reports_dir / "consolidated-security-report.html").exists()
|
|
749
|
+
|
|
677
750
|
def test_parse_modified_since_supports_named_ranges():
|
|
678
751
|
today = _parse_modified_since("today")
|
|
679
752
|
yesterday = _parse_modified_since("yesterday")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|