Skip to content

Commit 4759aed

Browse files
authored
docs: add enterprise evaluation guide (#53)
1 parent 4db114e commit 4759aed

13 files changed

Lines changed: 849 additions & 19 deletions

ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Device IDs are server-assigned via `POST /api/devices` — clients cannot choose
8282
3. Fire all webhooks in parallel via `Promise.allSettled`
8383
4. Failures logged to CF Workers Logs but don't affect the response
8484

85-
Outbound webhook requests include `X-Snare-Signature: sha256=<hmac>` when `WEBHOOK_SIGNING_SECRET` CF secret is configured. Receivers can verify alerts came from snare.sh.
85+
Outbound webhook requests include `X-Snare-Signature: sha256=<hmac>` when the Cloudflare Worker `WEBHOOK_SIGNING_SECRET` secret is configured. Receivers can verify alerts came from the configured Snare callback deployment.
8686

8787
**Supported webhook formats:** Discord (embed), Slack (attachment), Telegram (HTML), generic JSON (`event: "canary.fired"`).
8888

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Versioning: [Semantic Versioning](https://semver.org/)
1212
### Added
1313
- `snare prove --output <path>` for writing proof reports as shareable artifacts.
1414
- `snare prove --redact` for share-safe proof reports that remove device IDs, token IDs, labels, cleanup tokens, and absolute local paths.
15+
- Enterprise evaluation, self-hosting, and SIEM integration guides for security-review-friendly pilots.
16+
- `snare serve --help` for self-hosted callback server flag discovery.
1517

1618
### Changed
1719
- Proof reports now include event visibility, observed callback latency, and explicit “what this proves” / “what this does not prove” sections.

README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ snare arm --all --webhook https://discord.com/api/webhooks/YOUR/WEBHOOK
110110

111111
Supported webhook destinations: Discord, Slack, Telegram, or any endpoint that accepts JSON. Treat webhook URLs as secrets — don't commit, screenshot, or share them.
112112

113+
Evaluating Snare for a team or lab? Start with the [enterprise evaluation guide](docs/enterprise-evaluation.md), then wire alerts to your SIEM with the [webhook integration docs](docs/integrations/generic-webhook.md).
114+
113115
---
114116

115117
## Commands
@@ -258,7 +260,9 @@ Each alert includes:
258260
- User agent (identifies the exact SDK: `Boto3/1.34.46`, `kubectl/v1.35.1`, etc.)
259261
- "Likely AI agent" flag when the request comes from cloud infrastructure
260262

261-
Alerts are signed with `X-Snare-Signature` (HMAC-SHA256) so you can verify they came from snare.sh.
263+
Alerts are signed with `X-Snare-Signature` (HMAC-SHA256) when webhook signing is configured, so receivers can verify the sender.
264+
265+
See [generic webhooks](docs/integrations/generic-webhook.md), [Splunk](docs/integrations/splunk.md), [Datadog](docs/integrations/datadog.md), and [Microsoft Sentinel](docs/integrations/sentinel.md) for SIEM integration patterns.
262266

263267
---
264268

@@ -302,27 +306,29 @@ Fake credential content lives locally in `~/.snare/manifest.json` (0600) and is
302306

303307
## Self-hosting
304308

305-
The Cloudflare Worker is open source in this repo (`worker/`). Deploy it to your own account:
309+
Use self-hosting when you need a custom callback domain, full network-layer control, private retention, or SIEM relay behavior. The repo includes both the Cloudflare Worker source (`worker/`) and a standalone `snare serve` path with Docker Compose.
310+
311+
Quick standalone server:
306312

307313
```sh
308-
cd worker
309-
npx wrangler deploy
314+
SNARE_DASHBOARD_TOKEN="$(openssl rand -hex 32)" \
315+
snare serve --port 8080 --db /var/lib/snare/snare.db
310316
```
311317

312-
Set `WEBHOOK_URLS` as a Cloudflare Worker secret for alert delivery. Set `WEBHOOK_SIGNING_SECRET` to sign outbound requests.
313-
314-
To point canaries at your own server instead of snare.sh, edit `callback_base` in `~/.snare/config.json` after `snare init`.
315-
316-
`snare serve` requires `--dashboard-token` (or `SNARE_DASHBOARD_TOKEN`) to protect the dashboard. Generate one with `openssl rand -hex 32`.
317-
318-
Docker Compose can use `.env.example` as a starting point:
318+
Quick Docker Compose path:
319319

320320
```sh
321-
cp .env.example .env
322-
SNARE_DASHBOARD_TOKEN="$(openssl rand -hex 32)" docker compose up -d
321+
{
322+
echo "SNARE_DASHBOARD_TOKEN=$(openssl rand -hex 32)"
323+
echo "SNARE_PORT=8080"
324+
} > .env
325+
docker compose up -d
326+
curl -fsS http://localhost:8080/health
323327
```
324328

325-
> **Important:** Only expose `snare serve` behind a reverse proxy you control (nginx, Caddy, Cloudflare Tunnel). Never bind directly to a public interface. By default the server ignores `X-Forwarded-For` and `X-Real-IP`. If you want real client IP attribution behind a trusted proxy, set `--trusted-proxy <cidr,...>` to the proxy network(s) that are allowed to supply those headers.
329+
Only expose `snare serve` behind a reverse proxy you control. By default the server ignores `X-Forwarded-For` and `X-Real-IP`; set `--trusted-proxy <cidr,...>` only for proxy networks that are allowed to supply those headers.
330+
331+
See the [self-hosting guide](docs/self-hosting.md) for reverse proxy, backup, upgrade, Cloudflare Worker, and client `callback_base` steps.
326332

327333
---
328334

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Out of scope:
3535

3636
**Privacy guarantee:** The `/c/{token}` callback endpoint never reads, stores, or forwards request bodies. Only header-derived metadata is stored (IP, user agent, timestamp, ASN). This applies to the managed snare.sh worker. Self-hosted deployments are controlled by the operator.
3737

38+
For a team/security review checklist covering data flow, files touched, proof artifacts, SIEM routing, and cleanup, see [docs/enterprise-evaluation.md](docs/enterprise-evaluation.md).
39+
3840
**Device secret:** The CLI generates a 256-bit device secret at `~/.snare/config.json` (0600 permissions). This secret authenticates API calls to snare.sh. If compromised, run `snare rotate` immediately.
3941

4042
## Supported Versions

docs/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Snare docs
2+
3+
These docs are written for security engineers evaluating, piloting, or operating Snare beyond a single local test.
4+
5+
- [Enterprise evaluation](enterprise-evaluation.md) — data flow, files touched, safe pilot checklist, proof artifact workflow, and limitations.
6+
- [Self-hosting](self-hosting.md) — Docker Compose, `snare serve`, Cloudflare Worker deployment notes, reverse proxy guidance, backups, and upgrades.
7+
- [Generic webhooks](integrations/generic-webhook.md) — event schema, signature verification, and relay guidance.
8+
- [Splunk integration](integrations/splunk.md) — Splunk HEC relay pattern and field mapping.
9+
- [Datadog integration](integrations/datadog.md) — direct Logs intake and monitor examples.
10+
- [Microsoft Sentinel integration](integrations/sentinel.md) — Log Analytics relay pattern and KQL examples.

docs/enterprise-evaluation.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Enterprise evaluation guide
2+
3+
Snare is intentionally small: a CLI plants credential and tool-use tripwires, callbacks produce alert metadata, and the operator can prove and remove the tripwires. This guide is for security engineers who need to evaluate Snare safely before using it in a lab, developer fleet, CI environment, or AI-agent pilot.
4+
5+
## What Snare does and does not do
6+
7+
Snare detects active use of planted fake credentials and tool configurations. It is not a prompt-injection firewall, EDR, DLP tool, or policy enforcement engine.
8+
9+
Snare is useful when you want to know whether an agent, scanner, script, or human attacker tried to use a sensitive-looking local capability such as an AWS profile, SSH host, kube context, package registry, or SDK endpoint override.
10+
11+
## Recommended safe pilot
12+
13+
Start with the default precision canaries (`awsproc`, `ssh`, `k8s`). They are designed to stay quiet during normal work and fire only when the planted fake profile, host, or context is actively used.
14+
15+
```sh
16+
# 1. Preview local file changes without writing canaries.
17+
snare arm --dry-run
18+
19+
# 2. Arm precision-mode canaries and send alerts to an existing destination.
20+
snare arm --webhook https://example.com/snare-webhook
21+
22+
# 3. Confirm local state and expected quiet state.
23+
snare status
24+
snare scan
25+
snare doctor
26+
27+
# 4. Run an end-to-end test callback and verify event readability.
28+
snare doctor --test
29+
30+
# 5. Safely trigger precision canaries and write a redacted proof artifact.
31+
snare prove --run --report --redact --format json --output proof.json
32+
33+
# 6. Review recent callback evidence.
34+
snare events
35+
36+
# 7. Remove canaries and local Snare config when the pilot is done.
37+
snare disarm --purge
38+
```
39+
40+
A fresh canary showing `never fired` can be healthy. Use `snare scan`, `snare doctor`, and `snare prove` to distinguish a healthy quiet canary from a registration or readability problem.
41+
42+
## What files Snare touches
43+
44+
`snare arm` defaults to precision mode and only plants `awsproc`, `ssh`, and `k8s` canaries. `snare arm --all` expands to every canary type.
45+
46+
| Scope | Examples | Notes |
47+
|---|---|---|
48+
| Local Snare state | `~/.snare/config.json`, `~/.snare/manifest.json` | Created with restrictive permissions. Manifest records exact bytes written for safe teardown. |
49+
| Precision canaries | `~/.aws/config`, `~/.ssh/config`, `~/.kube/<name>.yaml` | Default mode. Designed to fire on active use, not passive reads. |
50+
| Package/tool canaries | `~/.npmrc`, `~/.config/pip/pip.conf`, `~/.gitconfig`, `~/.terraformrc`, `~/.docker/config.json` | Use selectively. Some package-manager canaries may fire during normal developer workflows. |
51+
| SDK/app canaries | dotenv files and vendor config files for OpenAI, Anthropic, GCP, Azure, GitHub, Stripe, Hugging Face, MCP, and generic endpoints | These depend on how the target agent or tool consumes local config. |
52+
53+
Teardown is content-matched: Snare removes the exact bytes it wrote and does not rewrite unrelated credentials in the same file. Use `snare teardown --dry-run`, `snare disarm`, or `snare disarm --purge` during evaluation cleanup.
54+
55+
## Data flow
56+
57+
### Managed `snare.sh`
58+
59+
1. The CLI creates a local device secret and registers token metadata with `snare.sh`.
60+
2. A planted canary contains a callback URL such as `https://snare.sh/c/<token>`.
61+
3. If the fake credential/tool path is used, the SDK or tool requests the callback URL.
62+
4. The callback service stores metadata and optionally forwards an alert to your webhook destination.
63+
5. The CLI reads recent events with the local device secret.
64+
65+
### What leaves the machine
66+
67+
| Flow | Data |
68+
|---|---|
69+
| Registration API | Token ID, device ID, canary type, label, webhook routing metadata. |
70+
| Events API | Token ID in the URL and bearer device secret for authenticated reads. |
71+
| Canary callback | Token ID, request path, method, IP, user agent, Cloudflare-derived geography/ASN/bot metadata when using the managed worker. |
72+
| Webhook delivery | Alert payload containing event metadata. No request body is included. |
73+
74+
Callback handlers intentionally do not read, store, or forward request bodies. This matters because some SDK callbacks can include credential material in HTTP bodies. The application-level privacy guarantee does not mean Cloudflare or other network infrastructure never handles the encrypted network request; self-host if you need full network-layer control.
75+
76+
## Proof artifact workflow
77+
78+
Use proof reports as the shareable evaluation artifact:
79+
80+
```sh
81+
snare prove --run --report --redact --format json --output proof.json
82+
```
83+
84+
A useful proof artifact should show:
85+
86+
- which precision canaries were armed;
87+
- which trigger commands were executed;
88+
- whether callbacks were visible through the events API;
89+
- observed callback timestamps and latency where available;
90+
- cleanup commands;
91+
- what the proof demonstrates;
92+
- what the proof does not demonstrate.
93+
94+
Use `--redact` before sharing outside the evaluating machine. Redaction removes raw device IDs, token IDs, labels, cleanup-token values, and local absolute paths.
95+
96+
## Webhooks and SIEMs
97+
98+
Snare can post alerts to Discord, Slack, Telegram, or generic JSON webhook endpoints. For SIEMs that require custom headers, signed requests, or vendor-specific envelope formats, put a small relay in front of the SIEM and have Snare post to the relay.
99+
100+
See:
101+
102+
- [Generic webhooks](integrations/generic-webhook.md)
103+
- [Splunk](integrations/splunk.md)
104+
- [Datadog](integrations/datadog.md)
105+
- [Microsoft Sentinel](integrations/sentinel.md)
106+
107+
## Self-hosting decision
108+
109+
Use managed `snare.sh` for a quick lab. Self-host when you need one or more of the following:
110+
111+
- all callback traffic to stay inside your network or cloud account;
112+
- a custom callback domain;
113+
- control over log retention, backup, and alert routing;
114+
- custom webhook signing or relay behavior;
115+
- evaluation in a restricted enterprise lab.
116+
117+
See [Self-hosting](self-hosting.md).
118+
119+
## Release and install verification
120+
121+
For production-like pilots, verify the release before installing broadly:
122+
123+
```sh
124+
cosign verify-blob --bundle checksums.txt.bundle checksums.txt
125+
sha256sum -c checksums.txt
126+
```
127+
128+
Then smoke-test the binary in a temporary install directory before deploying to endpoints:
129+
130+
```sh
131+
snare --version
132+
snare arm --help
133+
snare doctor --help
134+
snare prove --help
135+
```
136+
137+
## Known limitations to include in review
138+
139+
- Snare detects use of planted tripwires; it does not prevent compromise.
140+
- `~/.snare/manifest.json` records canary locations so Snare can safely remove them. A local attacker who reads it can identify bait.
141+
- Public callback domains can be fingerprinted. Use self-hosting or a custom callback domain when that matters.
142+
- Some canary types are intentionally noisier than the precision defaults and should be selected deliberately.
143+
- Managed mode depends on the availability and policy of the hosted callback service and its network provider.
144+
- Webhook URLs are secrets and should be handled like credentials.
145+
146+
## Evaluation checklist
147+
148+
- [ ] `snare arm --dry-run` output reviewed by a security engineer.
149+
- [ ] Default precision-mode canaries tested before `--all`.
150+
- [ ] `snare doctor --test` passes in the target network.
151+
- [ ] `snare prove --run --report --redact --format json --output proof.json` produces a share-safe artifact.
152+
- [ ] Alert destination tested and owned by the evaluating team.
153+
- [ ] Cleanup command verified with `snare disarm --purge` on a pilot host.
154+
- [ ] SIEM relay or direct integration documented, including secret handling.
155+
- [ ] Self-hosting decision recorded for callback privacy and custom domain requirements.

docs/integrations/datadog.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Datadog integration
2+
3+
Datadog Logs intake can accept the API key in the URL path, so Snare can send generic JSON directly. Use a relay instead if your organization forbids secrets in webhook URLs or requires request signing before ingestion.
4+
5+
## Direct Logs intake
6+
7+
Use the Datadog site that matches your account.
8+
9+
US site example:
10+
11+
```sh
12+
snare config set webhook 'https://http-intake.logs.datadoghq.com/v1/input/<DATADOG_API_KEY>?ddsource=snare&service=snare&ddtags=team:security,env:pilot'
13+
snare doctor --test
14+
```
15+
16+
EU site example:
17+
18+
```sh
19+
snare config set webhook 'https://http-intake.logs.datadoghq.eu/v1/input/<DATADOG_API_KEY>?ddsource=snare&service=snare&ddtags=team:security,env:pilot'
20+
snare doctor --test
21+
```
22+
23+
Treat the configured webhook URL as a secret because it contains the Datadog API key.
24+
25+
## Recommended facets
26+
27+
Create facets or measures from these JSON fields:
28+
29+
| Datadog facet | Snare JSON path |
30+
|---|---|
31+
| `@event` | `event` |
32+
| `@canary_type` | `canary_type` |
33+
| `@label` | `label` |
34+
| `@device_id` | `device_id` |
35+
| `@ip` | `ip` |
36+
| `@network.org` | `network.org` |
37+
| `@network.asn` | `network.asn` |
38+
| `@network.is_cloud` | `network.is_cloud` |
39+
| `@request.user_agent` | `request.user_agent` |
40+
| `@is_test` | `is_test` |
41+
42+
## Example log queries
43+
44+
Real canary fires:
45+
46+
```text
47+
service:snare @event:canary.fired @is_test:false
48+
```
49+
50+
Cloud-hosted source:
51+
52+
```text
53+
service:snare @event:canary.fired @is_test:false @network.is_cloud:true
54+
```
55+
56+
Specific canary type:
57+
58+
```text
59+
service:snare @canary_type:awsproc @is_test:false
60+
```
61+
62+
## Monitor example
63+
64+
Create a Logs monitor with query:
65+
66+
```text
67+
logs("service:snare @event:canary.fired @is_test:false").index("*").rollup("count").last("5m") > 0
68+
```
69+
70+
Notification text:
71+
72+
```text
73+
Snare canary fired.
74+
75+
Type: {{log.attributes.canary_type}}
76+
Label: {{log.attributes.label}}
77+
IP: {{log.attributes.ip}}
78+
Network: {{log.attributes.network.org}}
79+
User-Agent: {{log.attributes.request.user_agent}}
80+
```
81+
82+
## Validation
83+
84+
```sh
85+
snare doctor --test
86+
snare prove --run --report --redact --format json --output proof.json
87+
```
88+
89+
Confirm `is_test:true` appears for the doctor test and `is_test:false` appears for proof callbacks.

0 commit comments

Comments
 (0)