Skip to main content

Generate HTML security reports from Trivy, pip-audit, Bandit, and Gitleaks JSON

Project description

sec-report-kit

Generate HTML vulnerability reports from multiple security tools (SAST, SCA, IaC, and secrets) with a CLI and MCP server.

Supported source types:

  • trivy
  • pip-audit
  • bandit
  • gitleaks
  • semgrep
  • codeql (SARIF)
  • osv-scanner
  • checkov
  • tfsec
  • trufflehog (JSON or NDJSON)

Install

pip install -e .

With MCP support:

pip install -e .[mcp]

CLI Usage

Both commands are available:

  • srk
  • sec-report-kit

Render Trivy JSON:

srk render trivy --input security_reports/trivy-image-report-v1.0.21.json --output security_reports/report-trivy.html --target shankonduru/cpkc-poc:v1.0.21

Render pip-audit JSON:

srk render pip-audit --input pip-audit.json --output security_reports/report-pip-audit.html --target requirements.txt

Helper Scripts (bat/sh)

Cross-platform helper scripts are available in scripts/.

When render helpers are called without an explicit <target_name>, they automatically use the repository root folder name as the report target label.

Install this package and Python-installable scanners:

# Linux/macOS
bash scripts/install_tools.sh

# Windows
scripts\install_tools.bat

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.

Run all unit tests locally with coverage:

# Linux/macOS (optional arg: <coverage_dir>)
bash scripts/run_unit_tests_with_coverage.sh
bash scripts/run_unit_tests_with_coverage.sh htmlcov

# Windows (optional arg: <coverage_dir>)
scripts\run_unit_tests_with_coverage.bat
scripts\run_unit_tests_with_coverage.bat htmlcov

Run pip-audit and write JSON output:

# Linux/macOS (optional args: <report_dir> <requirements_file>)
bash scripts/run_pip_audit.sh
bash scripts/run_pip_audit.sh reports requirements.txt

# Windows (optional args: <report_dir> <requirements_file>)
scripts\run_pip_audit.bat
scripts\run_pip_audit.bat reports requirements.txt

Run Bandit and write JSON output:

# Linux/macOS (optional args: <report_dir> <target_path>)
bash scripts/run_bandit.sh
bash scripts/run_bandit.sh security_reports src

# Windows (optional args: <report_dir> <target_path>)
scripts\run_bandit.bat
scripts\run_bandit.bat security_reports src

Convert pip-audit JSON report to HTML:

# Linux/macOS (optional args: <report_dir> <target_name>)
bash scripts/render_pip_audit_html.sh
bash scripts/render_pip_audit_html.sh reports requirements.txt

# Windows (optional args: <report_dir> <target_name>)
scripts\render_pip_audit_html.bat
scripts\render_pip_audit_html.bat reports requirements.txt

These render helpers generate the HTML file and open it automatically in your default browser.

Convert sample Trivy JSON report to HTML:

# Linux/macOS (optional args: <report_dir> <target_name>)
bash scripts/render_trivy_html.sh
bash scripts/render_trivy_html.sh security_reports my-image

# Windows (optional args: <report_dir> <target_name>)
scripts\render_trivy_html.bat
scripts\render_trivy_html.bat security_reports my-image

Convert sample Bandit JSON report to HTML:

# Linux/macOS (optional args: <report_dir> <target_name>)
bash scripts/render_bandit_html.sh
bash scripts/render_bandit_html.sh security_reports my-python-project

# Windows (optional args: <report_dir> <target_name>)
scripts\render_bandit_html.bat
scripts\render_bandit_html.bat security_reports my-python-project

Convert sample Gitleaks JSON report to HTML:

# Linux/macOS (optional args: <report_dir> <target_name>)
bash scripts/render_gitleaks_html.sh
bash scripts/render_gitleaks_html.sh security_reports my-repository

# Windows (optional args: <report_dir> <target_name>)
scripts\render_gitleaks_html.bat
scripts\render_gitleaks_html.bat security_reports my-repository

