Version
sbi version: main @ d9404ec
OS: N/A (code-path bug; no runtime required)
Go: 1.26.5
What happened?
When scanning with --comprehensive, Trivy secrets and misconfigurations are parsed into counts only (secrets_found / config_issues on the images row).
The security_findings table, domain.SecurityFinding type, and InsertImage insert path already exist, but nothing ever populates Image.SecurityFindings. Nightly runs use --comprehensive, so this data is silently dropped.
Expected: Individual secret/misconfiguration findings are stored in security_findings and available via QueryAllImageDetails / the detailed JSON report.
Steps to reproduce
- Inspect
parseTrivyResult in pkg/infrastructure/scanner/trivy.go — only increments count fields.
- Inspect
Analyze in analyzer.go — never assigns SecurityFindings.
- Run a comprehensive scan, then:
SELECT COUNT(*) FROM security_findings; → always 0.
Relevant log output
No runtime error; findings are simply never written.
Version
sbi version: main @ d9404ec
OS: N/A (code-path bug; no runtime required)
Go: 1.26.5
What happened?
When scanning with
--comprehensive, Trivy secrets and misconfigurations are parsed into counts only (secrets_found/config_issueson theimagesrow).The
security_findingstable,domain.SecurityFindingtype, andInsertImageinsert path already exist, but nothing ever populatesImage.SecurityFindings. Nightly runs use--comprehensive, so this data is silently dropped.Expected: Individual secret/misconfiguration findings are stored in
security_findingsand available viaQueryAllImageDetails/ the detailed JSON report.Steps to reproduce
parseTrivyResultinpkg/infrastructure/scanner/trivy.go— only increments count fields.Analyzeinanalyzer.go— never assignsSecurityFindings.SELECT COUNT(*) FROM security_findings;→ always0.Relevant log output