fix: track UNKNOWN/LOW severity open vulns in health score v2 security pipeline (IN-1255) - #4533
Conversation
PR SummaryMedium Risk Overview In
Deploy note: pipe/datasource changes should land before the companion insights PR that reads Reviewed by Cursor Bugbot for commit d02f663. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Updates Health Score v2 to classify LOW and unknown-severity open vulnerabilities and expose them downstream.
Changes:
- Groups LOW vulnerabilities with moderate severity.
- Adds and propagates
openUnknowns. - Exposes project-level unknown counts to Insights.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
services/libs/tinybird/pipes/health_score_v2_security.pipe |
Adds LOW/unknown severity buckets. |
services/libs/tinybird/datasources/health_score_v2_security_ds.datasource |
Stores unknown counts. |
services/libs/tinybird/pipes/health_score_v2_signal_detail.pipe |
Propagates unknown counts. |
services/libs/tinybird/datasources/health_score_v2_signal_detail_ds.datasource |
Adds the propagated field. |
services/libs/tinybird/pipes/project_insights_health_breakdown_copy.pipe |
Rolls up unknown counts. |
services/libs/tinybird/datasources/project_insights_health_breakdown_ds.datasource |
Stores project-level counts. |
services/libs/tinybird/pipes/project_insights_health_breakdown.pipe |
Exposes the field publicly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…y pipeline (IN-1255)
Widens openModerates to severity IN ('MEDIUM','LOW') and adds a new
openUnknowns bucket (severity NOT IN the four known values), threaded
through health_score_v2_security -> health_score_v2_signal_detail ->
project_insights_health_breakdown(_copy) so open vulns of every
severity land in exactly one bucket instead of LOW/UNKNOWN falling
through unnoticed.
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
e7072df to
40408fb
Compare
| countIf( | ||
| status = 'OPEN' | ||
| AND severity NOT IN ('CRITICAL', 'HIGH', 'MEDIUM', 'LOW') | ||
| ) AS openUnknowns |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 40408fb. Configure here.
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (2)
services/libs/tinybird/pipes/health_score_v2_security.pipe:110
openUnknownsis exposed but never participates inopenVulnScore: the formula above still subtracts only critical, high, and moderate counts. A repo whose only open vulnerabilities haveUNKNOWNor another unrecognized severity therefore keeps a perfect score of 10, so the stated IN-1255 scoring fix is incomplete. Include this bucket in the formula using the intended penalty weight.
vc.openUnknowns AS openUnknowns,
services/libs/tinybird/pipes/health_score_v2_signal_detail.pipe:42
- This datasource also feeds
repo_health_score_v2_breakdown.pipe, but that request-time endpoint only rolls upopenCriticals,openHighs, andopenModerates(lines 60–65). Repo-filtered Overview responses will therefore omitopenUnknownswhile project-level responses include it, despite the end-to-end propagation claim. Addmax(sd.openUnknowns) AS openUnknownsto the repo breakdown pipe too.
s.openUnknowns AS openUnknowns,
… pipe Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
services/libs/tinybird/pipes/health_score_v2_security.pipe:110
openUnknownsis propagated, but theopenVulnScoreformula above still subtracts only critical, high, and moderate/low counts. A scanned repository containing only UNKNOWN or unrecognized severities therefore keeps a perfect vulnerability score of 10 and does not affect the overall security/health score, leaving the scoring part of IN-1255 unfixed. Apply the same one-point penalty used for LOW/MEDIUM unless the ticket specifies a different weight.
vc.openUnknowns AS openUnknowns,
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
services/libs/tinybird/pipes/health_score_v2_security.pipe:110
openUnknownsis propagated but never contributes toopenVulnScore: the formula above still subtracts only critical, high, and moderate counts. A scanned repository containing onlyUNKNOWNvulnerabilities therefore keeps a perfect vulnerability score of 10, so the stated IN-1255 scoring fix is incomplete. Include this bucket in the score using the severity weight required by the ticket.
vc.openUnknowns AS openUnknowns,

Summary
openModeratesnow includesLOW(wasMEDIUMonly), and a newopenUnknownsbucket catches anything outsideCRITICAL/HIGH/MEDIUM/LOW. Previously, open vulns withLOWor an unrecognized severity value fell through every bucket and were silently dropped from the count.health_score_v2_security.pipe/_ds→health_score_v2_signal_detail.pipe/_ds→project_insights_health_breakdown_copy.pipe→project_insights_health_breakdown_ds→project_insights_health_breakdown.pipe, soopenUnknownsis available at every downstream consumption point, not just the source pipe.health_score_v2_lifecycle.pipeorhealth_score_v2_raw_inputs_snapshot.pipe— see follow-up note below.tb push+ the scheduled copy run) before the companion insights PR (fix/IN-1255, same ticket) merges, since insights'getOpenVulnRow()reads the newopenUnknownsfield.Known follow-up (out of scope for this PR)
health_score_v2_lifecycle.pipeandhealth_score_v2_raw_inputs_snapshot.pipeindependently recompute open-severity vulnerability counts directly from the rawvulnerabilitiestable and have the same LOW/UNKNOWN blind spot described above. Not addressed here — tracked as a follow-up.JIRA
IN-1255 — Fix open vulnerability count and scoring for unknown severity vulns