Safeguard
Security Guides•

What admin and privileged actions should an application log?

A checklist of privileged actions to record in an audit trail: role changes, impersonation, data export, config edits and break glass use, with fields.

Safeguard Security Team
4 min read

Log every action that changes who can do what, reads sensitive data in bulk, or alters security settings: role and permission changes, admin logins, impersonation, data export, configuration edits and break glass account use. Record who, what, when, from where and the before and after values.

Why this list matters most

Ordinary user events tell you what customers did. Privileged events tell you whether the system itself was changed. If an attacker gains admin rights, the first useful evidence is a trail of what they did with them.

The OWASP Logging Cheat Sheet places these under higher risk functionality: user and privilege administration, admin actions, use of default, shared or break glass accounts, access to sensitive data, encryption and key activities, and data import and export. It also lists configuration changes among system events.

The checklist

ActionRecord
Role or permission granted or removedActor, target user, old role, new role
Admin or support loginActor, method, MFA result, source
Impersonation or act as userActor, target user, start, end, reason
User created, disabled or deletedActor, target, reason if given
API key or token created or revokedActor, scope, expiry, key ID (never the secret)
Security setting changedSetting name, old value, new value
Bulk data export or importActor, dataset, row count, destination
Access to sensitive records by staffActor, record type, record ID, ticket reference
Break glass account useActor, start, end, approver
Encryption key actionKey ID, action, actor

Store key IDs, not key material. The same goes for tokens.

Design rules

Write these as a separate audit stream. Different retention, different access, different alerting. The OWASP A09 guidance suggests an audit trail for high value transactions with integrity controls, such as append only database tables, so records cannot be altered or deleted unnoticed.

Make the audit write part of the action. If the role change commits but the audit entry fails, you have an unrecorded change. Either write both in one transaction or fail the action.

Record before and after values where it is safe to do so. Knowing that a role changed is useful. Knowing it moved from viewer to owner is evidence.

Never allow the admin user to edit or delete the audit stream through the same interface they administer.

Alerts worth setting

  • Any change that adds the highest privilege role.
  • Admin actions outside normal hours for that person or region.
  • Impersonation without a linked support ticket.
  • Any use of a break glass account.
  • A sudden large export.

Keep alerts few and each tied to a named person who responds. For protecting the stream itself, see protecting logs from tampering.

Quick check

Do support staff actions need logging too?

Yes. Staff access to customer data and impersonation are privileged actions and are often the first thing a customer or auditor asks about.

Should the audit log live in the main database?

It can, in append only tables with restricted write rights, but many teams also ship a copy to separate storage so a database compromise does not erase the trail.

Safeguard's policies, gates and agent identity controls record decisions the same way, and compliance and evidence automation collects proof for audits. Try a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.