The concept: one record shape, a trust ladder and optional joins, for Cloudflare
Three ideas hold edge-response together: everything is stored as one kind of record, each zone is given a level of trust that limits automation, and kits meet only through shared shapes so that any of them can be used alone.
The record envelope
Whatever the source, a stored event is one row in the same shape, called the record envelope. A firewall event, a webhook from a third party and an audit log entry all become the same kind of row, with a flexible detail column for what is specific to the source.
The envelope carries these things:
| Field group | What it holds |
|---|---|
| When | The time the event happened, and the time it was received |
| Where from | A source id you declared, and a record id that makes the row unique |
| What kind | A category from a closed list, a severity (0 to 7, as in syslog) and an outcome of success, failure or unknown |
| Who and what | The actor, source and destination addresses and ports, the host, the Cloudflare account and zone, and an asset id |
| Context | Tags, entity ids, a short message and a flexible detail column |
| Original | The raw text of the event, capped at 8 KB, with secrets removed |
The categories are http, firewall, dns, access, audit, network, identity, app, security-finding and ops. Each source declares which categories it may write, and the front door refuses anything else. A sender cannot choose its own category.
There is one shape because Cloudflare's data platform, Basin, fixes a stream's columns when it is created and allows 20 streams per account. edge-response therefore uses two streams for everything: records for accepted events and rejects for events it refused, with the reasons.
The zone treatment ladder
A zone is one domain on your Cloudflare account. Each zone, and the system as a whole, is held to one of four treatments, from least to most automation:
| Treatment | What may happen |
|---|---|
store-only |
Events are stored and nothing else. No rule looks at them. This is the default. |
detect |
Rules and hunts run and may raise signals. Nothing changes in Cloudflare. |
enforce-log |
The Respond kit may write a rule in log mode, which records what it would have blocked. |
enforce-block |
The Respond kit may write a rule in block mode. |
The ladder is ordered, and the lower of two levels always wins. In the first release a person approves every block, even in a zone set to enforce-block. Read the admission matrix guide for how a level is set and changed.
How kits join through contracts
The kits do not call each other's code. They meet through Contracts, a shared package that defines the record, the signal that a rule raises, the case that enrichment opens, the action request that Respond accepts, and the asset id grammar. A join is a queue or a service binding to a named capability, and it carries one of those shapes.
| From and to | How | What crosses |
|---|---|---|
| Ingest to Detect | A Queue edge-response-records-tap |
Batches of records |
| Detect to Enrichment | A queue edge-response-signals |
A signal |
| Respond to Detect | A service binding to AdmissionRead |
The effective level of a zone |
| Enrichment to Asset map | A service binding to AssetRead |
Asset lookups by hostname |
| Enrichment to Respond | A service binding to RespondPropose |
A proposal, never a Cloudflare call |
A queue is created by the stack of the kit that reads from it: Detect's stack creates edge-response-records-tap, and Enrichment's stack creates edge-response-signals and its dead-letter queue edge-response-signals-dead. The kit that writes to a queue only looks it up by name, so the reading kit is deployed first. The Ingest side is switched on with EDGE_RESPONSE_RECORDS_TAP=1 and the Detect side with EDGE_RESPONSE_SIGNALS_QUEUE=1.
A service binding is Cloudflare's way of letting one Worker call another directly, without going over the public internet. The binding names a capability entrypoint of the called kit, and that name is the grant. How kits join explains it.
Every peer is optional
A kit works with every peer absent. Without Detect, Ingest simply stores. Without Enrichment, Detect records signals in its own database. Without Detect, Respond reads a static list of zones and their treatments from its own configuration, and nothing can raise a level except a change there. A join is switched on in a kit's configuration and is off by default, so you adopt one kit, test it, and add the next when you are ready.
Only Respond can change your Cloudflare account. The other kits hold read-only access or no Cloudflare credentials at all, and the assistants in the Enrichment kit hold no write credential.