Security Monitoring Service
Component Detail
Service Layer
medium complexity
backend
1
Dependencies
1
Dependents
9
Entities
0
Integrations
Description
Server-side service that runs scheduled aggregation queries over audit_logs and sessions tables to compute security metrics. Caches computed results to avoid heavy real-time database load and exposes REST API endpoints consumed by the Security Dashboard Page.
security-monitoring-service
Responsibilities
- Aggregate failed login attempts by time window, user, and organization
- Compute concurrent session counts per user and detect anomalous session patterns
- Classify and surface flagged security events by severity level
- Cache aggregated metrics on a scheduled basis to minimize database load
- Enforce tenant isolation so Org Admins only see their own organization data
Interfaces
getSecurityMetrics(orgId?: string, timeWindow?: string): Promise<SecurityMetrics>
getFailedLoginCounts(orgId: string, from: Date, to: Date): Promise<FailedLoginData[]>
getActiveSessions(orgId?: string): Promise<SessionSummary[]>
getFlaggedEvents(orgId?: string, severity?: string): Promise<FlaggedEvent[]>
getConcurrentSessionsByUser(orgId: string): Promise<UserSessionCount[]>
refreshMetricsCache(): Promise<void>
dismissAlert(alertId: string): Promise<void>
getSecurityTrends(orgId?: string, days: number): Promise<TrendData>
Relationships
Related Data Entities (9)
Data entities managed by this component