Phase C · Information Systems Architecture

AIB Audit Service API

Version: 1.0 | Status: Draft | Date: 2026-06-08


Overview

aib-audit owns immutable audit logging for all data mutations. Read-only queries for compliance investigations.

Primary Table: audit_log (append-only, immutable)
Calls: None (passive listener on all mutations)
Called By: Compliance, internal audit, FMA inspection


SLA Targets

MetricTarget
Audit log writeSub-millisecond (trigger-based)
Query latencyP95: 500ms (10-year dataset)
Availability99.99% (immutable critical)

Key Endpoints

GET /audit-log/{entity_type}/{entity_id} Params: from_date, to_date, field_filter Returns: Chronological mutation history (who, what, when, why) SLA: P95: 500ms GET /audit-log/str/{str_id}/tipped-off-checks Returns: All attempts to set str.tipped_off != 0 (should be empty) SLA: P95: 100ms (critical compliance check) GET /audit-log/sanctions-freeze/{freeze_id}/unfreeze-audit Returns: Who unfroze, when, authorization chain SLA: P95: 200ms GET /audit-log?table={table}&date_range={range}&mutation_type={type} Advanced filtering for investigations SLA: P95: 1000ms (complex query) POST /audit-log (INTERNAL ONLY) Body: { entity_type, entity_id, mutation_type, before_values, after_values, actor_id } No response to client (fire-and-forget) SLA: P95: <1ms (trigger-driven from DB)

Immutability Enforcement

-- Database layer CREATE TABLE audit_log ( id TEXT PRIMARY KEY, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, mutation_type TEXT NOT NULL, -- 'INSERT' | 'UPDATE' | 'DELETE' before_values JSONB, after_values JSONB, actor_id TEXT NOT NULL, timestamp DATETIME NOT NULL, CONSTRAINT immutable_no_updates CHECK (true) -- DB row cannot be updated once written ); -- Application layer: audit_log is write-only, never UPDATE/DELETE

Regulatory Compliance

FrameworkRequirementImplementation
BCBS 239 P12Audit trail for all mutations100% coverage, 10-year retention
SPG Art. 16Tip-off prohibition enforcementImmutable flag + query endpoint to verify no attempts
GDPR Art. 5(1)(f)Accountability (audit trail)All data mutations logged with actor + timestamp
DORA Art. 9ICT audit trail1-year minimum for all ICT changes

Referenced by