Output Formats
H2 Scanner supports multiple output formats.
Markdown (Default)
Human-readable output with colors and formatting:
[CRITICAL] Hardcoded AWS Secret Key
File: config/settings.py:42
Desc: AWS secret access key found in source code
Fix: Use environment variables or AWS Secrets Manager
CWE: CWE-798 /cwe/CWE-798.html
SARIF
SARIF format for GitHub Security tab integration:
h2-scan --output sarif > results.sarif
Upload to GitHub:
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: h2-scanner-results.sarif
JSON
Machine-readable JSON output:
h2-scan --output json
{
"findings": [
{
"rule_id": "H2-SEC-001",
"title": "Hardcoded AWS Secret Key",
"severity": "critical",
"file_path": "config/settings.py",
"line_number": 42,
"cwe_id": "CWE-798"
}
],
"summary": {
"total": 6,
"critical": 1,
"high": 2,
"medium": 2,
"low": 1
}
}