feat(analytics): add vulnerability trend analysis endpoint#792
feat(analytics): add vulnerability trend analysis endpoint#792Shreeya1207 wants to merge 1 commit into
Conversation
utksh1
left a comment
There was a problem hiding this comment.
Thanks for the PR. This needs tests before it can merge.\n\nBlocking issues:\n- The new backend contract has no route coverage. Please add backend tests that seed findings for the current owner and another owner, verify the 30-day filtering, severity buckets, average risk score, forecast fields, and owner isolation.\n- Please cover the empty-data response as well, so the frontend can rely on the and shape.\n\nThe implementation is small and CI is green, but this is a new user-facing analytics endpoint and needs contract coverage before merge.
|
Correction to the review text above: the new GET /analytics/vulnerability-trends backend contract needs route coverage. Please also verify the daily and forecast response shape in tests. |
Description
This PR introduces the foundation for vulnerability trend analysis and predictive modeling by adding a dedicated analytics endpoint and frontend API support.
Changes Made
Backend
Aggregates vulnerability findings by day using
discovered_atReturns the last 30 days of vulnerability activity
Includes severity breakdowns:
Calculates average daily risk score
Generates a lightweight forecast using historical findings data
Detects trend direction:
Frontend
getVulnerabilityTrends()API helperWhy
SecuScan currently provides current-state vulnerability metrics but lacks historical visibility into how findings evolve over time.
This enhancement establishes the analytics foundation required for:
Validation
Future Extensions