Architecture
Excubio takes events from monitoring in the customer's network, reduces them to alerts, groups related alerts over the customer's inventory, routes them to teams from a reviewed spec, and pages named on-call people. A watchdog outside the customer's network pages when the customer's own alerting can't.
The documents are listed in the README.
1. Principles
- Separate failure domains. A hub the customer runs is in the customer's network, the cloud at hosting provider A, Watch at hosting provider B with its own carrier. The paging path and the watchdog never share a network, a data centre or a carrier with what they protect. A hub on a managed installation (operations.md §1) runs at provider A with the cloud and shares its failure domain, and the hubs of an installation share their installation's: a hub's local fallback channel covers a failure of the cloud's application, not one of provider A; Watch, at provider B, pages when its heartbeats stop, for a whole installation as one failure (§7).
- Data stays home. Events, alerts, groups, decisions, inventory snapshots and e-mail stay in the hub. Inventory read from SaaS systems (a ServiceNow instance) flows into the hub, never out. The cloud receives only the page payload, which the spec can redact; other data leaves only to targets declared in reviewed spec (webhooks, tickets, e-mail, write-back) (compliance.md §1). Push contents are encrypted to the person's devices; Apple and Google carry only ciphertext (mobile.md §3). A hub on a managed installation keeps the same data in the vendor's cluster instead, with the vendor as its processor (compliance.md §1).
- The hub only dials out. Hub–cloud and hub–Watch traffic is outbound HTTPS through the customer's forward proxy. Nothing connects into the customer network from outside. Where the hub doesn't reach a network (a vendor-run hub and the customer network, a self-hosted hub and a remote site or DMZ), a relay in that network dials out to the hub and carries intake in and the hub's connections out (§13); the network still accepts no connection. A managed installation accepts connections from the internet for its hubs: HTTPS intake, e-mail, relays and their UIs (§11 Front door).
- Pages are scarce. Noise reduction and correlation run before routing: related alerts of any source form one group with one page, which names the probable cause. Throttled or grouped messages are merged and counted, never dropped.
- Grouping, not suppression. A wrong correlation must cost an extra alert in a page, never a missed page. Groups attach their members to one incident and never suppress them.
- Inventory from what exists. Excubio discovers nothing itself. It merges the CIs, services and ownership that the customer's CMDBs and ITSM tools already hold into one versioned snapshot (pipeline.md §15).
- Routing is a reviewed spec. One typed spec tree per hub, edited as change sets that are validated, tested, replayed against history and approved by the teams whose paging they change (spec-format.md). Correlation patterns are spec too.
- Decisions are recorded with their inputs. A routing decision is a function of the alert, its group with the members it used, the spec revision, the routing level and the inventory snapshot. It is stored with all of them, so it can be explained and replayed (pipeline.md).
- An upgrade changes no decision. New routing semantics arrive as a routing level that a change set adopts (spec-format.md §7).
- Named people. Every page, ack and shift belongs to a person. The licence counts rotations, so there is no reason for shared users (§12).
- Postgres only. Each part keeps its state in PostgreSQL 18 without extensions. The hub runs with an embedded Postgres on a single node or an external one for HA (operations.md).
- Air-gappable hub. The hub downloads nothing at runtime. SNMP trap packs and MIB tables arrive as signed bundles (operations.md §5). A self-hosted hub can run without internet access but for the cloud and Watch; a managed installation is on the internet.
2. Parts
| Part | Binary | Runs | State |
|---|---|---|---|
| Hub | excubio-hub | An installation: in the customer network, one node with embedded Postgres or 2+ nodes on external Postgres, serving one hub (standalone); or managed, run by the vendor at provider A, serving one tenant's hubs or, shared, many tenants' (operations.md §1) | Spec revisions, inventory imports and snapshots, events, alerts and groups, decisions, actions, replicas of incidents and shifts, audit (schema/hub.sql) |
| Cloud | excubio-cloud | Provider A, EU, three zones, multi-tenant | Tenants, people, teams, rotations, shifts, incidents, deliveries, responses, audit (schema/cloud.sql) |
| Watch | excubio-watch | Provider B, EU, two locations, multi-tenant | Checks, heartbeat state, rotation replica, notifications (schema/watch.sql) |
| Relay | excubio-relay | A network the hub doesn't reach: the customer network of a vendor-run hub, a remote site, a DMZ; one or more per hub (§13) | Its spool of datagrams not yet acknowledged, its key and certificate (operations.md §12) |
| App | Excubio for iOS and Android | The on-call people's phones | Device key and token, a cache of the person's incidents and shifts (mobile.md) |
| Discover | excubio-discover | A jump host, one-off | Local files only (migration.md) |
Helper binaries: excubioctl (CLI over the hub and cloud APIs) and
excubio-msg (the opcmsg-compatible sender); see cli.md.
The hub has two listeners. The intake listener takes events (HTTPS,
SNMP over UDP, syslog over UDP, TCP and TLS, and SMTP); the management listener serves the UI and /api/v1.
They can share a port on small installs; on a managed installation the
management listener serves the HTTPS intake too
(operations.md §2). Intake tokens and management
sessions never mix. A hub that has relays has a third, the relay
listener, which takes only relays' connections (§13).
3. Domain model in one page
Tables are in the schemas. The essentials:
Installation (one database and its nodes; standalone: one hub, managed: those the cloud provisions)
Partitions, correlator shards, nodes, holiday regions
Hub (a tenant's unit: own spec, certificate, link, audit chain, data keys, relays)
Spec revision rN (immutable tree of TOML files; spec-format.md)
├─ Source, TrapRule, ValueMap how payloads become events
├─ Calendar named times of the week
├─ Heartbeat, StormRule, AutoClose,
│ DowntimeSchedule pipeline behaviour
├─ CorrelationPattern, ExpectRule correlation
├─ Classify, ActionRule routing
├─ InventorySource, InventoryModel,
│ TeamMap where inventory and ownership come from
├─ TicketProfile, Webhook, Secret outbound
├─ RoutingTest, ApprovalPolicy, Settings
ChangeSet (base rN + overlay) → validation, tests, replay impact, approvals → merge → rN+1
InventoryImport (per source: normalised records, last good kept)
InventorySnapshot (immutable merge: CIs with classes and aliases,
services with hierarchy, CI→service, group→team,
maintenance windows)
Event (as received, normalised; role problem | resolution | info | …) ──────┐
Alert (lifecycle of one namespace + key: open ⇄ acknowledged → closed) ◀──┘
├─ AlertTransition (every state change with its cause)
├─ AlertGroup (for alerts of kind group: pattern, cause, members with
│ roles)
└─ RoutingDecision (revision, level, snapshot, group, facts, actions, trace)
└─ Action (page, attach, notify, ticket, writeback, webhook, drop) → durable task
Downtime, HeartbeatState, Storm, Expectation
Cloud (per tenant)
Person ── ContactMethod, Device, Absence
Team ── membership(role) ── Rotation ── Layer ── LayerMember
│ └─ Override
└─ Shift (who was on call, stored)
Hub (enrolled) ── PageRequest ──▶ Incident (rotation, grouping key, group, alerts, policy,
│ involved rotations, merged into)
├─ Chain (per person: media chain progress)
├─ Delivery (person, medium, number or device, status)
└─ Response (person, channel, type)
NumberTest
Watch (per tenant)
Check (hub | push | reverse | synthetic) ── CheckState ── Notification
RotationReplica
A hub's rows carry its id and an installation's other hubs never see them (§12); everything under Hub above is a hub's. Teams and rotations are owned by the cloud. The hub holds a replica of team slugs and names, rotation names and team mail addresses, so the spec can reference them and validation can check them. People and phone numbers are never replicated to the hub, except the minimal rotation cache of the local fallback channel (§7).
4. Hub processing model
-
Store, then acknowledge. Every intake request is written to
eventin one transaction before the sender gets its response. SNMP traps and UDP syslog messages, which have no acknowledgement, are written on receipt. When the database can't take writes, HTTP intake answers503and SMTP452, and senders retry; traps and UDP syslog messages, which are never retried, go to a bounded spool on the node's local disk (snmp.spool_bytes, default 256 MiB) and are stored, with their receive time asspooled_at, as soon as the database is back. Messages that don't fit are counted and reported by a self-alert. -
Installations. An installation is one database with its nodes; it serves one hub (a standalone installation) or the hubs the cloud provisions (a managed one, operations.md §1). Every row of a hub's work carries the hub's id, and everything below that processes a hub's rows runs under that hub's row-level-security scope (§12). Partitions, correlator shards and link shards are the installation's and serve all its hubs, so the number of workers doesn't grow with the number of hubs. The numbers of correlator shards
C(--correlator-shards, default 1) and of link shards (--link-shards, default 1) are fixed atinitand stored in the database, likeP(below); a hub gets one of each when it is created, the one with the fewest hubs, the lowest of a tie, and keeps them. A standalone installation is the case of one hub whose lanes are all partitions, with one correlator shard and one link shard. -
Partitions. Events are processed in the installation's
Ppartitions, fixed atinit(--partitions, default 32) and stored in the database;Pis not part of any spec. Each hub has lanes, a run oflanespartitions from itslane_base: an event of the hub goes to partition(lane_base + hash(namespace, key) mod lanes) mod P, so all events of one alert run in order on one worker. A standalone installation's hub haslanes = Pandlane_base = 0; a hub of a managed installation has the lanes it is created with (1 by default) and aslane_basethe partition that the fewest hubs' lanes include, the lowest of a tie. Both are fixed for the hub's life, likeP: the partition of an alert owns it (Ownership, below), so a change would move every open alert and timer of the hub and give one alert two writers while either partition has unprocessed rows. A node runs a partition while it holds the partition's advisory lock on its dedicated lock connection. Spreading: withPpartitions andNlive nodes (those with a lock connection), a node's share is ⌈P/N⌉. A node takes free partitions while it holds fewer than its share, and releases, at a step boundary, only partitions it holds above its share. AsN× ⌈P/N⌉ ≥P, the live nodes take every partition; as no node releases below its share, a partition moves only when the number of live nodes changes, and then to the node that lacks its share. Correlator shards and link shards spread the same way, each kind with a share of its own. Every node checks every 5 s which locks of partitions, correlator shards and link shards no session holds; one that stays unowned longer than 15 s raises a self-alert, as pipeline.md §19 specifies. -
Advisory locks take two keys,
(class, key)(pg_advisory_lock(int, int)), so Excubio's locks can't collide with each other, and their key space doesn't overlap that of the one-key form, which the migrations' lock uses. "Hub" marks a lock of a hub installation's database, which serves all the installation's hubs; a key made from a hub's id keeps one hub's lock apart from another's, and two hubs whose keys collide only wait for each other. The classes:Class Lock Key 1 a partition (hub); a controller shard (§8, cloud) the partition; the shard 2 the activation lock (hub), one for the installation (Activation, below) 0 3 a link shard (hub): its holder runs the link's down stream (§5) of every hub of the shard, each fenced by the hub's own stream epoch, sends through each hub's local fallback channel (§7) and checks the conditions of each hub (pipeline.md §19); it opens each hub's first stream connection at a random time within 10 ms per hub of the shard, at most 10 s, of taking the shard, so the hubs of a shard don't connect at once the link shard 4 a correlator shard (hub) the shard 5 the audit log's append, a transaction lock held to the commit, so the chain's order is the order of commits (compliance.md §3) the hub id's last four bytes, 0 for the installation's own log (hub); the tenant id's last four bytes (cloud) 6 an audit sink's delivery, held while a node sends a batch the sink id's last four bytes 7 the numbering of a hub's change sets (hub), a transaction lock the hub id's last four bytes 8 the sending of a page, notify, ticket, webhook or writeback run, or of a recipient's or a Webhook's digest (hub, pipeline.md §10), held while a task sends the run's messages or the digest; a task that doesn't get it tries again a second later the run id's last four bytes (random in a UUIDv7); a digest: the first four bytes of the SHA-256 of <hub id>/and its digest key, a Webhook's of<hub id>/webhook/<name>9 a person's chain steps (cloud), a transaction lock taken after the incident's row and before the chain's, so that a merged message (on-call.md §4) can lock the person's other chains, each after its incident (key share, in id order); only a step takes it the person id's last four bytes 10 the retention job (hub, compliance.md §2), held by the node that runs a round 0 11 the reader of an emailSource's IMAP mailbox (hub, integrations.md §13), held on the node's lock connection while the node reads itthe first four bytes of the SHA-256 of the hub id's 16 bytes and the Source's name 12 a limit that counts rows (cloud): a person's codes and test messages with the tenant's budget, manual pages and invites per person, devices per person, answers per number, a tenant's rotations and open incidents; a transaction lock taken before the count and held to the commit that writes what it counts, so requests at once count one after another the first four bytes of the SHA-256 of the limit's name and its subject's id 13 the client of a managed installation's channel to the cloud (hub, operations.md §4), held on the lock connection of the node that runs it; every node of an enrolled managed installation tries to take it every 5 s, so another takes it over within seconds of the holder's loss 0 14 the cloud's calls of the billing service (§10), held while a replica runs a pass; every replica tries it every 5 minutes 0 -
Takeover. Every database connection of a node sets server-side TCP keepalives (
tcp_keepalives_idle,_intervaland_countof 2 s, 2 s and 3) and atcp_user_timeoutof 10 s as connection parameters, so the server drops the sessions, and with them the locks, of a node it can't reach; client-side settings alone leave them on the server. A hung but live process loses them too: the lock connection has anidle_session_timeoutof 10 s and the node pings it every second, and step connections have anidle_in_transaction_session_timeoutof 10 s and astatement_timeout. A worker sizes its batches so that a step takes at most 2 s and aborts a step that runs longer. The abort is the server's (statement_timeout,idle_in_transaction_session_timeout): a client-side timeout leaves the statement running and the locks held until it ends, so a step that times out discards its connection instead of returning it to the pool. Every database call of a node has a client-side timeout; the node notices its own loss of the database by the failing pings of its lock connection. Takeover time is the detection (about 10.5 s), plus the rest of the old owner's in-flight step, which the new owner's epoch increment waits for, plus the new owner's acquisition, which takes each partition independently, so another node takes over within 15 s (spikehub-ha). -
Fencing. Taking a partition or a correlator shard increments its epoch; every step transaction checks the epoch it started with and aborts if it changed (
schema/hub.sql§4). A node that lost its lock connection can't commit a step after the new owner has started. Fencing is per partition and per shard, not per hub: one check covers every hub's slice of the step. -
Order. Intake maps each payload with its hub's revision active when it stores the event, which gives the key and so the partition, and records that revision; the later steps use the hub's revision activated before the event's
received_at. Intake only inserts events; it gives them no order, and no node's clock orders anything. Each step of a partition first numbers events and commands (below) of the partition that committed before it selects them, up to its batchB, shared among the hubs that have such rows: withHof them, ifH≤Beach gets up tosof its rows,sthe largest share with Σ min(the hub's rows,s) ≤B; ifH>B, the firstBof them in the order of hub ids from the partition's cursor on, wrapping around, get one row each. The cursor, stored with the partition's owner, then moves to the hub after the last one that got rows. A hub's rows are taken events before commands, each bystored_atand ID (an order that means nothing beyond the numbering). They get the next positions of the partition's gap-free sequence (seq) and, asreceived_at, the step's timeT, the database clock at that moment, which increases strictly from step to step (Activation, below). Rows that commit while the step runs, or beyond its share, are numbered by a later step, with a laterT. So a hub whose rows a step sees gets rows numbered at the latest by the ⌈H/B⌉-th step that sees them,Hthe hubs whose lanes include the partition, however many rows other hubs have: a storm delays its own hub. A share is also bounded by time: the owner keeps per hub what a row of the hub's slices took (a moving average) and numbers no more of its share than fit 0.5 s, at least one row, when the step has rows of other hubs, so a hub whose rows are expensive (many rules, wide selectors, many timers) takes at most that of a step shared with others and its other rows wait for the next step, which then follows at once. A hub alone in a step, and a sandbox, number the fair share. Positions are the partition's, so a hub's rows in a partition have gaps inseq, which mean nothing either. Position andreceived_atare stored, so the order is fixed once given, and replay uses it unchanged. All processing of a partition follows(received_at, seq). -
Determinism per hub. A hub's decisions are a function of the hub's own rows: its events and commands with their stored
received_atand positions, its activations and the timers these set. Other hubs' traffic changes when a hub's rows are numbered, and so theirreceived_at, never the order of rows already numbered, the activations a row is processed with or what a step of the hub reads. Replay of a hub (pipeline.md §12) therefore reads the hub's rows alone and reproduces each stored decision. -
Pipeline times. Every time a step writes (an alert's
first_seen,last_seen,acked_atandclosed_at, a transition'sat, a decision'sdecided_at, a heartbeat'ssince) is thereceived_atof the event or command that caused it, or the due time of the timer that did, never the clock at commit, so replay writes the same times. Rows of one alert that share a time, such as the close and the reopen of one step, carry an ordinal (schema/hub.sql§4, §6). -
Watermark. Everything a partition numbers later gets a
received_atafter the step's, of whichever hub, also the rows a step saw and left for a later one. Once a step has processed everything it numbered, it sets the partition'sprocessed_toto itsreceived_at, also when it numbered nothing or left rows of a hub unnumbered, so an idle partition keeps up with the clock; the timers of a hub due before it fire before the hub's rows still waiting, which get a laterreceived_at, and fair numbering bounds that wait (Order). Owners run a step at least every second. A hub's global watermark is the lowestprocessed_toof its lanes (of all partitions for a hub withlanes = P): everything of the hub received up to it, in any partition, has been processed. It trails the clock by the step cadence plus the step time (about 1.4 s at p99), and timers fire that much late. The database servers' clocks must be synchronised: after a failover to a server whose clock is behind,received_atandactivated_atadvance by 1 µs per step and activation until the clock catches up, and timers due at clock times (downtime ends, Calendar coverage changes) fire early by the skew. -
One transaction per step. A partition worker takes the next numbered events and commands of its partition, applies the pipeline, and in one transaction updates the alerts, writes the transitions and routing decisions, enqueues the decisions' actions as durable tasks, writes the correlator's inbox entries and advances
processed_to. Either all of it commits or none. A step takes a batch of events; duplicates of one alert within a batch update the alert row once. The step works hub by hub: a hub's slice (numbering its rows, then processing them and its due timers) runs under the hub's row-level-security scope, with the hub's spec revision, snapshot and replicas, and in a savepoint of its own. A slice that fails rolls back to its savepoint: the hub's rows stay unnumbered and its timers unfired for a later step, as rows beyond a share do, and the step commits the other hubs' slices; positions stay gap-free, as the rolled-back slice's positions are given again. -
Commands. Every alert change that doesn't come from the alert's own events also goes through its owner's sequence, so an alert has one writer and one order. A command is written as a row for the owner of what it changes and numbered with that owner's events:
- to the alert's partition, which owns its lifecycle: acks, unacks,
closes and assignments by people, the API and the cloud link, and
closes by a ticket closed in the ITSM. For an alert the correlator
routes, the change reaches the correlator through its inbox like any
lifecycle change (below), and the correlator applies its routing
effects (held runs cancelled, the
closetrigger, the ack sent to the incidents); - to the hub's correlator (partition −(c+1) of its shard c): every command of the alerts of its own kinds, group changes and heartbeat instances forgotten;
- split by owner: a bulk close writes one command to each owner holding
a match, the correlator included, with the IDs of the alerts matched; the
operation counts the matches and writes its commands in one
transaction, refuses more than
pipeline.bulkCloseLimit, and each command closes those of its alerts that are still open, so alerts that open later aren't closed. Close keys that match alerts of other partitions write a command to each partition holding a match, which closes what still matches when it applies; - split by router: a Calendar coverage change writes one command to each of the hub's lanes, for the open alerts it routes, and one to the correlator, for those the correlator routes;
- to every owner: the end of a downtime or a storm writes a release to
each of the hub's lanes and to its correlator, which releases the owner's
alerts that record it when it applies, so an alert that a step
suppressed after the end was written is released too; whoever routes
each alert routes it with
release.
An API request that issues one waits up to 5 s for it to apply and answers with the result, otherwise with
202and the command's ID; the ITSM's ticket-closed callback answers once its commands are stored. Commands from people and the link are state and aren't replayed; commands that the pipeline derives are derived again in replay (pipeline.md §12). Action runs are not alert state and have several writers (the step that starts or continues a run, the task that runs it, the link holder that ends it or sends it again), each changing a run only from the state it read; the incident of an alert is read from its page runs. - to the alert's partition, which owns its lifecycle: acks, unacks,
closes and assignments by people, the API and the cloud link, and
closes by a ticket closed in the ITSM. For an alert the correlator
routes, the change reaches the correlator through its inbox like any
lifecycle change (below), and the correlator applies its routing
effects (held runs cancelled, the
-
Ownership. A partition owns the lifecycle of the alerts of its keys: duplicates, state, severity, counts and closes, and the routing of the alerts that no CorrelationPattern selects. The hub's correlator owns what spans partitions: the routing of the alerts a pattern selects (decided when an alert opens or reopens, pipeline.md §16), the alerts of kinds
group,expect,heartbeatandstorm, heartbeat state, expectations, and the timers whose inputs span partitions. The partition whose count crosses a StormRule's threshold starts the storm, so new alerts are suppressed at once; the correlator opens, routes and ends its storm alert. For an alert that the correlator routes, the partition writes only the lifecycle columns, its downtime and its storm, and the correlator only the routing ones: facts, decisions, group and role. Each source of suppression has its own column, andsuppressionderives from them (pipeline.md §9). -
Correlator. Lifecycle changes of the alerts it routes, the duplicates of those with a held
count(pipeline.md §9), beats, events that an ExpectRule observes and storm starts are written to the hub's correlator inbox in the step transaction that produced them, each with the producing partition'sreceived_atand position and, for alert changes, the alert's attributes as of the change. A hub's correlator is its correlator shardc, which serves the correlation of every hub assigned to it (Installations, above). One node runs a shard while it holds the shard's advisory lock (class 4, keyc), with a fencing epoch like a partition, and numbers its hubs' own commands (group detach, move and merge, changes of its own alerts) like a partition, as partition −(c+1), the batch shared among the hubs as a partition's is. For each of its hubs it processes the hub's inbox and commands in(received_at, partition, seq)order up to the hub's global watermark, so a hub's order and inputs depend neither on which partition was faster, nor on what an alert row says by then, nor on other hubs. A shard step takes up to its batch, shared among the hubs with input up to their watermarks as numbering shares a partition's batch (from a cursor of the shard's), and visits only the hubs with such input, commands to number or an activation since theirprocessed_to(below); in one transaction, each hub's slice under its scope and in a savepoint as in a partition's step, updates groups, expectations and heartbeats, writes decisions, enqueues actions, writes commands to the hub's lanes and records incorrelator_progressthe hub'sprocessed_to: its global watermark when the step took all of the hub's input up to it, else 1 µs before thereceived_atof the hub's next input. Everything of the hub up to itsprocessed_tohas been correlated; a hub the shard doesn't visit has nothing to correlate up to its global watermark, and its lag is measured from the earlier of that watermark and its oldest input; a hub with more input than its share lags alone. A hub's share of a shard step is bounded by time as a partition's is (Order): the owner keeps per hub what an item of the hub's slices took and, when the step has input of other hubs, runs no more of the hub's share than fit 0.5 s, at least one item, so a hub whose input is expensive (a CorrelationPattern that selects every alert, many expectations) lags alone, its progress where its slice stopped, and the next step follows at once. A shard step also visits its hubs, from its cursor on, for at most 1 s: the hubs it doesn't reach then, such as many hubs with a new activation at once, are first in line for the next step, which follows at once. -
Activation. A hub's spec revision and inventory snapshot become active at a point of the order. The activating transaction writes what it activates, then takes the activation lock (
pg_advisory_xact_lock(2, 0)) in a statement of its own, then setsactivated_atto the greatest of the database clock, every partition's and every correlator shard's lastreceived_atplus 1 µs and the latestactivated_atof the installation plus 1 µs, records the activation with its hub inactivation_log(schema/hub.sql), commits and releases the lock. Numbering takes the same lock in shared mode (pg_advisory_lock_shared(2, 0)) only around its clock read, takes asreceived_atthe greatest of the clock, the partition's lastreceived_atplus 1 µs and the latestactivated_atof the installation plus 1 µs, and reads the activations in a subsequent statement, so a slow or stuck step holds up neither activations nor other steps. An activation of a hub is therefore never before an event of the hub already numbered, and every event numbered after it committed is after it, also after a failover to a database server whose clock is behind; a step, and a correlator shard reading up to a hub's global watermark, sees every activation before the times it processes. Each hub's slice applies the hub's activations only, never another hub's: every event and timer of a hub is processed with the hub's revision and snapshot of its last activation before itsreceived_ator due time, live and in replay (spikehub-ha). The lock is the installation's, not a hub's, because a step'sprocessed_tospeaks for every hub of its partition, also for the hubs it numbers nothing of: an activation of such a hub that holds a lock of its own while the step reads its clock could commit with anactivated_atbelow the step'sprocessed_to, after a correlator shard fired a timer of the hub due after it with the previous revision. A node holds the snapshots its steps read in memory, least recently used first within[server] snapshot_cache(operations.md §2), so only the nodes that hold a hub's lanes or correlator shard hold its snapshots: a hub's previous snapshot, which its correlator reads until the hub'sprocessed_toincorrelator_progress, running behind the partitions, has passed the next one'sactivated_at, stays while steps read it. A step never loads a snapshot within its time budget: a slice whose snapshot the node doesn't hold rolls back, and the worker loads it before the next step. The start and the end of a downtime are positions of the order by the same rule and under the same lock (pipeline.md §8). -
Inventory imports run as durable tasks on any node, one per source at a time. Merges run as durable tasks too, at most one at a time and at most once per
inventory.mergeInterval(pipeline.md §15); a merge activates its snapshot in one transaction. Unique indexes keep one running import per source, one running merge and one running replay of each hub, so a node's sandboxes (pipeline.md §12) serve several hubs' replays only one each; the row of a running import, merge or operation names its task, and when a node dies, the task's retry on another node, once the claim has expired, first fails the lost attempt's row (schema/hub.sql§3). -
Actions are durable tasks. Outbound work (page requests, tickets, write-back, mail, webhooks) runs as absurd tasks with checkpointed steps, retries and leases (stack.md §2). Any node claims them. Each action run carries an idempotency key (pipeline.md §10), so receivers can drop duplicates.
-
Timers (missing heartbeats, expiry, auto-close, holds, storm ends, downtime starts and ends, Calendar coverage changes, digests, group waits and expectations) are rows with a due time, so they survive restarts and failover. A timer fires once its owner's watermark has passed its due time; timers due at or before an event's or inbox entry's
received_atfire before it, live and in replay. The partition runs expiry and auto-close of its alerts and the holds of the alerts it routes, at itsprocessed_to; the hub's correlator shard runs all others, at the hub's global watermark. A lagging partition delays the timers of its hubs instead of raising a missing heartbeat for beats it hasn't read yet, and a hub's own storm delays only that hub's. Replay fires timers the same way. -
Wake-ups use
LISTEN/NOTIFY. Correctness never depends on a notification: every waiter re-reads state on wake-up and on timeout.
Lanes, ownership and fencing of partitions and of correlator shards,
numbering and its fair share, the watermark, each hub's activations, the
activation lock and its clock after a failover, timers and the
correlator's order are checked by
models/HubPartitions.tla, for a standalone
installation and for a managed one: a node whose partition or shard lock
was taken over commits nothing, positions are gap-free with increasing
received_at, every event is processed with its hub's activation in
force at its received_at and with every activation of its hub
committed before it was numbered, and a correlator timer with its hub's
activation in force at its due time, a hub whose rows a step sees is
numbered by the ⌈H/B⌉-th such step, a shard takes only its own hubs'
input, each hub's inbox and timers in order up to the hub's global
watermark, each once, and a timer fires once. The model's constants
name the rules of a managed installation it guards: the activation lock
of the installation (SharedActLock), a hub's own activations
(OwnActivations), the cursor (Fair) and a shard's own hubs
(ShardScope). Spreading,
commands, slices that fail, shares above one row per hub and the shard's
budget are not modelled. Semantics of each step:
pipeline.md.
5. Hub–cloud link
-
The hub opens outbound HTTPS/2 connections to the cloud's hub endpoint, through the configured forward proxy, as a CONNECT tunnel. Proxy authentication is Basic or none; proxies that require NTLM or Negotiate must allow the hub by its source address.
-
Mutual TLS with a per-hub client certificate, issued by the cloud at enrolment (operations.md §4) and renewed by the hub 30 days before expiry. Either side can revoke it. For the link the hub trusts only the vendor's CA. A TLS-inspecting proxy can't present the hub's client certificate and buffers or times out the stream, so the cloud's host must be exempt from inspection, and the Watch host with it in the same rule (operations.md §2; spike
proxy-link). -
Up: page requests (of page runs and of manual pages, pipeline.md §10), alert updates (changed, closed, detached from a group), group updates (cause, involved teams), merges of group incidents, acks and un-acks made in the hub (UI or API), pages sent through the local fallback channel, and the stream cursor. They are durable tasks on any node; each carries an idempotency key and the hub's link epoch, and the hub retries until the cloud confirms, however long that takes, unless the cloud refuses a page request for good (below): the 24 h limit of action retries (pipeline.md §10) doesn't apply. The up messages of one page run (its page request, the alert's updates, acks and un-acks made in the hub and the close) are the run's outbox (
schema/hub.sqlaction_message): they are sent in that order, one at a time, each after the cloud confirmed the one before. An ack or un-ack made in the hub goes to the incident the run has when the message is sent, and its idempotency key names that incident. A closed alert that opens again while its run is still open sends a page request again, after the close and with the alert as it reads then: the cloud lets it rejoin the run's incident while that is unresolved and opens another otherwise (pipeline.md §10). A group's updates (its cause with the member count, as far as Settingscloud.payloadallows, and its whole list of involved teams) and the merge of its group into another are messages of the outboxes of the group alert's page runs, after their page request, so neither reaches the cloud before the incident it changes; an alert's detach from its group (detached, moved to another group, or moved by a merge that leaves its group open) is a message of the attach run that put it into the group's incident, which ends once it sent it; it names the group, and the alert leaves only that group's incidents, whatever order it and the attach into a new group arrive in. Different runs are independent. The cloud keeps a hub's idempotency keys for 7 days, and page requests are unique for good (schema/cloud.sqlincident_alert.idempotency_key), so a resend after a long break is still applied once. The cloud applies nothing of another link epoch and answers409(link.resync), so after a restore nothing reaches the cloud before the hub's resync. A page request that the cloud rejects with422, because its team or rotation doesn't exist or isn't on the hub's allowlist (§12), is not retried: the run fails, a critical self-alert names the rotation, and the page goes to the default rotation ofrouting.unroutedTeam(spec-format.md §3.16) instead, as a run of its own, so neither a replica that lags a deleted rotation nor a narrowed allowlist loses a page. A page to that rotation that gets422too isn't re-routed: a critical self-alert names both rotations, and stays open while the hub's replica lacks that rotation. A page request refused with any other422(it doesn't fit the link's document,request.invalid) isn't retried or re-routed either: the run fails, its follow-ups aren't sent, and a self-alert names the rotation and the cloud's answer. A reopen of the alert then starts a new run (pipeline.md §10). -
Down: one long-lived server-sent event stream. Each update carries the current state of one object, never a difference: an incident (with its alerts, level, ack, merge target and the change that caused the update: triggered, acknowledged, unacknowledged, escalated, reassigned, invited, unanswered, merged, resolved, or updated: its alerts, title or severity changed without a change of state), a delivery, a response, a shift, a team, a rotation, a rotation's readiness, a rotation's fallback cache, or a person's display name. Deletions are updates with
deleted. Applying an update twice is harmless. An update that the hub can't apply, because it doesn't decode or its data doesn't fit the hub's schema, is committed with its sequence and skipped like one of an unknown type, and a self-alert names it: the stream goes on, and the next replica load brings the object's state. -
One stream per hub. One hub node holds the stream while it holds the advisory lock of the hub's link shard (class 3, §4). Each stream the cloud opens gets the hub's next stream epoch, which the cloud sends as the stream's first event, and the cloud closes any older stream of the hub. The node names the epoch recorded in the hub's database when it opens the stream, and the next epoch is one above the cloud's last and that one, so it stays newer after a restore of either database. The holder records the epoch in the hub's database and commits an update only while its epoch is still the recorded one, so a node whose stream was taken over can't commit an update it had already received behind the new holder; the cursor carries the epoch, and the cloud refuses one with an older epoch (
link.stale_holder). The holder commits each update with its sequence and applies its effects on alerts as commands: an acknowledged incident acknowledges its alerts, an unacknowledged one opens them again, and a triggered one opens again those that an ack from the cloud acknowledged, unless another acknowledged incident has them, so the ack of an earlier incident that reaches an alert after it opened again doesn't stay. That un-ack is a command the alert's partition checks when it applies it (it undoes only an ack from the cloud), so an ack command still queued for the alert is seen first. Incident updates set the incidents of the alerts' page runs, also after a merge (pipeline.md §10). It confirms the committed sequence with the stream cursor within 10 s of committing it, and nothing while it commits nothing; the cloud keeps confirmed updates for 7 days. -
How the cloud feeds a stream. A cloud replica reads a stream's updates when it is woken: the transaction that writes an update for a hub, opens a newer stream of it, renews its link epoch or revokes it notifies the hub (
NOTIFY, with the hub's id), and every replica listens on one database connection and wakes the streams of that hub it serves, whichever replica committed. Without a notification a stream reads once a minute, each wait up to a quarter shorter or longer at random so that streams opened together don't read together: this sweep makes up for a notification lost while a replica's listener reconnected (which also wakes all its streams once it is back), and records the hub as seen, so a hub whose stream is open shows as connected without calling. An idle hub costs one read a minute and no up call. -
Resume and resync. Each update carries the hub's sequence number and its link epoch, which the cloud renews when the hub enrols again and when the cloud database is restored. After a break the hub resumes after the last sequence it committed, within its epoch. A node that takes a link shard opens the first stream of each of the shard's hubs at a random time within 10 ms per hub of the shard, at most 10 s (§4, class 3), so the hubs of a shard don't connect at once; a stream or replica load answered
503waits the answer'sRetry-Afteror the node's own backoff, whichever is longer, before it connects again. If the cloud no longer has that position, doesn't know it yet, or has another epoch, it answers409(link.resync). The hub then loads the replica: every team, rotation, readiness and fallback cache of its allowlist (§12), the shifts from 30 days back to 30 days ahead, and the incidents that are open or changed within 30 days, with their deliveries and responses, read in one consistent snapshot together with the sequence and epoch it corresponds to, and sent compressed. A cloud replica builds and sends at mostlink.replica_loadsreplicas at once (operations.md §3) and answers a load beyond them503(service.unavailable) with aRetry-Afterof 5 to 20 s at random; the hub loads it again after that wait, so the hubs that a restart of a replica or of an installation's node reconnected together load their replicas one after another. In one transaction the hub replaces its teams, rotations, readiness, fallback caches, future shifts and the incidents of the 30 days with it, and then resumes the stream after that sequence. A new hub starts the same way. The replica is state, so the load applies each incident's state to its alerts as the updates it replaces would have, as commands: an acknowledged incident acknowledges its alerts, a resolved one ends its page runs, and a triggered one, like a page run whose incident the replica lacks, un-acknowledges the alerts that an ack from the cloud acknowledged, and those acknowledged in the hub whose ack the replica shows with a response after it, unless another acknowledged incident has them; an ack made in the hub that the replica lacks stays and is sent again (below). The hub's alerts then agree with the cloud's incidents after a resync as after the stream, which skipped updates would otherwise leave behind. -
After a cloud restore the cloud has lost what it confirmed after its backup. In the transaction of the replica load, the hub sends again what the replica lacks of its own up messages, with their original idempotency keys:
- per page run and manual page, the page request when the replica has no incident for it; for a page run whose alert opened again, the page request of the reopening when the replica has no incident or shows it resolved while the alert is open; and the close of the alert when the alert is closed and the incident isn't resolved;
- an ack made in the hub whose incident the replica shows triggered, and an un-ack made in the hub whose incident it shows acknowledged, each with no response after it;
- of a page run, from the first of these messages on, every later message of its outbox in order, so an ack made after a reopening follows the reopening's page request; an ack made in the hub that the replica shows, under an incident it shows triggered, was answered by a response after it: the alert is opened again and the ack is not sent again;
- a merge of group incidents that the replica doesn't show merged, and a detach of an alert that the replica still lists in the incident;
- a page sent through the local fallback channel that has no delivery in the replica.
Checked by
models/HubCloudLink.tlafor pages, acks and closes, with stream takeovers: no page, ack or close is lost, the hub's incidents match the cloud's, the hub commits the stream in sequence, and after acks and un-acks in the cloud and a resync the hub's alerts are acknowledged exactly when their incidents are (for alerts of one incident each). -
After a hub restore the hub has lost what it did after its backup. It loads the replica at its first start, and for each alert of an open incident in the replica that came from its own page requests but that it doesn't know, it sends an alert update
lost; the cloud marks the alert, and the incident stays open until a person resolves it (operations.md §8). Checked bymodels/HubCloudLink.tla: no incident stays open in the cloud without the hub knowing its alert or the alert being marked lost. -
The stream sends a comment every 15 s, so that proxies don't close it as idle. Without data for 45 s, the hub closes the whole connection, not only the stream (a new request on the dead HTTP/2 connection would wait until TCP gives up), opens a new one through the proxy and waits at most 15 s for the stream's response headers. The cloud sends an HTTP/2 PING every 15 s and closes a connection whose PING is unanswered for 15 s, so it notices a dead stream within 30 s (spike
proxy-link). -
Versions. Every link call carries the hub's version (
Excubio-Hub-Version). The cloud answers a version outside the window it supports (operations.md §7) with426(hub.update_required) and applies nothing; the hub raises a critical self-alert and pages through the local fallback channel as when the cloud is unreachable (§7). A down-stream update of a type the hub doesn't know is committed with its sequence, ignored and counted (excubio_link_unknown_updates_total).
Endpoints: api/cloud.yaml (tag hub-link).
6. Page path
Latency targets are in operations.md §9.
7. Degraded modes
| Failure | Detected by | Behaviour |
|---|---|---|
| One hub node down (HA) | Other nodes | They take over its partitions and claim its tasks. No accepted event is lost. |
| A single-node hub down | Watch: hub heartbeats missing | Watch pages the hub's rotation. HTTP and SMTP senders retry or spool; traps and UDP syslog messages sent while it is down are lost. Pages wait until it is back. |
| Hub database primary down | The database's HA (Patroni, CloudNativePG, managed) | HTTP intake returns 503 with Retry-After until the new primary is up; senders retry. SNMP traps are spooled on the nodes (§4). |
| Hub cannot reach the cloud, or the cloud refuses its version | Hub link; Watch, if hub heartbeats stop as well | Page requests wait as tasks. Once the link has been down for fallback.after (default 2 min) the hub raises a local critical alert and sends pages through the local fallback channel, if configured. |
| No internet at the customer | Watch: hub heartbeats missing; for a vendor-run hub, the hub: its relays disconnected | Watch pages from outside. A vendor-run hub keeps paging and raises the self-alerts of relays cut off (below); the customer's push checks at Watch fail if the customer's heartbeats stop (watch.md §1). |
| Cloud down | Hub link; Watch synthetic page | As "hub cannot reach the cloud"; Watch also informs the customer's platform rotation. |
| Carrier down or slow | Cloud delivery | Failover to the other carrier for the medium (on-call.md §4). |
| APNs or FCM down, or a phone without data | Missing device receipts | Push steps fail after 30 s or at once while the push service is unhealthy; the chain goes on by SMS and voice (mobile.md §3). |
| An inventory source unreachable or its import rejected | Hub | The merge keeps the source's last good import; routing and correlation continue on the active snapshot; a self-alert fires when the source's newest import is older than inventory.maxAge. |
| Correlator node down | Other nodes | Another node takes the correlator's lock within 15 s and continues from its inbox. Alerts no pattern selects are routed meanwhile; group, heartbeat, storm and expect alerts and the timers that span partitions wait for the takeover. |
| ITSM, SMTP or a write-back target unreachable | Hub tasks | Retries with backoff; an alert to the platform team after the configured attempts. Pages are unaffected. |
| Watch down | Customer reverse check | The customer's probe alarms locally (watch.md §1). Paging is unaffected. |
| Replica push from the cloud to Watch stopped | Watch: replica age | Watch keeps paging from its last replica and, past an entry's valid-until, the check's fallback numbers (watch.md §2); the vendor's on-call team is paged (watch.md §5). |
| A relay down or cut off from the hub | Hub: the relay's connections (§13) | Senders that reach the relays under one VIP or DNS name go to the others; the relay's spooled datagrams wait on its disk and arrive once it is back. The hub's connections through relays go through the others; with none left they fail like an unreachable target (below), imports keep their source's last good import. Self-alerts for a relay disconnected and for no relay connected (pipeline.md §19). |
| The hub unreachable for its relays | Relays; Watch, if hub heartbeats stop as well | Relays spool datagrams up to their spool_bytes and count what doesn't fit; TCP senders get no connection and retry. |
| Provider A down, with the cloud and the managed installations | Watch: hub heartbeats missing; Watch synthetic page | Watch pages from outside, for the hubs of a shared installation as an installation failure: the vendor first, then each tenant by its own messages at Watch's carrier rate (watch.md §5); relays spool; senders that can retry do. A vendor-run hub's local fallback channel doesn't help here, its cloud link isn't what failed (§1). |
| A shared installation down | Watch: the hub heartbeats of many of its hubs missing at once | Watch takes it as an installation failure: it pages the vendor's on-call team at once, then every tenant of a failing hub by its own messages, which say the installation failed, throttled to Watch's carrier rate; the recoveries likewise (watch.md §5). The hubs of other installations and the cloud are unaffected. |
| The hub's identity provider down | Hub UI login | Signed-in sessions run until they expire; the break-glass admin signs in locally (§11). Intake and paging are unaffected. |
| The cloud's identity provider down | Cloud UI and app sign-in | Sessions and device logins run on; responses by SMS, voice, signed link and app keep working. Paging is unaffected. |
Local fallback channel. An optional, deliberately simple path that does
not depend on the vendor: the hub sends SMS through the customer's own SMPP
account to the person currently on call for the paged rotation, from a
fallback rotation cache that the cloud pushes over the link (rotation,
current and next person with their SMS number, valid-until; computed as
Watch's replica is, on-call.md §2). A send
that fails is retried every 5 minutes until it succeeds or the cloud is
reachable again; a send the SMSC accepted is not repeated. A person gets
at most 5 SMS in 15 minutes; the pages beyond are counted, and at the end
of the 15 minutes one summary SMS gives their number and rotations. There
is no grouping, escalation or ack beyond a reply-less SMS.
Active. The link is down from the end of the hub's down stream
until a stream is open again (§5); a node that
takes the link's lock from another takes that node's stream as ended,
and a refused version (426) keeps the link down for as long as it
lasts. The fallback is active once the link has been down for
fallback.after, and ends when a stream is open again
(schema/hub.sql cloud_link.fallback_since). The
node that holds the link's lock (§4) is the
one sender; it looks every 2 s. On activation it sends every page
request of an open alert and every manual page that waits for the cloud
and has no accepted send, oldest first, then each new one as it is
queued; manual pages count towards the per-person limit like any page,
which is counted from the stored sends (sent or unknown), and a page
over it isn't sent to that person later
(schema/hub.sql fallback_send). Only while the
fallback is active the hub binds to the
SMSC as transmitter and requests no delivery receipts: a send is sent when
the SMSC accepts the submit, and failed when it refuses it
(schema/hub.sql fallback_send). Throttling
(ESME_RTHROTTLED 0x58, ESME_RMSGQFUL 0x14) is retried with backoff
and doesn't fail the send. A submit whose response is lost with the
connection is sent again by the retry, so a person can get an SMS twice;
for pages that is accepted. Outside the fallback an hourly test bind
(bind and unbind, no SMS) checks the account
(§9;
spike smpp-fallback). Past the
cache's valid-until the fallback pages both the current and the next
person of the cache, and the SMS says that the cache may be out of date.
When the link is back, the hub sends the pages it sent through the
fallback to the cloud as deliveries with by_fallback set
(fallbackDeliveries, api/cloud.yaml), so incidents
and audit are complete: per page request with sends not reported yet,
one up message of all of them with the key
fallback/<page key>/<last send id>, which follows the page request in
the page run's outbox (a manual page's, once its request is confirmed)
and is retried as any up message (§5). A send whose
response was lost (unknown) is reported as failed, since the hub
can't tell that it reached the person; capped pages and summaries
aren't deliveries, and the SMS of a self-alert about the link has no
page request and isn't reported. A 422 (link.page_unknown: the
cloud refused the page request) isn't retried: the message is dropped
and a self-alert names the page. How the people's chains and the level
go on from the deliveries is specified in
on-call.md §4.
Self-alerts about the link (cloud unreachable or refusing the hub's
version, fallback active, fallback account failing its test bind) never
go through the cloud: they go through the local fallback channel to the
rotation of Settings fallback.selfAlerts, and by e-mail through the
hub's SMTP settings to its addresses
(spec-format.md §3.16), by the built-in
rule of pipeline.md §19.
8. Persistence and HA
| Part | Database | Replicas |
|---|---|---|
| Hub | Embedded Postgres (single node), or external Postgres with its own HA and a synchronous standby; a managed installation a CloudNativePG cluster of its own (operations.md §1) | 1, or 2+ behind a load balancer or VIP; 3+ for a shared installation |
| Cloud | Managed Postgres with synchronous standby in another zone | 3+ across zones |
| Watch | Postgres with standby at each of two locations, Watch nodes active in both | 2+ per location |
- All nodes of a hub installation serve intake and the UI of its hubs; partitions, correlator and link shards and tasks spread over them (§4).
- Synchronous standby. An HA hub requires a synchronous standby, for
the order and watermark of §4 as much as for
an RPO of 0: after a failover to an asynchronous replica, acknowledged
events are gone, and positions and
received_atvalues that others had read are given again to other events, soprocessed_togoes back. The database's HA must block writes rather than drop to asynchronous replication when the standby is lost. A cancelled synchronous-commit wait leaves a commit on the primary only, so no connection sets a timeout or cancel on its commit (step connections lift theirstatement_timeoutfor it), and intake treats a cancelled wait as a failure and answers503(spikehub-ha). - SNMP: devices send to the VIP. Devices that can send to two targets may send to two nodes; copy detection removes the copies (pipeline.md §6).
- Events and raw payloads are partitioned by month; retention drops partitions. Closed alerts with their transitions and decisions are deleted daily when they leave retention (compliance.md §2).
- The cloud shards controllers (escalation timers, chain steps and the
other due work of
schema/cloud.sql§7) by tenant with advisory locks (class 1 in the cloud's database, §4), like the hub's partitions. A tenant gets its shard, one of 16 by default (operations.md §3), when it is created; every cloud replica tries the locks of the shards nobody holds every 5 s (those of the configured number and any other shard a tenant has), and the holder of a shard reads the due work of its tenants only. A replica holds its shard locks on a connection of their own, which it pings every second, with the lock connection's settings of the hub; when the ping fails it holds no shard until it has connected again. Sending has no shards: every replica claims queued messages from the outbox (on-call.md §4). - The cloud's times come from the database's clock: every timer, due
time, lease, expiry and window (throttling, rate limits, the app
versions accepted, a login's or a callback's age) is computed from
now()of the database, never from the clock of a replica's process, so replicas whose clocks differ agree. Only a certificate's days, which its peers check with their own clocks, come from the process. - Cloud connections set the server-side TCP keepalives and
tcp_user_timeoutof the hub's (§4), anidle_in_transaction_session_timeoutof 10 s and astatement_timeoutof 10 s, which the commit lifts as on the hub. A request whose handler doesn't answer within 30 s is answered503(service.unavailable). - The hub link: the load balancer passes each mutual-TLS connection
through to one replica, whose listener holds at most
link.max_connectionsconnections with a client certificate (operations.md §3, which sizes it). A connection authenticates one hub, so the streams of the hubs an installation's node holds are a connection each and can't share one. A replica feeds its streams as §5 says: one listening connection for the notifications, fanned out to the streams in the process, and the streams' reads on 8 connections of their own, apart from the 32 of the handlers.
Configuration, backups and sizing: operations.md.
9. Observability of Excubio itself
/metrics(Prometheus) on every part. The series are listed in integrations.md §11. Gauges are computed at scrape time.- Structured logs (
tracing, JSON). - Self-alerts. The hub raises alerts about itself through its own
pipeline (source
excubio, pipeline.md §19): task backlog, failed tickets, snapshot age or rejection, inventory sources whose imports are stale, rejected or ambiguous, correlator lag, a partition or the correlator unowned for 15 s (§4), group limits reached, unknown severities, unrouted alerts, link down with its cause (a refused client certificate, which TLS 1.3 shows the hub only as a closed connection, is named as such), replication lag, certificate expiry, a fallback SMPP account that fails its test bind (§7), disk usage, SNMP spool use or loss, stale spooled events, relays disconnected, none connected or with their spool filling up (§13), rejected senders, one-off downtimes started or ended, a Source at one of its limits (pipeline.maxOpenPerSource,sourceRate,closeKeyLimit) or a rule atpipeline.maxInstances(pipeline.md §2, §5, §6), and a Source whose share of new keys among its events rises above 50 % for an hour (a key that contains changing text; judged from 100 events of the hour on,self/new-keys/<source>). They route like any alert, normally to the platform team, except the self-alerts about the link, which never depend on the cloud (§7). - Heartbeat to Watch. Every 30 s every node reads the shared state
of all its hubs from the database in one call (
watch_states,schema/hub.sql§13, and the action tasks grouped by hub), signs each hub's with that hub's Watch key and posts the heartbeats to Watch in one batch (api/watch.yamlhubHeartbeats), through the forward proxy, verifying Watch's certificate against the host's trust store (watch.md §1). The state is the hub's pipeline lag (the time since the lowestprocessed_toof its lanes, §4; none while one has never been processed), its action tasks not finished, and whether a node holds its link's down stream, with the time of its last change while none does (§5). A node reads a hub's Watch key and spec under the hub's own scope only when its enrolment or its active revision changed, or Watch refused its heartbeat. If the pipeline itself is stuck, the lag shows it, and Watch pages from outside. A node that can't read the state within 5 s sends nothing that turn, so a hub whose database doesn't answer is a missing heartbeat. Watch's answer can carry a synthetic test (pipeline.md §10). - Prometheus rule templates for all parts ship with the packages.
10. Authorization
Permission decisions use embedded Cedar with scoped role bindings, the same engine as Convexio Strataplane (stack.md §2).
- Subjects: users (OIDC), teams (from the IdP's group claim), service accounts acting through API tokens.
- Scopes: a team (alerts whose
teamfact is that team or whose incident is on one of the team's rotations, for example after a reassign; spec files the team owns; the team's rotations), or the whole hub or tenant. An API token can further carry a selector: it then acts only on alerts the selector matches, and creates only downtimes whose selector is at least as narrow (it must contain the token's selector), as for a patch automation limited tonode~=app-*. A token with scopes (tickets) can call only the endpoints of those scopes, whatever its owner's roles:ticketsfor the ITSM's ticket-closed callback,metricsfor Prometheus scraping/metrics(integrations.md §11). - Hub roles:
| Role | Can |
|---|---|
viewer | Read alerts, decisions, explanations, spec, change sets, audit of own actions. |
responder | Acknowledge, assign, annotate and close alerts in scope; detach them from a group or move them to another; page a rotation of the team by hand; with token scope tickets, report tickets closed in the ITSM. |
author | Edit drafts and submit change sets for files the team owns. |
approver | Approve or reject change sets on behalf of the team (spec-format.md §6). |
operator | Downtimes, bulk close, inventory imports, merging groups in scope. |
admin | Everything except secret values; users, tokens, settings, sources. |
secret-admin | Write secret values. |
The roles are not a chain. Every role includes viewer; operator
includes responder; admin includes every role but secret-admin;
author and approver include neither each other nor responder. An
operation that names a role (api/hub.yaml
x-excubio-role) is open to a binding of that role or of a role that
includes it, and an API token's roles narrow its owner's bindings to
the roles listed and what they include.
-
Cloud roles:
member(own contact methods and devices, own overrides and swaps, ack),rotation-manager(the team's rotations and overrides for anyone),team-admin(members, team settings),auditor(read all audit data, read-only),tenant-admin. The team roles are a chain, since a person has one role per team:team-adminincludesrotation-manager, which includesmember.auditorincludes no other role;tenant-adminincludes every role. -
Configuration tokens. A cloud service-account token with the scope
configconfigures the tenant without a person, as an OpenTofu run does (operations.md §13). Only a tenant admin creates one, only as a service-account token, and only with an expiry at most 366 days ahead; its creation is audited and the Access page lists it until it is revoked. It can call exactly:- teams: list, read with their members, create, change, delete; set
and remove members with the roles
member,rotation-managerandteam-admin; - rotations: read, create, replace, delete;
- hubs: list, read, create, change, revoke and decommission, issue an enrolment token;
- read: people (
searchPeople), the tenant's settings and its numbers.
It can call nothing else: no API tokens or service accounts, tenant roles, support grants, audit, exports or audit sinks, tenant settings changes, calendars, stakeholders, rotation imports, devices, incidents, pages, overrides, swaps, absences or punch-ins, and no operation of a person's own (
/api/v1/me), unless the same token also has the scope that operation names (api/cloud.yamltoken-scope). So it can neither mint a credential nor make anyoneauditorortenant-admin, and every power it hands on stays within a team. Making a personteam-adminis part of a team's configuration and is allowed:team-adminholds a team's members, settings and rotations, which the token itself already changes, and no team role reaches the tenant roles, tokens or another team.config:<team>limits the token to that team's read, change, members and rotations, plus the three reads; creating and deleting teams, listing them and the hubs needconfigwithout a team. Its writes are audited with actor kindserviceand the token as actor, and a suspended tenant refuses them as it refuses a tenant admin's. - teams: list, read with their members, create, change, delete; set
and remove members with the roles
-
Vendor staff (
platform-operator) manage tenants with their limits and numbers; carriers are part of the installation's configuration (operations.md §3). They see no tenant's people, numbers, incidents or audit. For support, a tenant admin grants one named operator read access with the rights ofauditorfor up to 72 hours, with a reason; the grant can be revoked at any time. Every request under a grant is written to the tenant's audit with actor kindvendor, and the tenant admins are told by e-mail when a grant is used for the first time. Under a grant the operator reads, on the tenant's host and with their own vendor login, what anauditorreads, numbers and addresses masked as for anyone, and can change nothing (api/cloud.yamlconventions). Watch and the hub give the vendor no access (operations.md §11). -
The billing service (
billing-service), the vendor's service of customer accounts, payment and plans, calls the operations of tagbilling(api/cloud.yaml) as its machine user at the installation's Zitadel: an access token issued as a JWT for the audienceEXCUBIO_BILLING_AUDIENCE, verified as every login the cloud takes is (issuer, signature, expiry), whose subject must beEXCUBIO_BILLING_SUBJECT(operations.md §3). It creates the tenants of its workspaces and pushes their entitlements, nothing else: no tenant's people, numbers, incidents or audit, and no operation of a person, a token, an operator, a hub or an installation. No other credential reaches its operations: a tenant's API token, session or device, an operator's login, a person's login on a device and the client certificates of hubs and installations, which the link's listener takes and on which these operations aren't served, are refused, and its token is refused everywhere else, since every other login is checked for its own client. It acts on the tenants it created (tenant.billing_account) only. Each call is written to the installation's audit (platform_audit) asbilling:<subject>, and each change of a tenant to the tenant's audit with actor kindservice. Without the two settings every call is refused. The cloud calls the billing service too, as its own machine user at the installation's Zitadel, which holds the roleservice:excubioon the billing service's project and nothing in the cloud: one replica at a time (advisory lock class 14) reads every entitlement of its tenants every 15 minutes and applies the newer ones as a push, audited asbilling:pull, and sends each of its tenants' pageable rotations (rotations, as Limits counts them) when the count changed, within 5 minutes, and at least hourly (operations.md §3). -
Change rule: submitting or merging a change set needs edit rights on every changed file; its approvals come from the impact set (spec-format.md §6).
-
Two-person rule for power. A binding of
approver,adminorsecret-admintakes effect only after a secondadminconfirms it, so nobody can grant themselves the right to approve their own change. The exceptions are the first binding at setup, made by the break-glass admin or by whoever operates the deployment, and a sole admin's bindings (below). The break-glass admin holdsadminhub-wide by its kind, without a binding, and while no OIDC user or group holds an active hub-wideadminbinding, the bindings it creates are active at once. Once one is active, the break-glass admin's bindings are pending like anyone's, and it can neither confirm bindings nor approve change sets. A hub without a break-glass admin (local_admin = false, as a managed installation's hubs run) gets its first admin fromexcubio-hub admin grant, a server subcommand run with the server login (cli.md §6): it bindsadminhub-wide to an IdP subject or group, active at once under the same condition and pending for an admin to confirm after it, and is audited with the operating system's account. Nobody holds a role by signing in alone. For a binding to an IdP group, who joins the group is controlled in the IdP; the hub shows a binding's current members. -
Sole admin. The two-person rule needs a second person; where there is none, the one admin acts alone, visibly and audited. The hub's sole admin is the one OIDC user holding an active hub-wide
adminbinding of their own while no other person does. An active hub-wideadminbinding of an IdP group counts as more than one person, whoever its members are, since the hub learns a group's members only from their logins; the break-glass admin and service accounts count as nobody. While a hub has a sole admin:- the bindings of
approver,adminandsecret-adminthe sole admin creates are active at once, audited as such; - the sole admin approves their own change set for what nobody else may approve (spec-format.md §6).
Nothing switches this off: once a second person holds an active hub-wide
adminbinding, the hub has no sole admin, bindings are pending again and a self-approval no longer counts. So that no admin becomes the sole admin by removing the other, the API refuses the removal of another person's active hub-wideadminbinding that would leave a sole admin: the person removes it themselves (stepping down takes effect at once), or the operator does withexcubio-hub admin revoke(cli.md §6). The UI andexcubioctlsay when a hub has a sole admin. - the bindings of
-
One-off downtimes and bulk close are state, not spec; their limits are in pipeline.md §8.
-
Every mutating request writes an audit event (compliance.md §3).
11. Security boundaries
-
Tokens are random, stored as SHA-256 hashes and carry a prefix of their kind for secret scanning, each prefix of one kind only:
Prefix Token Issued by exk_API tokens Hub, cloud, Watch exi_Intake tokens, each for one Source and revoked when a revision without the Source activates Hub exe_Hub enrolment Cloud exm_Enrolment of a managed installation (operations.md §4) Cloud exr_Relay enrolment (§13) Hub exw_Watch check tokens Watch exd_App device tokens; a device acts only as its person, with the rights of member(mobile.md §2)Cloud exl_Signed incident links in SMS (on-call.md §5) Cloud exc_Personal calendar feeds (on-call.md §10) Cloud Query strings never carry credentials. Watch push and reverse-check URLs, personal calendar feeds and incident links carry their token in the path, because simple senders, calendar apps and SMS can do nothing else; such a token authorises only that one beat, feed or incident (an incident link: reading the incident and the responses that on-call.md §5 allows it, as its person), Watch also accepts its tokens as a bearer header, and every part redacts them from logs.
-
Database roles. A hub node serves as a database login that may read and write the tables of the hub its transaction names but change no schema and only append to the audit log; the migrations run as another login, which owns the schema (
schema/hub.sql§11, operations.md §1). The hub scope, the lookup role and the reporting logins: §12, as the cloud's and Watch's tenancy. -
Front door. On a managed installation (operations.md §1) every request, connection and message finds its hub before anything of a hub is read, and is then served under that hub's scope only:
- HTTP (UI,
/api/v1, HTTPS intake) by its host name (Host, or HTTP/2's:authority): a hub answers on<host label>.<hub domain>, served with the installation's wildcard certificate (operations.md §2). Every credential is looked up under that hub (sessions, API tokens, intake tokens, relay enrolment tokens, sign-in codes), so one of another hub is unknown and refused as a wrong one is. A host of no hub, or of a hub being deleted, is answered404on every path but health and the sign-in callback (intake:401), the same for every such host, so it tells nothing of the hubs there are: the API withhub.unknown_host(api/hub.yaml), the UI with its page that no hub is at this address (ui.md §2). Cookies are the hub's host's only (noDomain); the CSRF token belongs to the session, the event stream to the caller's hub, and the API answers no CORS, so no hub's page can call another's API with credentials. A request a relay forwarded is its relay's hub's, whatever its host. - SMTP by the domain of each recipient: a hub's mail domain is
<host label>.<mail domain>(operations.md §2); a transaction delivers to one hub, and a recipient of another hub gets452, which a sender takes as a request to send to it in a transaction of its own (integrations.md §13). Validation refuses anemailSource with a recipient outside its hub's mail domain (spec-format.md §5). IMAP mailboxes are read by their hub, which dials out. - SNMP and syslog (UDP, TCP, TLS) arrive only through the hub's
relays: a sender's address names no tenant. A managed installation
opens no listener of its own for them (
snmp_listenandsyslog_listenare not served), and validation tells a hub there that such a Source needs a relay of its own. - Relays by the TLS server name of their connections (§13).
- Keys. What opens a secret on these paths is the hub's: intake and API tokens are hashes in the hub's rows, the login of a sign-in and the relay CA's key are sealed under the hub's data key, and a Webhook's signing key is a Secret of the hub's (§12 Hub keys). The OIDC client and its secret are the installation's.
A standalone installation is the case of one: any host, server name and mail domain is its hub's, and it keeps its direct SNMP and syslog listeners. An authentication failure at a hub's door is audited in the hub's log; at a host of no hub in the installation's (
installation_audit); at most one entry a minute each, counting the failures since the one before. - HTTP (UI,
-
A shared installation. Its hubs are tenants that neither know nor trust each other. What one hub can do through everything open to it (its API with its admin's credentials, its intake, its spec, its relays and mail), and what it can't, of another hub or of the installation:
- Credentials and rows. No credential of a hub opens anything at another hub's door (Front door, above), and no query of a hub reads or writes another hub's rows (§12 Hub scope).
- Ids. Every operation that names an object by id, number or name answers for another hub's object exactly as for one that exists nowhere: status, code, detail and time; it reads and changes nothing of the other hub.
- Memory. Everything a node keeps in memory of a hub is keyed by the hub: compiled revisions, inventory snapshots, its latest spec at intake, SNMP credentials, rate buckets, slice costs, turns and caps, event stream readers, relay connections and the clients through them, self-alert conditions, usage counts. What isn't keyed holds no hub's data: the CEL environment, the days of the holiday regions, the connections per sender address, the UI's static files and the HTTP client of direct targets, whose connections may serve several hubs but carry no credential of their own: no cookie store, no default header, no client certificate, no redirect.
- What a hub sees. Its own series on
/metricsat its host (the installation's own series are on the installation's metrics listener), its own usage, audit, exports, operations, errors and self-alerts; never another hub's ids, names, hosts or counts. The installation's nodes (names, versions, the lanes and shards they hold) appear in a hub's status, as they serve it. - Names. Host labels and mail domains are public names: the UI and
its sign-in load at a hub's host, so a known host answers otherwise
than an unknown one, as its relay server name does at the relay
listener. Nothing else answers without a credential: an address of
no Source and one that refuses the sender both get
550 5.1.1, and a token's prefix tells its kind only. - Spec. A hub's spec reaches only what Egress (below) allows: on a
managed installation public addresses dialled by the node, private
ones through its own relays only, never through another hub's; the
installation's own addresses, loopback, link-local (cloud metadata),
the private networks and the cluster's ranges in
[egress] denyare refused whatever name or redirect leads there, and a name is dialled at the address checked, so a changing DNS answer can't move it. Reaching another hub's public door, or the cloud's link listener, is allowed and carries nothing but the hub's own Secrets for their hosts. A mail Source of another hub's domain fails validation (Front door). Expressions and selectors are bounded by their cost, and a hub's expensive slices by their time budget (§4). - Resources. A hub's load delays the hub: its share of each partition and correlator step (§4), its events per second, store turns and intake requests (pipeline.md §2), its tasks and connections (pipeline.md §10 Fairness, Egress below), its replays and explanations (pipeline.md §12), its API requests and event streams (§12 Requests per hub).
- The installation. Its nodes, partitions and shards are changed by
its operator only: removing a node is the operator hub's admins'
(
api/hub.yamlremoveNode). - Lifecycle. A suspended hub takes no management writes; a deleting hub is a host of no hub at once and its rows are gone within the time compliance.md §5 gives. A host label given to a new hub carries nothing of the old one: no row, session, token, relay, usage or cached spec, as each is the old hub's id's.
The tests
isolation.rsofcrates/excubio-hubcheck these claims on a running installation of two hubs. -
Local admin. The break-glass admin's password is generated at
initand shown once, unless the hub runs without it (local_admin = false) orinitruns with--no-admin-password, as a deployment's Job does; a hub of a managed installation has none; it locks for 15 minutes after 5 failed logins.excubio-hub local-admin reseton a node sets a new password, shows it once, lifts the lock and ends the admin's sessions (cli.md §6). Every break-glass login is audited and raises a self-alert (§9), so its use is never silent; for its limits once OIDC admins exist: §10. Failed intake authentications are rate-limited per sender address. -
Sessions. A hub UI session lasts at most 12 hours from its login and ends after 2 hours without a request; the break-glass admin's lasts at most 1 hour (
schema/hub.sqlweb_session). A request never extends the 12 hours. Roles from IdP groups take effect at the next login, so a removal from a group reaches the hub within 12 hours; an admin can end it sooner by deleting the binding. -
Sign-in. The cloud UI and its Watch page have one redirect URI each at the installation's Zitadel, on the host of the public URL (
/login/callback,/watch/callback), whatever the tenant; a new tenant needs no change at the IdP. A login starts on the tenant's host, which keeps it with its state (the tenant's slug, a dot, a random value), nonce and PKCE verifier and sets a random binding in a cookie of the tenant's host only (ex_login,HttpOnly,Secure,SameSite=Strict). The IdP returns to the installation's callback, which takes the login by its state once and within 10 minutes, checks the ID token and the tenant's grant (§12) and answers with the tenant's host and a code in the URL's fragment, valid 60 s; the tenant's host creates the session only for that code with the binding of the browser that started the login, so a code carried to another browser is spent and refused. The callback hands over only to the host of a tenant that exists, never to a host taken from the request (api/cloud.yamlcompleteOidcLogin). The Watch page's login is the browser's own (PKCE, the verifier in the tab): the installation's callback passes the code in the fragment to the tenant's host named by the state, which alone can redeem it, at the identity provider's token endpoint, which answers CORS for any origin (Zitadel's OIDC endpoints do). So nothing of a tenant is registered at the identity provider: Watch's client has the one redirect URI of the installation's host, as the cloud UI's has. The page then calls Watch cross-origin with the token as a bearer header: Watch answers CORS, preflight included, only for the check operations and only to the exact originhttps://<slug>.<cloud host>of a tenant it holds (the cloud's public URL is a setting of Watch, operations.md §3); no wildcard, no credentials, so no other site's script can use a Watch login. The ID token of a cloud or hub login names that client among its audiences; it may name further ones, such as the other clients of the Zitadel project, only with that client as its authorized party (azp), and an authorized party that names another client is refused (OIDC Core §3.1.3.7). The hub UI signs in the same way, with one OIDC client per installation, whatever its hubs: a login starts on the hub's host (startOidcLogin), its state the hub's id, a dot and a random value, kept sealed under the hub's data key with the hash of the binding cookieex_loginof that host; the IdP returns to the installation's one callback (<public_url>/login/callback), which takes the login of the hub its state names once and within 10 minutes and answers with the hub's own URL and a code in the fragment, valid 60 s, which the hub's host redeems only with the binding of the browser that started the login (api/hub.yamlredeemLoginHandoff). A hub names the organization and tenant of its logins (hub.auth, from the cloud's provisioning; on a standalone installation from[auth] organizationandtenant, operations.md §2): it asks Zitadel for that organization and the project roles, and signs in only a login whose ID token names the organization and grants the tenant in the tenant claim, as the cloud reads it (§12); a login of another organization, without the organization's claim or without the tenant's role is refused, so a user of one hub's organization gets no session on another's. Unset, a hub admits every login of its issuer. Users and role bindings are the hub's own; its roles come from its bindings, not from the cloud's roles. The firstadminof a hub on a managed installation is bound to the subject of the first admin the tenant named, from the provisioning (schema/hub.sqlrole_binding, operations.md §1). -
Cloud sessions. A cloud UI session has the same limits, 12 hours and 2 hours (
schema/cloud.sqlweb_session), and the same cookie and CSRF rules (api/cloud.yamlconventions). The cloud reads a person's roles with every request, so a role or membership that an admin removes is gone at once, for sessions, devices and tokens alike; a removal from an IdP group takes effect at the person's next login, within 12 hours for the UI and 30 days for a device (on-call.md §1). Watch keeps no session (api/watch.yaml). -
excubioctl at the cloud. A person signs
excubioctlin by browser (cli.md §1) with the device authorization flow at the installation's Zitadel, for excubioctl's own public client, which allows that grant only. The access token is taken by one operation on the tenant's host (createCliToken), which checks it as every login (§12), admits it to the tenant as a web login and answers with an API token of the person that always ends; the cloud keeps no access token, and every other operation refuses it, as it refuses any bearer that is none of its credentials, so an IdP login never acts on the API but through that token, which is audited, listed and revoked as any. -
Secrets are write-only. Spec files hold
Secretmetadata and references; values are written through the API, encrypted with the hub's data key (AES-256-GCM) wrapped by a deployment key kept outside the database (operations.md §6). There is no read verb. -
Egress. The hub dials only hosts written in a reviewed spec object (webhooks, ITSM, inventory sources, write-back targets, SMTP, IMAP mailboxes, OBM, the Icinga API, the fallback SMPP account) and the audit sinks its admins set, never a host taken from an event or a response: a redirect or a paging link to another host fails the request. A change set that adds such a host needs an
adminapproval (spec-format.md §6). Every such connection, of whatever protocol (HTTP, PostgreSQL, TDS, IMAP, SMTP, SMPP, syslog), goes through the node's one dialer, which takes the target's host and port and the active revision's Settingsrelay.networks(spec-format.md §3.16):- A host that
relay.networksnames goes through a relay (§13): an address in one of its networks, or a name that one of its names matches (cmdb.corp.example, or*.corp.examplefor every name below it). A name is routed by how it is written, never by the addresses it resolves to: the relay resolves it, in the DNS of its network, and dials it only if its allowlist admits it.egress.denydoesn't apply to it: it is about the hub's own network, whose addresses the relay's network may reuse. A target the hub can't reach this way fails with the reason: no relay connected to the node, no relay's allowlist admits it, or the relay's refusal (not admitted, not resolved, unreachable, timed out). - Every other host the node dials itself: a host name is resolved once
per connection, every address is checked against
egress.deny(default: unspecified, loopback, link-local, IPv4-mapped IPv6 and the node's own addresses, and on a managed installation also the private networks: RFC 1918,100.64.0.0/10andfc00::/7, operations.md §2), so a name that resolves into a denied network is refused, and the connection goes to the checked address, so a second resolution can't move it. A hub of a managed installation thus dials only public addresses itself and reaches a private target only through its own relays.
A hub's connection goes only through the relays of that hub, never through another hub's. The egress addresses of a shared installation are those of every hub it serves: they are no trust anchor for a customer's firewall or allowlist, which admits a hub's connections by its relays and by TLS to its targets instead.
The hosts of a node's configuration (its database, the cloud, Watch, the forward proxy, the identity provider) are dialled as configured, neither through relays nor under
egress.deny: the deny list keeps the spec's hosts from the node's surroundings, and the configuration is the operator's, whose embedded database listens on loopback. On a managed installation each peer's addresses at the port the node dials it (the database's port, the port of the URL), resolved at the node's start and every minute, are denied to the spec's targets too, so a spec can't dial the node's own peers; another port at a peer's address, a service behind the same gateway, stays a public target like any other. The write-time checks of a literal address (an inventory source's URL, an audit sink's target) apply the same rule at the target's port. A URL's host is the one the HTTP client dials, parsed by the WHATWG URL rules: an address in any spelling (2130706433,127.1, hex or percent-escaped octets) is checked as the address it denotes, and the host a Secret'shostsmust match is that same host. A target through a relay never takes the hub's forward proxy. Before a request through the forward proxy (a SaaS inventory source,cloud.extraHeartbeatUrl) the hub resolves the host and refuses it when any of its addresses is denied. What that covers: a name whose every answer, at the hub's resolution, is outsideegress.deny, and an address in any spelling. What it doesn't: the proxy resolves the name again and dials what it gets, so a name whose answer changes in between (DNS rebinding), or a proxy whose resolver answers otherwise than the node's, reaches what the proxy reaches; only the proxy's own deny list stops that, and the proxy's networks are its operator's. Validation therefore warns of every host a node with a forward proxy and a non-empty deny list would hand to the proxy (spec-format.md §5). A managed installation never hands a spec's host to the forward proxy: it dials it itself as above, the checked address, so rebinding can't move it.- Connections per hub. A hub's work holds at most 16 connections at once on a node to the spec's hosts and its audit sinks, and at most 4 to one host; a connection beyond either waits up to 5 s for a place and then fails as a transport error, which its task retries (pipeline.md §10 Fairness). So one hub's slow or dead target holds four of its connections, and other hubs' connections are their own. TLS to these hosts is verified against the host's trust store, where a customer's own CA is installed. A Secret is sent only to the hosts it declares (spec-format.md §3.14). Inventory sources are only read; their credentials are Secrets of read-only accounts. Watch applies the same rules, with its own deny list, to the webhooks of tenants' checks. The cloud dials the hosts of its configuration and the tenants' audit sinks; a sink's host is resolved once per connection and checked against the same list of non-public ranges as Watch's, when it is written and when it is dialled, and TLS to it is verified against the host's trust store.
- A host that
-
Expressions in source mappings are CEL: no I/O, bounded cost, evaluated with a step limit (spec-format.md §3.1).
-
Personal data in the cloud (names, e-mail addresses, phone numbers, push tokens) is sealed under a data key per tenant; lookups by number or e-mail use keyed hashes (
schema/cloud.sqlconventions). -
Hub identity is the mTLS client certificate; the cloud binds every page request to the tenant of the certificate. A restored database doesn't keep it unless the operator says the old hub is gone, and a second copy of one hub can't hold the stream (operations.md §4).
-
Vendor CA. The hub's client certificates and the cloud's hub endpoint certificate chain to the vendor's hub root CA. Its key is offline in a hardware security module and signs only the issuing CA, whose key the cloud uses from a hardware security module. The hub trusts, for the link, only the root certificates pinned in its binary, not the system's trust store;
[cloud] ca_filereplaces them, for test clouds only, and thenstatusand readiness report that the link is not pinned. A new root ships in a release at least four minor versions (the versions the cloud accepts, operations.md §7) before the cloud uses it, so every accepted hub trusts it; the old root stays pinned until no certificate under it is valid. -
Unauthenticated intake. UDP syslog and SNMP v2c carry no credential the hub can check (on a managed installation they arrive through relays only, Front door above): a community string travels in clear, and any host that can send to the hub can forge a sender address that
allowFromaccepts. Such a sender can open, resolve or close the alerts of that Source. Validation warns about Sources that can resolve or close alerts over these channels (spec-format.md §5); SNMPv3 with authentication and syslog over TLS don't have this weakness. -
What the cloud is trusted with. The cloud sees page payloads and the people, numbers and shifts of the tenant, and can page anyone on call. It can't read the hub or run anything there: down the link come on-call state and responses, which the hub applies to its replica and, for acks and closes, to its alerts and their write-back (§5). A hub receives and pages only the rotations on its allowlist (§12).
-
What a relay is trusted with. A relay sees the intake of its network and the bytes of the hub's connections through it; it holds no spec, Secret, event or key of the hub but its own client key. It can give any source address to what it forwards, so
allowFromof relayed intake is as strong as the relay, which is trusted as far as the network it stands in. The hub verifies TLS to a target through a relay end to end against the host's trust store, as for any target, so a relay can't read or change what a TLS-protected protocol carries (HTTPS, IMAP, SMTP with STARTTLS, PostgreSQL and TDS with TLS); a protocol in the clear is as exposed as in the relay's network. The hub, and whoever runs it, reaches through a relay only what the relay's allowlist admits, a file of the customer on the relay's host that the hub can't change (operations.md §12). A relay authenticates with a client certificate of the hub's relay CA, which the hub can revoke at any time (§13). -
Inbound carrier traffic. The tenant of an inbound SMS comes from the called number: sender numbers are dedicated to one tenant (on-call.md §4); receipts and call events find theirs by the carrier's reference. A callback the carrier repeats is recognised by its event ID and ignored. An SMS counts only from a verified number of the tenant's people or a rotation's handset, and acts only on incidents delivered to that number; without a code it can only acknowledge the newest of them (on-call.md §5), and answers are rate-limited per number. Watch handles replies to its numbers the same way (watch.md §2). The residual risk is sender spoofing: SMS sender numbers aren't authenticated end to end. Someone who knows a person's number and the tenant's sender number, which every person of the tenant knows, can forge that person's reply and so acknowledge the newest incident delivered to them, without a code; any other response needs a current short code as well. What bounds it: the person is told of an SMS acknowledgement on another medium, the ack timeout pages again, a tenant can require the code for every acknowledgement (
sms_ack_code, on-call.md §5), and at Watch an acknowledged failure pages again after 4 hours. Signed incident links, the app and voice calls don't have this weakness. -
Intake authenticates each source by its intake token (HTTP), community or USM user (SNMP v2c/v3), and optionally client certificates, and checks the Source's
allowFromaddresses. Unknown or disallowed senders are rejected and counted. Because a Source can only correlate within its own namespace, a stolen intake token can't clear or close alerts of other Sources (pipeline.md §1). Its alerts can join groups, which never suppress other teams' pages (pipeline.md §16). -
The UIs are served with a Content-Security-Policy that allows scripts only from their own origin and by the hash of the page's inline scripts, no plugins, no framing (
frame-ancestors 'none'), forms and connections only to the own origin, and for the cloud UI's Watch page Watch and the installation's Zitadel (stack.md §3), withX-Content-Type-Options: nosniffandReferrer-Policy: no-referrer. The session cookie isHttpOnlyandSameSite=Strict; tokens shown once are never stored by the UI, and the Watch page keeps its access token for the browser tab only. -
Event content is untrusted. Titles, descriptions, labels and URLs from events are rendered escaped in the UIs, e-mail and tickets; only
httpandhttpsURLs become links; CR and LF are removed from anything placed in a mail header; SMS and voice texts are plain text with control characters removed.
12. Tenancy and limits
Hubs and installations. A hub is a tenant's unit of the on-prem
or vendor-run part: its own spec, certificate and link sequence, allowlist,
audit chain, data keys, relays and host name; a tenant may have several
(production, test). An installation is one database with its nodes,
standalone or managed
(operations.md §1); one binary, schema
and code path serve both. The installation's registry (hub,
schema/hub.sql §0) holds each hub's id, which is the
cloud's id of the hub when the cloud provisions it and else one of its
own, so a hub runs before it enrols; enrolment adds the cloud's hub and
tenant ids. A standalone installation's one hub is created by init
and is its operator hub; a managed installation starts without hubs,
the cloud's provisioning creates them through the installation's client
of its channel (operations.md §4), and its
operator hub is the hub the provisioning names: on a shared
installation the vendor's, never a tenant's, on a dedicated one the
vendor's or its tenant's
(operations.md §1,
pipeline.md §19): a vendor
operator names it in the cloud's registry of installations
(api/cloud.yaml updateInstallation
operator_hub), the poll hands it to the installation
(pollInstallation), and Watch tests it hourly. Every
node holds the registry in memory with the hubs' data keys and reads it
again on a change (NOTIFY excubio_hub, from triggers on the hub,
installation and data key rows) and at least every minute; a request,
message or connection for a hub it doesn't hold yet reads it at once
(§11), and intake maps no event of a hub it
can't find, so a hub created while the nodes run is served by each
within its lanes. The partitions of the event order, the correlator shards,
the link shards, the nodes and the holiday regions are the
installation's; a partition holds the events of every hub whose lanes
include it, numbered in one sequence (§4).
- Hub scope. Every row of hub data carries
hub_id, first in its primary key; natural keys (revision and change set numbers, an alert's namespace and key, a Secret's versions, the audit chain, a blob's hash, a bundle) are unique per hub; references between hub rows are composite foreign keys. Spec blobs are content-addressed per hub: a store shared by hubs would tell a hub whether another holds a file. Every transaction on hub data names its hub in the settingexcubio.hub_id, and every query filters and writes its hub besides; row-level security on every hub table shows and accepts only the rows of the hub the transaction names, so a query that forgot its filter reads and writes nothing of another hub. A step that works on several hubs sets the scope again before each hub's work. Nobody but the owner has privileges on the partitions of partitioned tables, so a query can't read past its parent's policies by naming a partition. - Lookup functions. Work whose hub isn't known yet (a request by its
host name, a mail by its domain), a step's search for the hubs with
work in its partition or correlator shard, and the node's loops over
the hubs (whose active revision changed, which have an audit sink or
an anchor due), so that an idle hub costs a loop no query of its own,
go through
SECURITY DEFINERfunctions owned by the roleexcubio_hub_lookup, which may read only the columns they need and return hub ids, times and counts, nothing else (schema/hub.sql§13). No login is a member of it. - Hub keys. Each hub has its own data keys, wrapped by the installation's deployment key; everything a hub's key seals has the hub's id in its associated data, so a sealed value copied into another hub's rows doesn't open (operations.md §6). The hub's advisory locks (its audit chain, its change set numbering, a Source's mailbox) are keyed by the hub; its link is held under its link shard's lock (§4).
- Reporting logins. A login of
excubio_reportingreads the reporting views of the hub that its row inreporting_loginnames, whatever settings it sets: the views run with the reader's row-level security, whose policy for reporting binds the login, not a setting, and the role may read only the columns the views show (integrations.md §12).
The cloud and Watch are multi-tenant:
-
Every tenant row carries
tenant_id; references between tenant rows are composite foreign keys; row-level security hides other tenants' rows from every query that forgot its filter. The servers run as a database role that row-level security binds, and every transaction names its tenant; work whose tenant isn't known yet finds it through lookup functions that return ids only (schema/cloud.sql§9,schema/watch.sql§6). -
Identity: a tenant signs in at a Zitadel organization (
tenant.idp_org_id). The customer's IdP (Entra ID, Okta) federates in Zitadel. Several tenants may name the same organization, such as a customer's production and test tenants; a login to one of them then needs that tenant's grant besides the organization: the tenant's slug in the tenant claim (EXCUBIO_OIDC_TENANT_CLAIM, by default Zitadel's project roles, so a project role whose key is the slug), an IdP group of one of the tenant's teams, a membership of a team or a tenant role of the tenant from before, or an invitation of the tenant (api/cloud.yamlcreateTenantadmins). A tenant alone with its organization admits every login of it. At Watch, a login reaches the tenant of its organization where it holds a role, of several the one its request names (api/watch.yamlconventions). Teams come from thegroupsclaim; membership syncs at every login. Every login the cloud takes is checked for its issuer, its audience and its organization: a web login's ID token is the cloud UI client's; the access token of a login on a device (idpLogin), of a person'sexcubioctl(cliLogin) or of a vendor operator (operatorLogin) is a JWT signed with a key of the installation's Zitadel, issued for the app's client, excubioctl's client or the operators' client (operations.md §3; an audience, and the authorized party orclient_idwhen the token names one) and not expired, and the issuer's userinfo answers for the same subject. An access token of another client of the installation is refused, so no other application's token logs in to the cloud. -
Hubs: a tenant has one or more enrolled hubs (production, test). Each has its own certificate and sequence, and an allowlist of rotations (globs over
team/rotation; a new hub starts with an empty one). Only those rotations, their teams, shifts, people and fallback caches are replicated to the hub, and a page request for another rotation is refused (link.rotation_not_allowed); the hub raises a self-alert and sends the page to itsrouting.unroutedTeam(§5), whose default rotation a hub's allowlist therefore has to include. A test hub thus holds no production numbers and can't page production rotations. The reserved rotationexcubio/synthetictakes the synthetic test's page of every hub without being on its allowlist, and isn't replicated (watch.md §1). -
A tenant's first admins are named when a vendor operator or the billing service creates it (
api/cloud.yamlcreateTenant,putBillingTenantadmins): IdP subjects or e-mail addresses, each of which becomestenant-adminat the first login of that subject, or with that address verified by the IdP, once and audited; they grant every other role from then on (§10). -
Sign-up. The billing service owns customer accounts, payment, plans and the Zitadel organization its customers sign in at; the cloud owns the tenant and enforces what the plan allows. A customer signs up at the billing service, which the installation's own host of the cloud UI links to (ui.md §3); the billing service creates the tenant of the customer's workspace with the workspace's id, its slug, the organization, the person who signed up as its first admin and its entitlement (
putBillingTenant), and sends the person to the tenant's host, where they sign in and set it up. A vendor operator creates a tenant without the billing service (createTenant), as for an enterprise contract. -
Plans. The billing service pushes its entitlement of a tenant, whole and in the order of its versions (
putBillingEntitlement), the same entitlement it pushes to every product: its subscription's status, which sets the tenant's state (Tenant states, below), the plan, whose name the cloud shows and doesn't interpret, the limits below with the delivery mode and the cadence of its hubs' synthetic test (synthetic_every, watch.md §1), and the featurevoice, whether Watch may call its people. The cloud knows no plan catalogue and no prices: a plan is the data it was sent. A tenant created without one has no limits, calls and is under evaluation delivery, as a vendor operator's tenant. -
Trial. A tenant on the billing service's free plan, or whose subscription is canceled, is under trial delivery: it pages, but sends real SMS only within the rules of on-call.md §4 and makes no call, and Watch doesn't call its people. It has one hub, run by the vendor on a shared installation with the limits sent; creating one the customer runs is refused (
trial.hosting). The billing service makes itlivewith a paid plan, which needs a payment method, and lifts all of it. The cloud enforces these rules whatever limits the billing service sends. -
Tenant states. Vendor operators suspend and delete tenants (
api/cloud.yamlupdateTenant). The billing service's entitlement sets the state of its tenant with each version:activemakes it active;past_duesuspends it and keeps its delivery mode, so it pages as before while the payment is retried;canceledandunconfiguredsuspend it under trial delivery. A state a vendor operator set thus stays until the next version, and only a vendor operator deletes a tenant. A suspended tenant keeps everything that paging and responding need; only its management stops. A deleting tenant is refused everywhere, the billing service's entitlement too, until its data is gone (compliance.md §5).activesuspendeddeletingHub link: pages, updates, stream yes yes refused ( 401); the hub uses its local fallback channel (§7)Chains, escalation, notices, carrier callbacks, SMS replies, keypad yes yes stopped; replies are ignored Incident links, device tokens, logins and sessions: read, respond, own contacts, devices, absences, overrides and swaps, manual pages yes yes refused Writes that need rotation-manager,team-adminortenant-admin(teams, rotations, hubs, tokens, roles, settings)yes refused ( 403tenant.suspended)refused API tokens yes as their person or scopes, by the rows above refused Support grants in force yes yes refused Watch: beats, evaluation, paging yes yes stopped; Watch deletes the tenant (watch.md §5) Watch: management writes yes refused refused Hubs on managed installations ( pollInstallation)run run suspended: intake, processing and paging go on, spec changes and the hub's other management writes are refused (403hub.suspended; what it still takes:api/hub.yamlconventions)deleted: the installation's front door refuses them at once (as a host of no hub) and deletes their data -
Delivery mode. Vendor operators and the billing service set whether a tenant's messages go through the carriers (
live), through them within the trial's rules (trial) or to its people's evaluation inbox (evaluation, on-call.md §4); tenant admins can't change it. A cloud without an SMS carrier keeps the billing service's tenants under evaluation whatever it sends. -
Hosting of a hub. A hub runs on a managed installation of the vendor, shared or dedicated to the tenant (operations.md §1), or at the customer, who enrols it with a token (operations.md §3, §4). A tenant admin chooses between the customer and the vendor when creating it; the cloud places a vendor-run hub on the installation a vendor operator named for the tenant, or else on a shared one with room (
api/cloud.yamlcreateHub). The cloud UI shows a vendor-run hub's hosting and links to its URL. -
Limits (
tenant.limits) are the licence, set by a vendor operator or with the plan:rotations(pageable rotations),hubs(hubs not decommissioned, whoever runs them),watch_checks(thepushandreversechecks at Watch, which enforces it; a hub's own two checks come with the hub). Creating a rotation, a hub or a check beyond the limit is rejected withtenant.limit_exceeded. Members per team are unlimited. The per-hub limitsevents_per_second,events_per_day,cis,sources,relays,replay_window_daysand the retention tierretention_days(30, 90 or 396) reach the tenant's hubs on managed installations with their desired state, and the hub enforces them; an absent limit is unlimited, an absent tier 396 days, so a tenant without them is unlimited, and an installation without them, as a standalone one, behaves as if the limits didn't exist. On the hub (hub.limits,schema/hub.sql§0; the provisioning writes them and every node reads them with the registry):Limit On the hub events_per_secondIntake takes no more, with a burst of 10 s, shared by the live nodes (pipeline.md §2 Rate per hub) events_per_dayNotices at 80 % and 100 % of it; intake refuses above three times it until the end of the UTC day (pipeline.md §2 Daily quota) cisAn import whose read finds more CIs is rejected as truncated, a merge whose snapshot has more is rejected; the last good one stays (pipeline.md §15) sourcesA change set whose revision has more Sources fails L1 (spec-format.md §5) relaysAn enrolment token and an enrolment beyond it are refused, 403hub.limit_exceededreplay_window_daysBounds the range of replays and of a change set's impact (pipeline.md §12) retention_daysThe retention tier of the hub's events (compliance.md §2) Event volume is measured on the hub and reported (
excubio_events_received_total, and per day for a hub on an installation,api/cloud.yamlreportUsage, fromhub_usage, pipeline.md §2 Usage); the hub's own protection limits apply to every hub (pipeline.md §2). -
Requests per hub. On a managed installation a node serves at most 8 API requests of one hub at once; a further request waits up to 2 s for one of them to end and is then refused,
429request.rate_limitedwithRetry-After: 1. Event streams (streamEvents) count apart: a node keeps at most 50 of one hub open and refuses the newest beyond,429withRetry-After: 30, so the streams already open, such as a wall's screens, stay. One hub's dashboards or scripts thus hold at most 8 of a node's database connections for requests, and a hub's streams cost the node one reader of the hub's changes whatever their number (api/hub.yamlstreamEvents). A standalone installation's hub has the node to itself and no such bound.
13. Relays
A relay (excubio-relay) stands in a network that its hub doesn't
reach and dials out to the hub. It carries intake: senders in its
network send to the relay's listeners as they would to the hub's, and
the relay forwards each datagram and connection unparsed, with the
sender's address and the listener it arrived at. And it carries the
hub's connections to targets in its network that Settings
relay.networks names (§11 Egress) and the
relay's allowlist admits. All parsing, mapping and reading stays in the
hub. Relays are a feature of every hub: the customer network of a
vendor-run hub, a remote site or a DMZ of a self-hosted one. A hub has
any number of relays, all active; one serving production has two or
more, which senders reach under one VIP or DNS name of the customer's.
Relays don't know of each other. Deployment, allowlist, enrolment and
sizing: operations.md §12.
-
Connections. Every connection of a relay is an outbound TLS 1.3 connection (ALPN
excubio-relay/1) to the relay listener of one hub node (operations.md §2relay_listen), through the forward proxy of the relay's configuration as aCONNECTtunnel when it has one, with the relay's client certificate. The relay trusts for it only the hub's relay CA, which issues the nodes' relay listener certificates too (each node issues its own for the server name it is reached by, below, valid 30 days, and a new one daily, so a node serves relays only with the deployment key), so the relay needs no public CA, and a TLS-inspecting proxy fails it as it fails the link (§5). Each node names the address relays reach it at (relay_address). A relay keeps one control connection to each node of its hub: it connects to the address it enrolled with, learns the nodes from the answer and connects to each. A node sends its relays a newwelcomewithin 5 s of a change of the nodes or their relay addresses, so a relay learns a node that joins later; awelcomenames every node that takes relays, and the relay keeps that list in its state directory, connects to a new node and drops one no longer named (a node that left, or runs without a relay listener). A node that is down stays named, and the relay keeps trying it. For each stream it opens one more connection: a connection of the hub to a target, a TCP intake connection, or its datagram stream. There is no multiplexing of streams: each is an ordinary TLS connection, so a slow one holds up no other. -
Frames. Control connections, and each stream connection until its first frame, carry frames: the length of a header (4 bytes, big-endian), the header, a JSON object with its
type, the length of a body (4 bytes) and the body, empty but for datagrams. A header is at most 64 KiB and a body 64 KiB; a frame beyond either, or one that doesn't decode, closes the connection. A type that a side doesn't know is ignored, so either side can add one.Frame From On Carries hellorelay control, first the relay's version, its spool id, its allowlist and listeners welcomehub control the hub's version, the node's name, every node with its relay_addressbyehub control a code, before the hub closes: relay.revoked,relay.unknown,relay.update_requiredheartbeatboth control every 15 s; the relay's with its spool: bytes, datagrams, the oldest's receive time, datagrams dropped connecthub control a stream id (128 random bits), the target's host and port refuserelay control the stream id, a reason ( not-allowed,unresolved,unreachable,timeout) and a detailacceptrelay stream, first the stream id, then the target's bytes both ways tcprelay stream, first the listener and the sender's address and port, then the sender's bytes both ways datagramsrelay stream, first the spool id; the stream carries datagramandackframes from then ondatagramrelay datagram stream the spool position, the listener, the sender's address and port and the receive time; the datagram as body ackhub datagram stream the highest position of the spool the hub has committed renewrelay control a CSR certificatehub control the renewed certificate -
Deadlines. Either side closes a control connection on which it received nothing for 45 s. The relay connects again after 1 s, then after twice as long up to 10 s, each wait with up to a quarter added at random; a connection that held for 1 min starts over at 1 s. So relays are back within about 12 s of a node taking connections again. A stream connection whose first frame doesn't arrive within 10 s of its TLS handshake is closed. For a connection to a target the hub parks its side under the stream id and waits 10 s for
acceptorrefuse; the relay resolves and dials within 8 s. Anacceptof an id that is no longer parked closes its connection. A datagram stream with datagrams outstanding and no acknowledgement for 30 s is closed, and the relay opens another. -
Server names. A node of a standalone installation is reached at its
relay_addressand serves every connection as its hub's. On a managed installation, a hub's relays reach a node at itsrelay_addresswith the hub's host label before it,<host label>.<node>.relay.<hub domain>:<port>: the addresses that enrolment andwelcomegive a hub's relays are these. The TLS server name of a connection chooses its hub by its first label; the node serves it with a certificate of that hub's relay CA for that name and takes only a client certificate of the same CA, so a relay of one hub that connects under another hub's name fails its handshake, and a name of no hub is closed. One wildcard DNS record,*.relay.<hub domain>, serves every hub and node, and a TLS passthrough route per node (*.<node>.relay.<hub domain>) takes each node's connections (operations.md §12). A relay enrols on its hub's host (api/hub.yamlenrolRelay). -
Identity and versions. A relay's client certificate names the relay's id as its subject's common name and chains to the hub's relay CA (
schema/hub.sqlrelay_ca). The hub takes a connection only with the relay's current certificate, or the one before it until the relay first connects with the new one, and of a relay not revoked; it answersbyewithrelay.unknownotherwise. A revocation closes the relay's connections on every node within 5 s, each control connection afterbyewithrelay.revoked. The relay renews 30 days before expiry withrenew. The hub takes relays within four minor versions of its own, either way, and answers others withrelay.update_required; it lists such a relay with its version. -
Connections to targets. The node that dials a target through a relay (§11 Egress) picks, in turn, among the relays with a control connection to itself whose allowlist, as their
hellogave it, admits the target, and sendsconnecton that relay's control connection to it. The relay checks the target against its allowlist again, resolves a name in the DNS of its network, dials it, and opens the stream connection to the node that asked, at itsrelay_address; both sides then copy bytes until either closes. A relay that refuses gives way to the next that admits the target; the dial fails once none is left. -
TCP intake (HTTPS intake, syslog over TCP and TLS, SMTP). For each sender's connection the relay opens a stream to one of the nodes it is connected to, in turn, sends
tcpand copies bytes. The node serves the stream as its own listener of that kind serves a connection, with the sender's address forallowFrom, the rate limits andpipeline.maxConnections, and its TLS: its server certificate, which must name the relays as senders address them, andsyslog_client_ca. A relay listener may also take plain HTTP intake, which the node serves as HTTPS intake: the relay's connection encrypts it from there. The sender gets the hub's answers,202or503, SMTP250after the store or452, and retries as it does at the hub; a relay without a connection to the hub closes the sender's connection, which the sender retries too. HTTPS intake can also go to the hub directly. -
Datagrams (SNMP traps, syslog over UDP), which senders don't retry, go through the relay's spool. The relay gives each datagram the next position of its spool, writes it with its listener, sender and receive time to its spool directory, and sends it only once the write is on disk. It keeps one datagram stream open, to one of the nodes, and sends on it, in order, the spooled datagrams it hasn't sent on that stream, from the oldest. The node stores them in their order, in transactions that each lock and read the spool's high-water mark (
schema/hub.sqlrelay_spool): a position at or below the mark is a duplicate and dropped, any other is stored as an event of the Source, as if the node had received it at that listener from that sender, with the relay's receive time asspooled_at, and raises the mark. After the commit the node sendsackwith the mark, and the relay deletes what it covers. After a stream breaks, the relay opens another, to any node, and sends again from its oldest spooled datagram. So a datagram is stored once: a crash of the relay loses nothing spooled, a crash of a node nothing it acknowledged, and what arrives again is below the mark. While the hub can't store, its nodes acknowledge nothing and the spool grows; a full spool (spool_bytes) drops new datagrams and counts them. A spool's id is random, chosen when its directory is created; a new spool starts at position 1 with a mark of its own. Checked bymodels/RelaySpool.tla: no datagram leaves the spool before it is stored, none is stored twice, and each reaches the hub, across broken streams and crashes of the relay and of nodes, with a stream to another node while the old one's transaction is still to come. -
State in the hub. Every node records its control connections and the relay's last
helloandheartbeat; the hub lists each relay with its state, version, nodes, spool and last contact (api/hub.yamllistRelays), raises the relay self-alerts (pipeline.md §19) and counts in its metrics (integrations.md §11).