By default, JSON is written to reports/pip-audit.json and HTML to reports/pip-audit-report.html.

Additional Tool Workflows

Script Coverage Matrix

The table below reflects what is currently implemented in scripts/:

Tool Run Script (JSON/SARIF) Render Script (HTML) Default JSON/SARIF Output
Trivy run_trivy.(sh/bat) render_trivy_html.(sh/bat) security_reports/trivy-image-report-v1.0.21.json
pip-audit run_pip_audit.(sh/bat) render_pip_audit_html.(sh/bat) reports/pip-audit.json
Bandit run_bandit.(sh/bat) render_bandit_html.(sh/bat) security_reports/bandit.json
Gitleaks run_gitleaks.(sh/bat) render_gitleaks_html.(sh/bat) security_reports/gitleaks.json
Semgrep run_semgrep.(sh/bat) render_semgrep_html.(sh/bat) security_reports/semgrep.json
CodeQL run_codeql.(sh/bat) render_codeql_html.(sh/bat) security_reports/codeql.sarif.json
OSV-Scanner run_osv_scanner.(sh/bat) render_osv_scanner_html.(sh/bat) security_reports/osv-scanner.json
Checkov run_checkov.(sh/bat) render_checkov_html.(sh/bat) security_reports/checkov.json
tfsec run_tfsec.(sh/bat) render_tfsec_html.(sh/bat) security_reports/tfsec.json
TruffleHog run_trufflehog.(sh/bat) render_trufflehog_html.(sh/bat) security_reports/trufflehog.json

Bandit End-To-End Example

Generate JSON first, then render HTML:

# Linux/macOS
bash scripts/run_bandit.sh security_reports src
bash scripts/render_bandit_html.sh security_reports my-python-project

# Windows
scripts\run_bandit.bat security_reports src
scripts\render_bandit_html.bat security_reports my-python-project

Other Run Script Usage

# Linux/macOS
bash scripts/run_trivy.sh security_reports alpine:latest
bash scripts/run_gitleaks.sh security_reports .
bash scripts/run_semgrep.sh security_reports .
bash scripts/run_codeql.sh security_reports codeql-db codeql/python-queries
bash scripts/run_osv_scanner.sh security_reports .
bash scripts/run_checkov.sh security_reports .
bash scripts/run_tfsec.sh security_reports .
bash scripts/run_trufflehog.sh security_reports .

# Windows
scripts\run_trivy.bat security_reports alpine:latest
scripts\run_gitleaks.bat security_reports .
scripts\run_semgrep.bat security_reports .
scripts\run_codeql.bat security_reports codeql-db codeql/python-queries
scripts\run_osv_scanner.bat security_reports .
scripts\run_checkov.bat security_reports .
scripts\run_tfsec.bat security_reports .
scripts\run_trufflehog.bat security_reports .

Trivy and Gitleaks End-To-End

Generate JSON and then render HTML using wrapper scripts:

# Linux/macOS
bash scripts/run_trivy.sh security_reports your-image:tag
bash scripts/render_trivy_html.sh security_reports your-image:tag

bash scripts/run_gitleaks.sh security_reports .
bash scripts/render_gitleaks_html.sh security_reports my-repository

# Windows
scripts\run_trivy.bat security_reports your-image:tag
scripts\render_trivy_html.bat security_reports your-image:tag

scripts\run_gitleaks.bat security_reports .
scripts\render_gitleaks_html.bat security_reports my-repository

Manual CLI render examples:

