Skip to content

Event Schema

The event schema is the Event Reference for programs: every event type and every field, with its type and the version it first appeared in, under fixed addresses. Use it to generate or check a parser, a field mapping or detection rules, and to learn what a release changes before it reaches your SIEM.

In short

Validate events against event.schema.json, which also describes every field and event type. Read schema_version in an event to know which version it was sent under, and watch changelog.atom for new versions. The files are generated from the server's own code, and a forwarder sends only what they declare, so they do not trail the implementation.

Files

Address Content Format
/events/schema/event.schema.json One forwarded event: every field, every event type JSON Schema, draft 2020-12
/events/schema/openapi.json The request an HTTPS webhook forwarder sends OpenAPI 3.1, webhooks
Changelog What each version added, changed, deprecated and removed Keep a Changelog
/events/schema/changelog.atom The changelog as a feed, one entry per version Atom, RFC 4287
/events/schema/<version>/event.schema.json, openapi.json The files of one version, for example 1.2.0

The addresses are stable. The files under <version>/ do not change once the version is out; the files at the top always describe the current version. Every schema names its own address in $id and its version in x-schema-version.

Each file is in the standard format for its kind, so the tools you already have read it: a JSON Schema validator checks events, an OpenAPI tool renders or generates a webhook receiver, a feed reader follows the changes.

Versions

The schema has its own version, apart from the product's, and follows Semantic Versioning:

  • A new minor version (1.1.0 to 1.2.0) only adds: fields, event types, values, deprecation notices. A parser built for 1.x reads every later 1.y.
  • A new major version (1.x to 2.0.0) removes or changes something a receiver may rely on. It is announced by the deprecations before it and comes only after the notice period.

Every event carries the version it was sent under:

{"xplicittrust": {"schema_version": "1.2.0", "event_class": "authentication", "event_type": "logged_in", "…": "…"}}

The schema for that event is /events/schema/1.2.0/event.schema.json. A receiver that sees a minor version it does not know can go on; one that sees a new major version should stop and be updated. schema_version is sent since version 1.2.0; an event without it is from version 1.0.0 or 1.1.0.

Schema Product release
1.2.0 1.139 Adds schema_version; the first published version
1.1.0 1.138
1.0.0 1.137 Every field under the xplicittrust key
0.1.0 1.136 and earlier Before the schema had versions

The changelog lists what each of them changed.

Reading the schema

event.schema.json in short:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.xplicittrust.com/events/schema/event.schema.json",
  "x-schema-version": "1.2.0",
  "x-product-release": "1.139",
  "type": "object",
  "required": ["xplicittrust"],
  "properties": {
    "xplicittrust": {
      "type": "object",
      "required": ["created_at", "event_class", "event_id", "event_type", "message", "schema_version", "session_type"],
      "x-common-optional": ["actor", "client", "remote_address", "tenant_name", "…"],
      "properties": { "stop_reason": { "$ref": "#/$defs/stop_reason" } },
      "allOf": [
        {
          "if": { "properties": { "event_class": { "const": "packet_capture" }, "event_type": { "const": "capture_deleted" } } },
          "then": {
            "title": "packet_capture.capture_deleted",
            "description": "A capture and its packets were deleted: reason is operator or retention.",
            "required": ["capture_id", "client_ids", "clients", "reason"],
            "properties": {
              "reason": { "description": "Who deleted it: operator (an administrator) or retention (the controller, when the capture's time was up)." }
            },
            "x-since": "1.1.0",
            "x-stability": "stable"
          }
        }
      ]
    }
  },
  "$defs": {
    "stop_reason": {
      "type": "string",
      "description": "Why a leg of a packet capture or of an Experience Check ended: …",
      "examples": ["bytes", "duration", "error", "manual", "packets", "unsupported"],
      "x-since": "1.1.0",
      "x-stability": "stable"
    }
  }
}
  • xplicittrust is the one key of a forwarded event's JSON object. Every field sits under it, in a syslog message as in a webhook batch.
  • $defs describes each field once: its type, for strings a format (uuid, date-time; an IP address is ipv4 or ipv6), for objects their properties, for arrays their items. A field has the same type in every event that carries it.
  • required of the event object names the fields every event has. x-common-optional names those any event may have, depending on the session it was recorded in.
  • allOf has one entry per event type: then.properties are the fields that type adds to the common ones, then.required those it always has. A property's description says what the field means on this event where its general description covers several.
  • examples lists the values a field takes today. It is not a closed list, which is why it is not an enum.
  • deprecated: true marks a field or event type whose removal is announced; x-deprecated-since is the version that announced it.

The x- keywords are annotations: JSON Schema lets a schema carry keywords a validator does not know, and validators ignore them. x-since is the version an entry first appeared in (on a property of an event type: the version that field joined the event). x-stability is stable or preview.

What stays the same

For every entry with "x-stability": "stable":

  • A field keeps its name, its type and its meaning. An event type keeps its name and its required fields.
  • Nothing is removed or renamed without notice. The entry is first marked deprecated, which appears in the changelog and the feed; it is still sent during the notice period, and a renamed field is sent under both names. The version that stops sending it is a new major version.
  • New fields, new event types and new values of a field can come with any minor version. They are listed in the changelog.

Entries with "x-stability": "preview" belong to features that are not generally available yet. They can still change.

How the schema is kept true

The schema is not written after the fact. It is the list the forwarder sends from:

  • Nothing undeclared is sent. Before an event leaves, the forwarder holds it against the schema of its own version. A field the schema does not declare for that event type is not sent, and neither is a value of another type than declared. A new field therefore reaches you only together with a schema entry and a line in the changelog.
  • A released version cannot be changed. Every change to the server is checked against the schemas of the versions that are out. A change that would retype, rename or remove a released field, or add something to a version after the fact, does not pass.
  • Every event type is tested. Each event the server can write is produced in a test and compared with its schema entry: the required fields are there and every value has its declared type.

The files under <version>/ are therefore safe to build on and to cache: what they say about a version stays what that version sends.

What a receiver should do

  • Ignore fields it does not know, and accept event types it does not know. The schema allows additional fields for this reason; do not validate with a schema that forbids them.
  • Treat examples as examples, not as an enumeration.
  • Deduplicate on event_id, except where it is 0: a forwarder's own events, event_forwarder.heartbeat and event_forwarder.test, are not entries of the event log and all carry 0.
  • Read schema_version, or subscribe to changelog.atom, to learn about new fields and deprecations.