- CLI (
cmd/snare,internal/) — single static Go binary, no runtime dependencies - Cloudflare Worker (
worker/) — callback receiver, KV event storage, webhook delivery - snare serve (
internal/serve/) — self-hosted alternative to the Worker
Plant flow
- Render bait content (dry-run, no disk write)
- Write manifest record with status=“pending”
- Write bait to disk (O_EXCL for new files, O_APPEND for existing)
- Register token with snare.sh
- Activate manifest record
Teardown flow
- Find canary in manifest
- Read current file from disk
- Verify content hash matches planted content
- Remove exact bytes Snare wrote (atomic rename for append-mode)
- Revoke token registration
- Mark canary inactive in manifest