← MRM/Projects/cf-traffic
Threat Intel / Telemetry Live · collecting hourly Rust · Cloudflare Workers

cf-traffic

Attack telemetry from my own edge — and a monitor built to catch itself lying about being alive.

Seven Cloudflare zones, every inbound request classified by attack family and appended to a permanent corpus. Cloudflare's free analytics serves a 24-hour window and refuses to backfill, so a run that does not happen is permanent loss — which means collection has to survive my laptop being off, and the health check has to be harder to fool than the collector. Most of the code is not the collector. It is the machinery that decides whether the collector is telling the truth.

cf-traffic — sync
$ cf-traffic sync ✔ /coverage · 7 zones · collector firing · gaps [] ✔ pulled 392 key(s) · window snapped to a whole-run boundary ✔ corpus +3,961 hits / +1,460 blocked · deduplicated on read ✕ transport lag — the pull frontier is behind the collector's frontier a healthy collector is not a healthy corpus · exit 1, unit marked failed

Representative output — not a live instance.

What it does
●Collects off my machine — a Worker on an hourly cron writes fresh, unique keys per run and never reads a key back to update it, so two runs cannot collide. An always-on box pulls the raw rows, classifies them locally and appends. Raw storage in the Worker, judgement in tested Rust, so changing my mind about an attack family never means re-running history.
●Records everything, tags the hostile — allowed and blocked traffic go to separate files on purpose. A block log is only a census of what your rules already understand; the interesting traffic is the traffic nothing matched.
●Ranks what matched nothing — a signature engine can never flag a novel technique, because "novel" means "matches no signature". That bucket was 44% of the corpus. So the tool does not match, it ranks by strangeness, and a human reads the strangest 25 instead of 6,000. Day one it found five real gaps in my own classifier, including a double-encoded traversal that walked straight past a single decode pass.
●Refuses to call anything new — three verdicts, one promotes: explained by a public template corpus or by my own signature corpus, not measured because a corpus failed to load, or unexplained because both checks ran and both came back empty. "We could not check" and "we checked and found nothing" produce identical empty results, and conflating them is how a catalogued evasion gets sold as a zero-day. If a corpus is missing, the run errors out and writes nothing.
●Ships the technique, never the target — a generically described technique discloses nothing about anyone's program; the instance would. The two halves are separate values written by separate functions, so a leak is structurally impossible rather than merely avoided, and a test greps the rendered public file for every instance field.
●Exports only what asked for an attack — my own edge rules catch readers and crawlers too: 4,016 of 7,141 raw events fired nothing but an identity rule. A source is exported only if what it requested classifies as an attack. 512 addresses in, 268 out, 244 withheld, zero leaks on an independent check.
What it caught in itself
●44.2 hours dark, every check green — the cron stopped firing and nobody knew for 44.2 hours. Coverage answered gaps: []. Health answered ok: true. The hourly sync printed "no gaps" once an hour for two days. A detector that compares runs to each other can never see the gap that is still open: a dead collector writes no new record, so the dead period sits past the end of the array and the loop walks right past it. It now judges the newest run against the clock.
●A run that fires and collects nothing looked like a success — the error path wrote a record too, and a fresh record closes an open gap exactly as a good one does. Reproduced: 720 hours of total failure still reported no gaps and no data loss. Staleness is now measured over productive runs, and "last run with data" and "last attempt" are reported separately — when they diverge, the cron is alive and collection is broken, a state the old answer could not express.
●15 hours frozen across 16 successful syncs — one endpoint served the oldest 400 keys while another read the newest. Two truncations of the same number in opposite directions, biased toward flattering the monitor. Sixteen consecutive syncs exited success after re-downloading the identical 62 MB, and nothing went amber. Every guard interrogated the collector's own arithmetic, and the collector was genuinely healthy. A monitor pointed only at its input cannot see its own output die.
●A fully green test suite that had pinned the bug as the spec — my own test asserted which zones get severed at the window edge. That made the data loss the expected result, so an all-green run shipped a paging walk that dropped keys at every seam. When you write a test against observed behaviour, check that you are asserting what should happen and not what does. An oracle that encodes the defect can never fail on it.
●The fix would have detonated a second bug — unfreezing 15 hours would have appended roughly 34,000 duplicate lines, because the deduplication set was read from disk once and never inserted into. It had already fired once and left a scar I can still count on disk: 902 duplicate lines in one file, 1,068 in the other. Deduplication now happens on read as well as write, and both paths share one rule by delegation rather than imitation.
●A 404 page that nearly became a false breach report — a request for an SSH private key answered 200 on one of my own hosts, 21 times across five hosts, and ranked near the top of the report. I fetched it: 33 KB of HTML, the platform's 404 page served with status 200. Seven of nine baselined hosts do that, so on them a 200 means nothing. Each host is now probed with a nonsense path and the 200 signal is withheld where it proves nothing. Demonstrating use rather than reporting presence is the whole reason that got caught.
●Three more defects, introduced by the fixes themselves — all three caught by an adversarial review pass over my own work rather than by me writing it, and one piece of hardening shipped carrying the exact bug it existed to prevent. The fix for a silent monitor is the code least likely to be exercised before it matters, which is precisely why it gets reviewed hardest.
●Every guard is proven to fire before it is trusted — three failure modes proven to exit 1, and two negative controls proven to exit 0, one of them an old, closed, permanent gap. A historical hole must not fail the unit forever or the signal becomes noise: ramping the cadence once retroactively reclassified two weeks of healthy history as 69 gaps and buried the single real outage behind 68 phantoms. Alarm fatigue lands in exactly the same place as silence.
Proof
0
Rust tests green · clippy -D warnings clean
0
Node tests over the collector's pure logic
0
zones collected hourly, off my machine
0
leaks in the export · 244 sources withheld
44%
of the corpus matched no signature at all
3 / 2
failure modes proven to fail · controls proven not to
Rust (zero runtime dependencies)Cloudflare Workers · KVCloudflare GraphQL analyticssystemd timers · ARM64Node test runnerno database, append-only corpus
ℹ
What this is, and what it isn't. The sensor network is small — 512 addresses over 16 days from one operator, where a commercial feed runs thousands of sensors. I tell buyers that the raw address list is the least valuable part of it. What is actually differentiated is the cross-zone correlation, which owning several unrelated domains makes computable, and the research write-ups. Attribution is always recorded as claimed: a user agent is chosen by the client. "Coordinated" is never written as "botnet" — distinct addresses sending one payload proves coordination, not common ownership.
🔒
No visitor data ships, ever. A blocked request is not an attacker — my own rules catch readers and crawlers, and the sites this runs on are sold on a promise of no tracking. A source exports only if what it asked for classified as an attack, enforced in code and re-checked by a test that greps the rendered files. Source and corpus are private — this is a capability showcase, not a distribution.

Is your monitor
actually watching?

A dashboard that is green because nothing is reporting looks exactly like a dashboard that is green because everything is fine. I build the measurement that can tell those two apart, and I prove every guard fires before I trust it. Tell me what you think you are watching.

Start a project →