srk render semgrep --input security_reports/semgrep.json --output security_reports/semgrep-report.html --target my-repo
srk render codeql --input security_reports/codeql.sarif.json --output security_reports/codeql-report.html --target my-repo
srk render osv-scanner --input security_reports/osv-scanner.json --output security_reports/osv-scanner-report.html --target requirements.txt
srk render checkov --input security_reports/checkov.json --output security_reports/checkov-report.html --target terraform
srk render tfsec --input security_reports/tfsec.json --output security_reports/tfsec-report.html --target terraform
srk render trufflehog --input security_reports/trufflehog.json --output security_reports/trufflehog-report.html --target my-repo
srk render bandit --input security_reports/bandit.json --output security_reports/bandit-report.html --target my-python-project
srk render gitleaks --input security_reports/gitleaks.json --output security_reports/gitleaks-report.html --target my-repository
srk render trivy --input security_reports/trivy-image-report-v1.0.21.json --output security_reports/trivy-report.html --target my-image

MCP Server

Run MCP server over stdio:

srk mcp serve --transport stdio

Available MCP Tools

Tool Description
summarize_json Summarize vulnerabilities by severity from a JSON file
render_report_from_json Parse JSON and render an HTML report to disk
validate_input Validate that a JSON file is parseable and return finding count

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).


VS Code (GitHub Copilot Agent / MCP extension)

Add to your VS Code settings.json (or .vscode/mcp.json in the workspace):

{
  "mcp": {
    "servers": {
      "sec-report-kit": {
        "type": "stdio",
        "command": "srk",
        "args": ["mcp", "serve", "--transport", "stdio"]
      }
    }
  }
}

Note: If srk is not on the system PATH, replace "command" with the full path to the executable, e.g. "C:/Users/you/.venv/Scripts/srk.exe".


Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "sec-report-kit": {
      "command": "srk",
      "args": ["mcp", "serve", "--transport", "stdio"]
    }
  }
}

Cursor

Open Cursor Settings → MCP and add a new server entry:

{
  "sec-report-kit": {
    "command": "srk",
    "args": ["mcp", "serve", "--transport", "stdio"]
  }
}

Or add it to .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "sec-report-kit": {
      "command": "srk",
      "args": ["mcp", "serve", "--transport", "stdio"]
    }
  }
}

Windsurf (Codeium)

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "sec-report-kit": {
      "command": "srk",
      "args": ["mcp", "serve", "--transport", "stdio"]
    }
  }
}

Using a virtual environment

If the package is installed in a .venv, use the full path to avoid PATH issues:

Windows:

{
  "command": "C:/MyProjects/sec-report-kit/.venv/Scripts/srk.exe",
  "args": ["mcp", "serve", "--transport", "stdio"]
}

macOS / Linux:

{
  "command": "/home/user/sec-report-kit/.venv/bin/srk",
  "args": ["mcp", "serve", "--transport", "stdio"]
}

Package Publish

Build:

python -m build

Upload to TestPyPI:

python -m twine upload --repository testpypi dist/*

Upload to PyPI:

python -m twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sec_report_kit-0.2.2.tar.gz (85.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sec_report_kit-0.2.2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file sec_report_kit-0.2.2.tar.gz.

File metadata

  • Download URL: sec_report_kit-0.2.2.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sec_report_kit-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3fe8820c27b899108b15ebb83660a5da8a1bef0deb9d82a749fe2abaebaf7507
MD5 6978bcdb830b8e4da41cd92fc902f6ca
BLAKE2b-256 1c269a944ca7aef3b97ae0b6648b19c24e296ee0bd425c75a2f7491311ab4242

See more details on using hashes here.

Provenance

The following attestation bundles were made for sec_report_kit-0.2.2.tar.gz:

Publisher: publish-pypi.yml on ShanKonduru/sec-report-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sec_report_kit-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: sec_report_kit-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sec_report_kit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 859c8a19c334ad9ab9128893eac28d38341d197c141df11abbe9566852017b9f
MD5 7e41896e07578b0c4f5b1e467fb4891e
BLAKE2b-256 cd4647382868aa6ca3fb2f4e95d0a848e6d9b7e12fe195f970f576d0507d7efd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sec_report_kit-0.2.2-py3-none-any.whl:

Publisher: publish-pypi.yml on ShanKonduru/sec-report-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page