Skip to main content
HydroGo
SecurityAudit trail

Audit trail

Who changed what and when, plus optional redacted request bodies for admin API calls.

HydroGo writes security-relevant and content-changing actions to an append-only audit trail: signing in, role changes, token and API key lifecycle, publishing, content edits and more. Open it in the admin under Audit Log, or read it from GET /api/v1/admin/audit.

What an entry contains

FieldMeaning
atWhen it happened (UTC).
actor, actor_idThe user who did it, or system for background work.
actionWhat happened, for example auth.api_key.issued.
resource, targetThe kind of thing changed and its id.
request_idThe request id, to match logs and API error responses.
before_json, after_jsonCompact before and after details where the action records them (for example version numbers).

Filter the list by actor, action, resource or target, in the admin or the API:

BASH
curl 'https://cms.example.com/api/v1/admin/[email protected]&action=admin.request&limit=50' \
  -H 'Authorization: Bearer hyd_…'

Recording request bodies

By default an entry says *that* something changed. To also see *what the client sent*, turn on request-body logging. It is off by default.

audit:
  log_request_bodies: true

With it enabled, every state-changing admin API request (POST, PUT, PATCH, DELETE under /api/v1/admin/) by a signed-in user adds one admin.request entry containing the method, path, status code, client IP, user agent, redacted query string and the redacted JSON body.

SafeguardBehaviour
Secrets are redactedAny JSON key whose name contains password, secret, token, authorization, cookie, credential, private, signature, api_key, totp, mfa, recovery or otp is replaced by [redacted], at any depth.
Bodies are cappedDetails are kept under a few KiB (about 3.8 KiB). Long strings and deep structures are shortened; if it still does not fit, the body is dropped and body_truncated is set.
Oversized requestsA body larger than 64 KiB is not captured at all; the entry says so.
Only JSONFile uploads and non-JSON requests are skipped.
The request is untouchedThe handler still receives the complete body; capture only reads a bounded copy.
details of an admin.request entry
{
  "method": "PUT",
  "path": "/api/v1/admin/pages/pg_01",
  "status": 200,
  "ip": "203.0.113.7",
  "user_agent": "Mozilla/5.0 …",
  "body": { "title": "About us", "password": "[redacted]" }
}
Even redacted, bodies can contain personal data or unpublished text. Turn this on when you need accountability (regulated teams, agencies handing over a site) and restrict who may open the Audit Log.

Retention

Audit entries live in your database. Include them in backups, and prune according to your own retention policy.