StoicBuilder

HandbookXIV the VallumAudit logs

XIVthe Vallum, Defend it

Audit logs

1 min readUpdated 28 November

In plain words

An audit log records security-relevant actions, such as sign-ins, permission changes, exports and deletions, with who did it, to what, when and from where, kept where the person acting can't change it.

Where you see it

A Harbor customer asks who deleted their production project last Tuesday. The audit log answers: a teammate's API token, from an unfamiliar IP address, two minutes after the token was created. Without it you would only know the project is gone.

audit_events (one row)database
{ "at": "2026-12-01T14:02:11Z", "actor": { "type": "api_token", "id": "tok_91c", "user": "u_118" }, "action": "project.delete", "target": { "type": "project", "id": "prj_42" }, "account": "acc_7", "ip": "203.0.113.9", "result": "success", "requestId": "req_5d1" }
Who, what, which, when, from where and whether it worked. No request body, no secrets.

What goes wrong

  1. Mixing audit events into application logs

    Application logs are sampled, rotated after a few days and full of noise. Audit events need their own store, with long retention and no way to delete them early.

  2. A trail the attacker can edit

    If the credentials that change data can also delete the audit trail, the trail proves nothing after a breach. Write audit events somewhere the app can append to but not change.

  3. Recording too much

    Full request bodies in the audit log copy passwords, tokens and personal data into one more place to protect. Record the action and the identifiers, not the payload.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Add an audit log for security-relevant actions: sign-ins, failed sign-ins, role and permission changes, API token creation, data exports and deletions. Record actor, action, target, account, time, IP and result in a separate table the app role can insert into but not update or delete, and never include secrets or request bodies.

Quick check

Sign in to earn +10 XP for it

Where should Harbor write its audit events?

Got a prompt that touches audit logs?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.