Registro in sola aggiunta di chi ha fatto cosa e quando, ricercabile ed esportabile.
Spec — Audit log
Status: draft · Created: 2026-11-10
1. Context and goal
Admins and auditors can answer who did what and when for any change in the organization, from a record nobody can alter.
2. Functional requirements (EARS)
- FR-1: WHEN a write, a sign-in, or a change of permissions or settings happens, THE SYSTEM SHALL record an entry with the actor, action, target, UTC time, IP address and request id, in the same transaction as the change.
- FR-2: THE SYSTEM SHALL reject any update or delete of an entry, including one from the application's own database user.
- FR-3: THE SYSTEM SHALL chain each entry to the hash of the previous one, so a verification run reports the first altered or missing entry.
- FR-4: WHEN an admin searches by actor, action, target or time range, THE SYSTEM SHALL return the first page of results within 2 seconds for up to 10 million entries.
- FR-5: WHEN an admin exports a filtered range, THE SYSTEM SHALL build CSV or JSON Lines in the background and email a download link that expires after 24 hours.
- FR-6: THE SYSTEM SHALL mask passwords, tokens and keys before an entry is written, so no secret is ever stored in the log.
- FR-7: THE SYSTEM SHALL keep entries for at least 1 year, and remove older ones only through a scheduled retention job that writes an entry of its own.
3. Out of scope
- Streaming entries to an external SIEM.
- Recording read access to every record.