Skip to main content

Audit Service — Service Risk Register

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · FAILURE_MODES · SECURITY_MODEL

1. Risk register

IDRiskLikelihoodImpactSeverityOwnerMitigationResidual
RISK-AUDIT-01Audit entries tampered or deletedVery LowCriticalCRITICALDBA + Security LeadUPDATE/DELETE revoked at DB role level; chain-hash detects tampering; daily verification job; CRITICAL alertVery low
RISK-AUDIT-02Cross-tenant audit data visible to wrong tenant adminLowCriticalCRITICALSecurity Lead + DBARLS on audit_entries; JWT-extracted tenantId; mandatory tenant-isolation.spec.ts in CIVery low
RISK-AUDIT-03Chain-hash verification job silently failsLowHighHIGHSREJob emits audit_chain_integrity_failures_total metric; alert fires on any > 0 value; job is monitored in GrafanaLow
RISK-AUDIT-04Source service stops emitting events (audit gap)MediumHighHIGHPlatform EngPer-service event rate metric; AuditIngestionStopped alert if rate drops to zero for > 5 min; source service contract testsLow
RISK-AUDIT-05NATS DLQ grows silently — events never ingestedLowHighHIGHSREaudit_dlq_pending_messages metric; AuditDLQGrowing alert; DLQ handler retries 3x; audit.dlq.alert.v1 to platform-admin-serviceLow
RISK-AUDIT-06Postgres DB unavailable — audit trail gapLow–MediumHighHIGHSRENATS JetStream holds messages; events re-delivered on DB recovery; at-least-once delivery; gap duration loggedLow
RISK-AUDIT-07Export file exposed beyond intended recipientLowHighHIGHSecurity LeadSigned URLs; 1-hour TTL; export request itself creates AuditEntry (meta-audit); rate-limited to Super AdminLow
RISK-AUDIT-08PHI in metadata field of audit entries visible to unauthorized rolesLowHighHIGHCompliance OfficerAccess controlled by RBAC + RLS; Tenant Admins see their own tenant only; patients see only disclosure endpointLow
RISK-AUDIT-09Monthly partition not pruned → table bloat → query degradationLowMediumMEDIUMDBADrizzle migration manages monthly partitions; partition-pruning for time-range queries; archival policy applied; DBA monitors table sizeLow
RISK-AUDIT-10Event schema change from source service breaks ingestion normalisationMediumMediumMEDIUMPlatform EngSchema registry with conformance tests per event type; malformed events go to DLQ (not dropped); DLQ handler alertsMedium
RISK-AUDIT-11Audit service itself is a target for denial-of-service via query floodLowMediumMEDIUMSREKong rate limiting (60 req/min per user); 90-day query window enforced; expensive queries forced to async exportLow
RISK-AUDIT-127-year retention policy not applied correctly — data deleted earlyVery LowCriticalCRITICALDBA + Compliance OfficerPartition archival policy reviewed in CI; automated tests verify no rows deleted before 7-year mark; DBA quarterly reviewVery low

2. Compliance risks

IDRiskRegulationMitigation
CR-01Audit trail gap during outage cited in regulatory inquiryMoPH / HIPAA analogueAt-least-once NATS delivery; gap duration logged; gap justification documented in outage report
CR-02Patient cannot access their own disclosure logHIPAA analogue Art. 164.528GET /api/v1/audit/disclosures endpoint; patient-portal integration
CR-03Cross-border audit data transfer without DPIAGDPR / MoPHData residency enforced; no cross-border export path without explicit operator configuration
CR-04Chain-hash tamper not detected for 24+ hoursMoPH audit integrityDaily verification job; real-time monitoring of audit_chain_integrity_failures_total metric

3. Risk review cadence

ActivityFrequencyOwner
Full register reviewQuarterlyTech Lead + Compliance Officer
CRITICAL/HIGH risk status updateMonthlyService Owner
Post-incident risk additionWithin 5 daysOn-call SRE + Tech Lead
DBA access audit reviewQuarterlySecurity Lead