Asset map kit for Cloudflare: what you own, declared in code versus found live
Status: in development. Nothing here is released or deployed.
The Asset map kit keeps a picture of what you have on Cloudflare: zones, hostnames, Workers, routes and Access applications, and how they connect. It only reads your Cloudflare account; its writes are to its own database.
Purpose
When a signal names a hostname, the useful next question is what it belongs to and what depends on it. The Asset map answers that. It also compares what you declared in code with what is live, and raises a finding for anything that exists but is not declared, or has drifted. Every asset has an id of the form cf:kind:name, one grammar shared by all kits. A source that fails to read never causes a deletion: the previous picture is kept.
What it deploys on Cloudflare
- A Worker, declared in Alchemy's plain-module form (see How kits join), with a scheduled sync every fifteen minutes.
- A D1 database for the graph, findings and an audit trail that refuses edits and deletes.
- A read-only Cloudflare API token, used to read zones, DNS records, Worker scripts, routes, custom domains, Access applications and policies, service tokens (names and expiry), WAF rulesets, Logpush jobs (never their destinations), certificate packs and, with an account-level token, API tokens (names and expiry). A family the token may not read is skipped with a note.
Sources are pluggable. The first two are a JSON file of what you declare and a Cloudflare source. The sync also raises findings: a reachable hostname with no Access application, an Access policy that is open to everyone, a token or certificate that expires within 30 days, and a zone with no WAF ruleset.
Capability entrypoint
AssetRead is a read-only door for a peer Worker. Its methods are asset, byHostname, downstream (what breaks if it fails), upstream (what it needs) and find. Every asset has an access level, and by default it is owner-only. A caller reads up to a ceiling you set in configuration, and anything above it is simply absent from the answer. With no ceiling set, every call is refused. The default entrypoint has none of these methods.
HTTP routes
Behind Cloudflare Access apart from health. The scheduled sync is not an HTTP route.
GET /health.GET /v1/findings, the open findings.POST /v1/findings/{id}/ignorewith a reason, which a person can use to set one finding aside until its evidence changes.GET /v1/findings/{id}/adopt, which returns a draft row for your own manifest and writes nothing.
Until you set the Access team domain and application audience, every /v1 route answers 503. There is no route that writes to your Cloudflare account and no operator capability.
How a person approves things
There is nothing to approve: the kit changes nothing in your account. The only write is a person ignoring a finding, which a service token cannot do and which is recorded against the verified person. Declaring an asset is a change to a file in the kit's repository, which goes through review.
Stop switches
The Asset map has no stop switch. It only reads, with a read-only token. Leaving the token unset leaves the Cloudflare source unconfigured, and the kit keeps the last picture.
Peers
Optional. Enrichment can look up an asset by hostname if you bind it to AssetRead. Without the Asset map, Enrichment skips the asset layer and says so in the case.