Skip to content

Conversation

@rakan-pro
Copy link
Contributor

Context

Added a new endpoint GET /api/v1/overview/findings_severity_timeseries to fetch finding severity time series data

Description

Api endpoint to retrieve aggregated timeseries severities in granular way with time ranges (1D : hour , 5D: day, 1W: day, 1M: day, All: week) and granularity and timezone configuration

Steps to review

Manual Verification:

  1. run some scans
  2. call the API endpoint and check different granularity / timezones

Endpoint evidences

GET : /api/v1/overviews/findings_severity_timeseries?filter[range]=1W&filter[timezone]=UTC
{
    "data": [
        {
            "type": "severity-time-series",
            "id": "2025-11-18 00:00:00+00:00",
            "attributes": {
                "date": "2025-11-18T00:00:00Z",
                "critical": 168,
                "high": 88,
                "medium": 11,
                "low": 37,
                "informational": 151,
                "muted": 98
            }
        },
        {
            "type": "severity-time-series",
            "id": "2025-11-19 00:00:00+00:00",
            "attributes": {
                "date": "2025-11-19T00:00:00Z",
                "critical": 147,
                "high": 43,
                "medium": 91,
                "low": 90,
                "informational": 97,
                "muted": 103
            }
        },
        {
            "type": "severity-time-series",
            "id": "2025-11-20 00:00:00+00:00",
            "attributes": {
                "date": "2025-11-20T00:00:00Z",
                "critical": 41,
                "high": 130,
                "medium": 161,
                "low": 84,
                "informational": 109,
                "muted": 114
            }
        },
        {
            "type": "severity-time-series",
            "id": "2025-11-21 00:00:00+00:00",
            "attributes": {
                "date": "2025-11-21T00:00:00Z",
                "critical": 92,
                "high": 167,
                "medium": 333,
                "low": 182,
                "informational": 146,
                "muted": 185
            }
        }
    ],
    "meta": {
        "version": "v1",
        "time_range": "1W",
        "granularity": "day",
        "timezone": "UTC"
    }
}

Checklist

UI

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video of the functionality flow (if applicable) - Mobile (X < 640px)
  • Screenshots/Video of the functionality flow (if applicable) - Table (640px > X < 1024px)
  • Screenshots/Video of the functionality flow (if applicable) - Desktop (X > 1024px)
  • Ensure new entries are added to CHANGELOG.md, if applicable.

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rakan-pro rakan-pro requested a review from a team as a code owner November 25, 2025 09:41
@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

🔒 Container Security Scan

Image: prowler-api:3291e24
Last scan: 2025-11-26 09:56:07 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 4
Total 4

3 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 95.58824% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.57%. Comparing base (0d59441) to head (4b48087).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9307      +/-   ##
==========================================
+ Coverage   92.54%   92.57%   +0.02%     
==========================================
  Files         154      155       +1     
  Lines       21231    21366     +135     
==========================================
+ Hits        19649    19779     +130     
- Misses       1582     1587       +5     
Flag Coverage Δ
api 92.57% <95.58%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler ∅ <ø> (∅)
api 92.57% <95.58%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AdriiiPRodri
Copy link
Contributor

I think we should add a new index for this, something like:

models.Index(
    fields=["tenant_id", "inserted_at"],
    include=["severity", "fail", "muted"],
    name="ss_tenant_time_covering_idx",
)

@rakan-pro rakan-pro force-pushed the PROWLER-25-finding-severity-over-time-component-api branch 2 times, most recently from 26191ce to b705fdc Compare November 26, 2025 09:33
@github-actions github-actions bot added the review-django-migrations This PR contains changes in Django migrations label Nov 26, 2025
@rakan-pro rakan-pro force-pushed the PROWLER-25-finding-severity-over-time-component-api branch from b705fdc to b519588 Compare November 26, 2025 09:37
@rakan-pro rakan-pro force-pushed the PROWLER-25-finding-severity-over-time-component-api branch from b519588 to 4b48087 Compare November 26, 2025 09:52
@rakan-pro
Copy link
Contributor Author

I think we should add a new index for this, something like:

models.Index(
    fields=["tenant_id", "inserted_at"],
    include=["severity", "fail", "muted"],
    name="ss_tenant_time_covering_idx",
)

I added it 👍🏼

@rakan-pro rakan-pro changed the title feat(api): add findings severity timeseries endpoint [WIP] feat(api): add findings severity timeseries endpoint Nov 28, 2025
@rakan-pro rakan-pro added the no-merge Please, DO NOT MERGE this PR. label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/api no-merge Please, DO NOT MERGE this PR. review-django-migrations This PR contains changes in Django migrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants