Generates a print-ready PDF report of priority security findings for a project using the Semgrep API v2 IssuesService.
| Product | Criteria |
|---|---|
| Secrets | Open / Reviewing / To-Fix status · Critical or High severity · Validation = CONFIRMED_VALID · Not auto-triaged as false positive |
| Code (SAST) | Open / Reviewing / To-Fix status · Critical or High severity · High confidence · Not auto-triaged as false positive |
| Supply Chain (SCA) | Open / Reviewing / To-Fix status · Critical or High severity · Reachability = ALWAYS_REACHABLE or REACHABLE |
- Priority Findings Summary — count by scan product × severity
- Findings by Status and Severity — per-product breakdown (open / reviewing / to-fix)
- Code Findings by OWASP Category — SAST findings grouped by OWASP Top 10 category
- Finding Details — full listing sorted by severity (critical first) then scan product, with product-specific detail columns (secret type + validation / OWASP + CWE / CVE + dependency + reachability)
pip install -r requirements.txtDependencies: requests, reportlab (both commonly pre-installed).
# Set your API token (Web API scope required)
export SEMGREP_APP_TOKEN=your-token-here
# Report for a specific repository
python semgrep_priority_report.py --project my-org/my-repo
# Specify deployment ID explicitly and custom output path
python semgrep_priority_report.py \
--deployment-id 12345 \
--project my-org/my-repo \
--output q2-security-report.pdf
# Report across all repositories in your org (omit --project)
python semgrep_priority_report.py --output full-org-report.pdfIf --deployment-id / SEMGREP_DEPLOYMENT_ID is not provided the script
auto-detects it from /api/v1/deployments.
- Log in to semgrep.dev
- Go to Settings → Tokens
- Create a token with Web API scope
export SEMGREP_APP_TOKEN=<token>