Service Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Backend service that aggregates and exposes security metric data consumed by the Security Dashboard. It queries session, authentication event, and support access records to compute current counts and trend deltas. Results are returned in a structured format suitable for dashboard rendering and anomaly detection.

Feature: Security Dashboard

security-metrics-service

Sources & reasoning

Line 258 establishes that Global Admin support access is time-bounded, revocable, and logged in the org's audit trail - all three concerns require a security surface where admins can monitor and act on this data. Admin-security is listed as always-on for the Admin Web Portal, confirming Security Dashboard ships at MVP launch.

  • Orgs can grant a Global Admin time-bounded support access via a flag in Organization Settings; revoking the flag or hitting the expiry immediately removes access. Every support-access session is logged in the org's audit trail.

Responsibilities

  • Query active session count across all tenants or a specific tenant scope
  • Aggregate failed login attempt counts within a configurable time window
  • Retrieve current support access grant counts and their expiry status
  • Report tenant isolation status flags for all registered tenants
  • Enforce role-based access control so only administrator roles can invoke metric endpoints

Interfaces

getSecurityMetrics(tenantId?: string): Promise<SecurityMetrics>
getActiveSessionCount(tenantId?: string): Promise<number>
getFailedLoginAttempts(windowMinutes: number, tenantId?: string): Promise<number>
getSupportAccessGrants(tenantId?: string): Promise<SupportAccessGrant[]>
getTenantIsolationStatus(): Promise<TenantIsolationStatus[]>

Related Data Entities (3)

Data entities managed by this component