Authentication audit logs: design sign-in records for investigation and detection
An authentication audit log records authentication requests and outcomes, plus identity and authenticator changes, with time and actor context. It helps teams investigate account compromise, diagnose failures, and verify controls. Logging only success or failure can leave the cause unclear; logging passwords or tokens can turn the log into a credential leak. Design event fields, protection, retention, and alerts together.
Core fields to log
| Field | Why it matters | Example |
|---|---|---|
| Event time and zone | Correlate events and determine sequence | UTC timestamp from synchronized clock |
| Actor | Identify the user or service making the request | Internal account ID, service principal, role-session ID |
| Event and outcome | Distinguish success, failure, and reason | Sign-in failure, MFA denial, lockout, reset, enroll, revoke |
| Authentication context | Analyze risk and applied policy | Authenticator type, trusted IdP, policy, assurance level |
| Source and target | Investigate suspicious location, device, or app | IP, device ID, client app, target service |
| Correlation IDs | Search related events across components | Request ID, session ID, trace ID, approval ticket |
Do not normally log plaintext passwords, private keys, access tokens, MFA secrets, or reusable recovery codes. If analysis needs a value, consider recording its state, type, pseudonymous identifier, or safe fingerprint instead of the credential itself. Minimize sensitive personal data.
Design sequence
**Define purpose and events.** Decide whether the log supports account-compromise detection, audit, dispute resolution, or troubleshooting. List sign-ins, denials, MFA changes, recovery, lockout, and administrator policy changes.
**Choose a common event format.** Structure event ID, time, actor, outcome, source, target, policy, and correlation ID. Map service-specific terms so central search uses consistent meaning.
**Make time and identity reliable.** Synchronize clocks, avoid shared personal accounts, and preserve identifiers linking federated sign-ins and assumed-role sessions to the original user.
**Protect log transport and storage.** Send records centrally and restrict access. Separate log operators from those who control retention or deletion; record access to and changes in the audit system.
**Set retention and search expectations.** Define retention, long-term retrieval, deletion, and capacity based on applicable law and organizational needs. Do not assume one universal period.
**Connect detection to response.** Review signals such as repeated failures followed by success, unusual MFA changes, privilege elevation after recovery changes, or sensitive actions after new authenticator enrollment. Check that alerts reach a responsible team and create incident tickets.
**Test missing-log scenarios.** Verify that permission errors, transfer outages, storage limits, and service failures are detected and recoverable. Use risk analysis to decide whether sensitive authentication operations may proceed when logging is unavailable.
Synthetic event example
This example illustrates a format only. It is not a log generated or tested in a real system.
{
"event_time": "2026-11-18T02:15:30Z",
"event_type": "authentication.failure",
"actor_id": "user-8f12",
"authenticator_type": "security_key",
"result": "denied",
"reason_code": "challenge_not_verified",
"source_ip": "192.0.2.24",
"client_id": "admin-console",
"request_id": "req-a1b2c3"
}The example contains no private key or authentication token. Normalize reason codes to the level needed for analysis rather than exposing raw product errors. IP addresses and device identifiers can also be personal or sensitive operational data, so govern access and retention.
How it differs from session recording
An authentication audit log records who tried to access, when, and with which authenticator and policy. Privileged session recording can capture commands and output after access succeeds. They complement each other: a successful sign-in does not show later work, and a session recording alone may not identify who initiated the session. NIST SP 800-53 treats audit generation, review and analysis, protection, and retention as distinct controls. Correlate identity-provider, application, and system logs as needed.
References
[NIST SP 800-53 Rev. 5](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf) — AU-2, AU-3, AU-6, AU-9, AU-11, AU-12
[NIST SP 800-92: Guide to Computer Security Log Management](https://csrc.nist.gov/pubs/sp/800/92/final) — general log-management guidance