feat: enhance alert aggregation and date validation - #81
Conversation
- This also add proper checks and validations for dates
- Replace unused components with useful components and metrics
PR Compliance Guide 🔍(Compliance updated until commit e6e8522)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 02a8023
|
||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨
Explore these optional code suggestions:
|
|||||||||||||||
User description
Description
Related Issue
None
Type of Change
How Has This Been Tested?
Screenshots (if applicable)
Checklist
PR Type
Enhancement, Bug fix
Description
Enhanced alert aggregation with volumetric attack detection and rate limiting
Added comprehensive date validation for alert summaries and report generation
Improved threat synthesis logic with clearer decision tree for threat levels
Replaced dashboard dummy components with real-time network statistics widgets
Updated network map page with live threat data visualization
Diagram Walkthrough
File Walkthrough
nids.py
Add volumetric attack detection and date validationbackend/api/routers/nids.py
VOLUMETRIC_ATTACKSconstant import for DoS and Mirai detectionRATE_LIMIT_WINDOWandRATE_LIMIT_THRESHOLDconstantshandle_redis_incident()with volumetric attack detection andburst handling logic
get_alerts_summary()to check start/end datesand 1-year range limit
reports.py
Add date range validation for report generationbackend/api/routers/reports.py
request_new_report()endpointand dates not in future
constants.py
Add volumetric attacks constantbackend/utils/constants.py
VOLUMETRIC_ATTACKSconstant containing DoS and Mirai attacktypes
NetworkStatsWidgets.tsx
Create real-time network statistics widgetsfrontend/src/app/(dashboard)/dashboard/components/NetworkStatsWidgets.tsx
TopAttackTypesWidget: Displays top 5 attack types with percentages andanimated bars
NetworkActivityWidget: Shows unique sources, destinations, totalflows, and malicious traffic rate
TopTargetsWidget: Lists top 5 most targeted destination IPs withattempt counts
useLiveThreats()hookpage.tsx
Replace dummy dashboard components with live metricsfrontend/src/app/(dashboard)/dashboard/page.tsx
UsersandServericon imports with new widget importsreal
TopAttackTypesWidget,NetworkActivityWidget, andTopTargetsWidgetexist
page.tsx
Transform network map to real-time threat visualizationfrontend/src/app/(dashboard)/network-map/page.tsx
visualization
targeted assets
attack counts
types
useLiveThreats()hookpredict.py
Improve threat synthesis and timezone handlingbackend/ml/models/predict.py
timezone.utcand decision tree
(binary, multiclass, autoencoder)
run_dos.sh
Optimize DoS attack demo parametersbackend/scripts/demo/run_dos.sh