KatInterview

Building Access Control and Immutable Audit Systems

System DesignModel answer
MediumModel answerSystem Designauthorizationaudit-loggingdistributed-systems

Last updated

Design a low-latency authorization framework and tamper-proof audit logging infrastructure for a high-throughput financial application.

You're architecting the security layer for a financial services platform that processes large volumes of transactions. The system needs robust access control and comprehensive audit trails to meet regulatory requirements.

Core Requirements

Access Control System:

  • Implement both role-based (RBAC) and attribute-based (ABAC) policies to handle complex rules like "analysts can view portfolios only within their assigned territories and only during business hours"
  • Authorization decisions must add minimal overhead since they're evaluated on every API call
  • The system must remain secure during partial outages—critical operations should fail safely if authorization state is uncertain

Audit Trail System:

  • Record every authorization decision (approved and rejected) plus all data-modifying operations
  • Logs must be append-only and verifiable against tampering
  • Support both real-time monitoring for security alerts and historical queries spanning multiple years for compliance reviews

Traffic Characteristics

  • Authorization checks: 50,000 per second during peak periods
  • Audit retention requirement: 7 years minimum

What to Cover

  • Overall system architecture with key components
  • How authorization decisions are evaluated efficiently
  • Caching strategies and how to invalidate stale permissions when roles or policies change
  • Storage architecture for audit data that balances query speed against long-term cost

Hints

Hint 1

Authorization latency is critical—consider where policy evaluation happens relative to application servers

Hint 2

Audit logs grow indefinitely but access patterns vary by age—think about tiering

Hint 3

Tamper-evidence requires cryptographic structures that link records together