Reports & Scheduling

Automated SOC Report Generation, PDF Export, Scheduling, Tenant-Scoped Access, and Report Sharing

Complete

Auto-Generation

Monthly, quarterly, yearly reports generated on schedule

Complete

PDF / HTML Export

WeasyPrint PDF with HTML fallback for browser printing

Complete

Report Sharing

Share reports with external users via time-limited tokens

Complete

SSO + Tenant Scoping

Multi-tenant isolation with SSO and JWT auth support

Overview

The Reports module is the executive-facing output layer of the ThreatOps SOCaaS platform. It automatically produces monthly, quarterly, and yearly SOC performance reports, provides on-demand report generation, supports PDF downloads, and enables controlled report sharing with external stakeholders. Every report is tenant-scoped and accessible through both SSO and local JWT authentication.

Enterprise and government customers expect regular, professional-quality reports showing SOC performance KPIs, incident summaries, compliance posture, and operational metrics. Manual report creation does not scale across a multi-tenant SOCaaS platform. This module fully automates the report lifecycle from generation through distribution.

What Was Proposed

What's Built Complete

Report Generator Engine

File: platform/api/app/services/report_generator.py (~2000+ lines)

Report Sharing Service

File: platform/api/app/services/report_sharing.py

Reporting Service (Legacy + SSO)

File: platform/api/app/services/reporting_service.py

PDF Generator

File: platform/api/app/services/pdf_generator.py

API Router: 20+ Endpoints

File: platform/api/app/routers/reports.py (~820 lines)

The reports router is the largest single router in the platform, covering generated reports, tenant-scoped access, sharing, scheduling, KPIs, and legacy compatibility.

Frontend Pages

Architecture

Frontend (Next.js)                           API (FastAPI)
+--------------------------------+     +-------------------------------------+
| /reports                       |     | /api/v1/reports/*                   |
|   KPI Table, Incident Summary  | --> |                                     |
| /reports/generated             |     | ReportGenerator (auto-scheduling)   |
|   Report List, On-Demand Gen   |     |   monthly/quarterly/yearly/on_demand|
| /reports/generated/[id]        |     |   HTML + JSON output                |
|   Report Viewer, Download      |     |                                     |
| /reports/lifecycle             |     | ReportingService (legacy)           |
|   Lifecycle Management         |     |   executive, SLA, detection reports |
+--------------------------------+     |                                     |
                                       | ReportSharingService                |
                                       |   share tokens, access tracking     |
                                       |                                     |
                                       | PDFGenerator                        |
                                       |   WeasyPrint / HTML fallback        |
                                       |                                     |
                                       | ReportScheduler                     |
                                       |   daily/weekly/monthly schedules    |
                                       |                                     |
                                       | ReportAccessMiddleware              |
                                       |   SSO + JWT tenant isolation        |
                                       +-------------------------------------+
                                                     |
                                               PostgreSQL (Report model)
    

Routing

TypePathDescription
Frontend/reportsExecutive report overview with KPIs
Frontend/reports/generatedGenerated reports list and on-demand generation
Frontend/reports/generated/[id]Individual report viewer
Frontend/reports/lifecycleReport lifecycle management
API Prefix/api/v1/reportsAll report endpoints

API Endpoints

MethodEndpointDescription
Generated Reports (File-Based SOC Reports)
GET/generatedList all generated SOC reports with metadata
GET/generated/{report_id}Get report content (HTML or JSON via format param)
GET/generated/{report_id}/downloadDownload report as HTML or JSON file
POST/generated/generateTrigger on-demand SOC report generation
GET/schedule/upcomingView generation schedule and next upcoming reports
GET/templates/listList available report templates/types
SSO-Compatible Tenant-Scoped
GET/my-reportsList reports for authenticated user's tenant
GET/dashboardCustomer-facing dashboard with KPIs and compliance summary
GET/sharedList reports shared with authenticated user
GET/{report_id}/viewView specific report (tenant-scoped)
GET/{report_id}/downloadDownload report as PDF (tenant-scoped)
Sharing & Administration
POST/{report_id}/shareShare report with specific users (admin only)
DELETE/shares/{share_id}Revoke a report share (admin only)
GET/{report_id}/share-statsGet sharing statistics (admin only)
Legacy Endpoints
POST/generateGenerate report on demand (analyst/admin)
GET/List reports for current tenant
GET/kpisGet KPI metrics for tenant
GET/schedulesList report schedules
POST/scheduleCreate recurring report schedule
DELETE/schedules/{schedule_id}Remove a report schedule
GET/{report_id}Get full report data by ID
GET/{report_id}/pdfDownload report as PDF document

Prerequisites

Data Model

Report Model (PostgreSQL)

FieldTypeDescription
idUUIDPrimary key
tenant_idstringTenant isolation key
report_typeReportType enumexecutive_monthly, sla_performance, detection_coverage, etc.
period_startdatetimeReport period start
period_enddatetimeReport period end
generated_atdatetimeGeneration timestamp
statusReportStatuspending, generating, completed, failed
dataJSONFull report data payload
created_atdatetimeRecord creation timestamp

Enums

EnumValues
ReportPeriodTypemonthly, quarterly, yearly, on_demand
ReportGenerationStatuspending, generating, completed, failed
ReportTypeexecutive_monthly, sla_performance, detection_coverage

UI Description

The Reports module spans four frontend pages:

  1. /reports: Executive overview page with an "Operational" status banner, three generated report cards (Monthly, Quarterly, Annual) with quick-generate buttons, a KPI metrics table (MTTA, MTTR, Auto-Resolution Rate, etc.) with green/amber/red status icons, and an incident highlights section with severity badges and resolution descriptions
  2. /reports/generated: Browsable report catalog with type filter tabs (monthly/quarterly/yearly/on_demand), type-colored badges, file size display, report schedule viewer with countdown timers, and an on-demand generation dialog for custom date ranges
  3. /reports/generated/[id]: Individual report viewer that renders the report's HTML content inline, with download buttons for HTML and JSON formats and sharing controls
  4. /reports/lifecycle: Report lifecycle management for scheduling and distribution workflows