Passkin

Audit logs

Status: built (2026-10-05). Tests: apps/auth-broker/tests/audit.test.ts.

Every consequential thing that happens in a project — a person signs up, a user is banned, an organization changes, an identity provider is connected, an admin acts through the Admin Portal, a directory provisions someone, a developer calls the API — is written to the project's audit log. It is searchable, exportable, viewable per organization (for the customer's own admins), streamable to a SIEM, kept for as long as you set — and tamper-evident.

Tamper-evident

Every event of a project is numbered (seq) and chained: hash = SHA-256(previous hash, seq, this event's content). Appends to a project's chain are serialized, so concurrent writes still produce one chain. GET /v1/audit-logs/verify walks it and recomputes every hash:

{ "ok": true, "checked": 1842, "unchained": 0, "problem": null, "headSeq": 1842 }
{ "ok": false, "problem": { "seq": 913, "id": "audit_…", "reason": "hash_mismatch" } }   // an event was edited
{ "ok": false, "problem": { "seq": 914, "reason": "gap" } }                              // one was removed (middle or end)
{ "ok": false, "problem": { "seq": 913, "reason": "chain_broken" } }                      // a link was changed

What this proves, honestly: that what is stored now is what was written, in order, with nothing removed or inserted — to anyone who can read the log and recompute it, including an auditor you give an export to (each exported event carries its hash). What it does not do: it cannot stop someone with direct database access from rewriting the whole chain from a point forward — for that, stream events out as they happen (below) and keep the stream elsewhere. Retention removes the oldest events; the first one retained is the anchor, and from there the chain must be unbroken.

What is in an event

id, seq, action (user.banned, organization.member.added, sso.connection.activated, directory.user.deprovisioned, invitation.created, users.imported, project.updated…), actor ({id, type}: user, admin, api_key, system; Admin Portal actions are admin with via: admin_portal), target ({type, id}), organization_id when it is about one, metadata (what changed, never a secret), ip_address, user_agent, created_at, hash.

Search and export

Backend API (/v1/…, secret key) and dashboard (/v1/manage/projects/:pid/…):

GET /audit-logs newest first; ?action= (exact, or user.* for a prefix) &actor_id= &target_type= &target_id= &organization_id= &from= &to= &limit= (≤1000) &cursor= → {data, next_cursor}
GET /audit-logs/export ?format=csv|ndjson|json, same filters, up to 5000 per call; Passkin-Next-Cursor header for the rest. CSV cells that a spreadsheet would run as formulas are neutralised
GET /organizations/:oid/audit-logs and …/export the same, for one organization — what you show that customer
GET /audit-logs/verify the chain check above

The Admin Portal (intent: "audit_logs", SSO.md) gives the customer's IT admin their organization's events, a filter, and a CSV download — without access to your dashboard and without seeing anyone else's.

Streaming to a SIEM

Subscribe a webhook endpoint to audit.log and it receives every activity entry as it is written (signed, retried, replayable, with the event's seq and hash):

curl -X POST https://auth.passk.in/v1/manage/projects/$PROJECT/webhooks -H "Authorization: Bearer $DASHBOARD_TOKEN" \
  -H "Content-Type: application/json" -d '{"url": "https://http-intake.logs.datadoghq.com/…", "events": ["audit.log"]}'

Native log streams: Datadog, Splunk and any HTTPS collector

For the common SIEMs there is no function to write: a log stream sends each entry in the vendor's own format, with the credential the vendor wants (dashboard → Audit log → Stream to your SIEM, or the API):

curl -X POST https://auth.passk.in/v1/manage/projects/$PROJECT/log-streams -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"type": "datadog", "site": "eu", "token": "<Datadog API key>"}'
# Splunk:  {"type": "splunk", "url": "https://http-inputs-acme.splunkcloud.com/services/collector/event", "token": "<HEC token>"}
# Others:  {"type": "json",   "url": "https://logs.example.com/ingest", "token": "<optional bearer token>"}
Type What is sent Credential
datadog POST of an array with one log: ddsource: passkin, service, hostname, ddtags (project, action, actor_type), a one-line message, date, and the whole entry under passkin DD-API-KEY header. The address is Datadog's own for the site (us1, us3, us5, eu, ap1): nothing else can be typed
splunk One HEC event: time (epoch seconds), host, source: passkin, sourcetype: passkin:audit, event = the entry with its project_id Authorization: Splunk <token>
json The entry (with project_id) as a JSON object Authorization: Bearer <token>, when given

A stream is a webhook endpoint underneath — the same queue, the retries (30 s up to 24 h) while the collector is down, the switch-off after many deliveries in a row fail all their attempts, and the delivery log — subscribed to audit.log alone, but it is not listed or editable as a webhook. The token is stored encrypted and never returned (the API says only has_token); change it with PATCH …/log-streams/:id. Splunk and generic collectors must be public https hosts (checked when saved and again when connecting). Test (POST …/log-streams/:id/test) sends one made-up entry and says what the collector answered. A stream hears of its own creation, like any other change. Up to five per project; log_stream.created, .updated and .deleted are in the log themselves, with the host but never the token.

Retention

audit_retention_days on the project (7–3650, default 365; PATCH /v1/manage/projects/:pid). A scheduled run — POST /internal/cron/maintenance with Authorization: Bearer $CRON_SECRET, daily is enough — removes what is past it, and tidies delivery logs of webhooks and back-channel logouts (30 days delivered, 90 dead), spent Admin Portal links and actor tokens.

Not built yet

Native connectors for Sentinel, Elastic and S3/GCS (Datadog, Splunk and any JSON collector are built), batching of entries into one request, per-organization streams, anchoring the chain head in an external timestamp service, field-level redaction rules, saved searches and alerts, sign-in and token events at scale (the log is for consequential actions; per-token events would drown it — they belong in analytics).

Ready to try it?

Create a project — the dashboard fills these snippets in with your own keys.

Open the dashboard