Design Audit Logging

Medium45 min
1 / 30
understanding7 min read

Problem Statement and Audit Logging Mission

Problem Statement and Audit Logging Mission — audit logging system design interview section.

Problem Statement and Audit Logging Mission

  • Separate security audit events from noisy application debug logs—auditors need who/what/when/where/outcome, not stack traces.
  • Treat audit logs as evidence: append-only, tamper-evident, independently replicated, with legal-hold workflows.
  • Multi-tenant SaaS must enforce tenant-scoped visibility in the query planner, not only UI filters.

Mechanism

Producers emit structured events to a local agent buffer; collectors batch to a partitioned stream; enrichers attach identity, policy version, and resource lineage; writers commit to hot search tier plus immutable cold object storage with hash-chain checkpoints.

Failure drills

If the collector buffer fills, producers switch to spill-to-disk with backpressure signals—never silently drop admin or auth events. If enrichment identity graph is stale, stamp enrichment_stale=true and route high-risk classes to synchronous path. If clock skew exceeds 30s, reject event or dual-stamp with ingest time and flag time_untrusted. If cross-region replication lag breaches RPO, pause legal-hold exports and page compliance.

Cost and capacity

SignalTarget
Peak audit EPS850K /s
Hot retention400 days
Cold WORM7 years
P99 ingest2.5 s
javaOne Dark Pro
1public record AuditEvent(String eventId, String tenantId, String actorId, String action, Instant eventTime) {
2 public String partitionKey() { return tenantId + ":" + action; }
3}
pythonOne Dark Pro
1def is_high_risk(action: str) -> bool:
2 return action in {"iam.policy.update", "secret.read", "user.impersonate"}
typescriptOne Dark Pro
1export interface AuditEvent { eventId: string; tenantId: string; actorId: string; action: string; outcome: "allow" | "deny"; }

Why interviewers care

Audit Logging interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement and Audit Logging Mission that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Separate **security audit events** from noisy application debug logs—auditors ne
  • Metrics: Peak audit EPS, Hot retention, Cold WORM, P99 ingest
  • Treat audit logs as **evidence**: append-only, tamper-evident, independently rep
Interview tip
When discussing Problem Statement and Audit Logging Mission, quantify EPS, retention tiers, and integrity proof before naming vendors.
Avoid
Do not conflate debug logging with audit evidence or skip deny outcomes and tenant isolation.

Section Rescue Kit

Buzzwords to use:

WORMOCSF

Safe statements:

  • "For Problem Statement and Audit Logging Mission, I separate evidence integrity from search convenience."
  • "I would state retention and witness RPO before picking storage engines."
  • "Tenant isolation is enforced in the query planner, not just the UI."
Design Audit Logging - System Design | WinJob | WinJob