Repository navigation
[Design Discussion] Audit logging #5601
ThumulaPerera
started this conversation in
Design
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 Feature Issue
#5591
Problem Summary
Admins can't rebuild what happened in a security incident or tell who was responsible, and end users can't review activity on their own identity. ThunderID has no rule for which events are audit-worthy, no common record shape, and nowhere to store or view audit records. This design defines audit events, stores them durably using the eventing framework in #5590, and shows them to admins and end users.
High-Level Approach
Terminology:
u1to groupg1, the target is the membership and the subject isu1.The approach:
auditevent type is delivered at least once.1. What counts as an audit event
Record each attempt by one actor to produce one of these outcomes:
Rules
Every audited action is listed in a catalog. The catalog is used to validate events, to generate the docs list, and for Console labels.
2. Record shape
a1user.createu1u1succeeded,denied(a security decision refused it) orfailed(allowed, but didn't complete)deniedAUTH-1002The eventing framework fills in the event ID, time, trace ID and other request context from #5590. Records keep a copy of display names, so they stay readable after the target is deleted.
3. Store
auditevents from [Design Discussion] Generic eventing framework #5590 and writes each one to the store.auditdbdatasource, because audit data grows fastest, has its own retention, and shouldn't share a DB with the sessions every sign-in depends on. Records are scoped by deployment ID, so one DB can serve several deployments.4. Immutability and Tamper evidence
In the initial cut, ThunderID will not provide built-in support for this. A deployment which requires this can configure a DB that provides tamper evidence and immutability as the audit DB.
5. APIs and Console
GET /audit-events, with filters for time, actor, subject, target, action, outcome and trace ID.GET /users/me/activity, returning their own events with fewer fields (no admin IDs or internal reasons).Architecture Overview
All of this lives in a new
internal/auditpackage. Services that publish audit events depend only on the event type and the catalog, never on the store.Security Considerations
auditdbthat provides tamper evidence and immutability.Impacted Areas
internal/auditpackageauditdbschema (PostgreSQL, SQLite)deployment.yaml,default.json, Helm chart) and docsAlternatives Considered
Alternative 1: Store audit records in
runtime_persistentQuestions for Community Input
All reactions