Skip to content

docs: add a guide to stream audit events to a SIEM - #167

Draft
Bccorb wants to merge 2 commits into
docs/login-hooks-custom-claims-guidefrom
docs/stream-audit-events-siem-guide
Draft

Bccorb wants to merge 2 commits into
docs/login-hooks-custom-claims-guidefrom
docs/stream-audit-events-siem-guide

Conversation

@Bccorb

@Bccorb Bccorb commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Closes #155. Adds operate/stream-audit-events-siem.mdx: audit sinks over OTLP and syslog, Collector recipes, the event field reference, and verifying the hash chain from what the SIEM holds.

Merge with the auth API v0.23.0 release, not before. Audit sinks need API v0.23.0, which is held (fells-code/seamless-auth-api#566). The page opens with a caution, and its versions table marks the console page (fells-code/seamless-auth-admin-dashboard#343) and CLI commands (fells-code/seamless-cli#359) as unreleased. The export and integrity check it also uses are released.

Stacked on #166 (base docs/login-hooks-custom-claims-guide), which is stacked on #165. Merge in that order. This one adds the webhooks guide's links to the new page.

What it covers

  • How a sink works: its own cursor, batches of 100, retry forever with backoff to one minute, no dead letter, at least once (dedupe on seq), start after the newest event or replay with startAfterSeq, credentials only as *_AUDIT_SINK_SECRET env var names, and retention held by every sink, disabled ones included, until it is deleted (Brandon's decision of 2026-11-07).
  • Settings and setup: OTLP and syslog settings, the console, CLI and admin API, sink status and the test record.
  • Recipes: a Collector with the debug exporter to check arrival, then splunk_hec, elasticsearch and datadog, and rsyslog imtcp with TLS for syslog.
  • Field reference: the seamless-auth-events/1 line (meanings from AuthEventSchema), the OTLP record and attributes, and each syslog message part.
  • SD-ID: shown as seamless@<enterprise number> with a caution that it changes before release, never the RFC 5612 documentation number the branch uses as a placeholder.
  • Hash chain: a Python script that checks hashes, links, gaps, an anchor, the manifest, and that the readable fields match the hashed payload (only payload is hashed, so a SIEM copy with an edited field would otherwise pass). It tolerates repeats, since delivery is at least once. A note on what a pass proves and how to compare with GET /admin/auth-events/integrity.
  • Cross-link: the retention section of understand/security.mdx mentions sinks, marked as v0.23.0 and unreleased.

How the script was proven

On origin/feat/audit-sinks, a temporary spec (not committed) ran against its own Postgres 18 container: it created an OTLP sink and a syslog sink pointed at local listeners, wrote three audit events (one with a non-ASCII user agent, one login_suspicious), delivered both sinks and ran the export. The script passes on the export, on the three lines taken from the OTLP bodies, and on the three taken from the octet-framed syslog messages, and with a duplicated line and a test record mixed in. It fails on a changed readable field (fields differ from payload), a changed payload (hash_mismatch), a dropped line (sequence_gap) and a wrong anchor. The export is in the page as the sample. The container and spec were removed afterwards.

Vendor and protocol facts, each checked on 2026-11-07

For review

  • Datadog path: the recipe uses the contrib datadog exporter. Datadog's own page now leads with the Collector's OTLP HTTP exporter to https://otlp.<site>; the page links it but does not give that config, because the exporter name there (otlp_http) differs from the one I know (otlphttp) and I could not settle which Collector versions accept which.
  • rsyslog closing the connection: the sink counts a batch delivered when the collector closes its side after the sender ends. That was tested against a Node TLS listener in the API's tests, not rsyslog. The page says so.
  • Elastic and Splunk field names for the raw body are left out, since they depend on the mapping and I did not verify them.

Testing

  • npm run typecheck: 0 errors, 0 warnings, 0 hints.
  • npm run lint: exit 0.
  • npm run build: 77 pages built. The pre-commit hook ran the build again.
  • A script confirmed every internal link and anchor in all three new pages, migrate-from-auth0 and security resolves in dist. The page is in dist/llms.txt and the sitemap.
  • Not run: npm run check:matrix, any real SIEM or Collector, and nothing against a released API (none can be until v0.23.0).

@Bccorb
Bccorb force-pushed the docs/stream-audit-events-siem-guide branch from 450802f to 2e485fd Compare November 8, 2026 02:31
Covers how audit sinks deliver (own cursor, retry forever, at least
once, retention held by every sink until it is deleted), OTLP and
syslog settings, setup through the console, CLI and admin API, recipes
through an OpenTelemetry Collector to Splunk, Elastic and Datadog and
syslog to rsyslog, the event field reference for the export line, OTLP
records and syslog messages, and a hash chain verifier proven against a
real export and the matching OTLP and syslog records.

Closes #155
@Bccorb
Bccorb force-pushed the docs/login-hooks-custom-claims-guide branch from a5d8f98 to 3b213f4 Compare November 8, 2026 02:46
@Bccorb
Bccorb force-pushed the docs/stream-audit-events-siem-guide branch from 2e485fd to 5d7f5f5 Compare November 8, 2026 02:46
v0.23.0 refuses syslog sinks until their records carry the registered
structured data ID (seamless-auth-api#586).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant