Audit service architecture and storage ownership #1952
sriaradhyula
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related PR
Summary
This proposes making
audit-servicethe owner of audit log ingestion, storage, read APIs, and storage backend selection.Event producers send JSON audit batches to a lightweight FastAPI service. The service validates and normalizes records, places them on a bounded in-memory queue, and flushes asynchronously to either local disk or S3. If audit-service is unavailable or the queue is full, producers should warn/drop audit events and keep the product path non-blocking.
Proposed flow
flowchart LR subgraph PRODUCERS["Audit event producers"] WEB["Web UI / BFF"] PY["Python services"] BOT["Slack / Webex bots"] FGA["OpenFGA authz bridge"] end UI["RBAC Audit UI / operators"] HEALTH["health checks"] SVC["audit-service FastAPI"] QUEUE["bounded asyncio.Queue"] DROP["producers warn/drop<br/>non-breaking audit path"] WORKER["background flush worker"] LOCAL["local NDJSON(.gz)<br/>/var/lib/caipe-audit-service"] CLEANUP["local retention cleanup<br/>default 1 day"] S3["S3 Parquet objects<br/>minute/date partitions"] WEB -->|"POST /v1/audit/events<br/>JSON event batches"| SVC PY -->|"POST /v1/audit/events"| SVC BOT -->|"POST /v1/audit/events"| SVC FGA -->|"POST /v1/audit/events"| SVC UI -->|"GET /v1/audit/events"| SVC HEALTH -->|"GET /readyz<br/>GET /v1/audit/status"| SVC SVC -->|"validate + normalize"| QUEUE QUEUE -.->|"queue full / service down"| DROP QUEUE -->|"batch by size or interval"| WORKER WORKER -->|"AUDIT_SERVICE_BACKEND=local"| LOCAL LOCAL --> CLEANUP WORKER -->|"AUDIT_SERVICE_BACKEND=s3"| S3 SVC -->|"read query"| LOCAL SVC -->|"read query"| S3Design notes
audit-serviceis the only component that reads/writes audit storage.Discussion points
Beta Was this translation helpful? Give feedback.
All reactions