analytics — boundary record and attestations
Analytics ingestion service (their apps/analytics): the SDK posts event
batches, the service forwards them to PostHog Cloud (US) and nothing is
stored in-cluster. The hostname is a public-intake class member on
cf-public (ADR-0005 §15) — anonymous by the tenant's service contract
(OME-1175: no embedded SDK secret, CAPTCHA or login on the endpoint), so the
platform's controls are the edge's, not the app's. On dev the service also
runs the tenant's Colab consent bridge under /bridge (OME-1379; see
Colab consent bridge); staging runs it too since 2026-10-23.
| Hostname | Class | Edge auth |
|---|---|---|
analytics.dev.screamingface.ai |
public-intake (§15) | none — no Access application; POST /v1/events has no in-app gate; in-app, every /bridge POST checks the Origin header, and the ID and event calls also need the consent cookie |
analytics.staging.screamingface.ai |
public-intake (§15 staging step) | none — no Access application; POST /v1/events has no in-app gate; the bridge POSTs check the Origin header (https://analytics.staging.screamingface.ai), and the ID and event calls also need the consent cookie |
analytics.screamingface.ai |
public-intake (§15, production by owner decision 2026-10-23) | none — no Access application; POST /v1/events has no in-app gate; the bridge POSTs check the Origin header (https://analytics.screamingface.ai), and the ID and event calls also need the consent cookie |
Environments (2026-10-23): dev (the public door above, on cf-public); staging workload since #973, and since 2026-10-23 the route kubernetes/tenants/screamingface/routes/staging/analytics.yaml on the staging cf-public (POST /v1/events and the /bridge prefix, GET and POST, the baseline budget in Limits): public since the owner added its row on the public tunnel sf-public-staging the same day (see Staging attestations); production since #1280 and #1462 (2026-10-03, after the owner's production PostHog project token), and public since 2026-10-23 by owner decision (routes/prod/analytics.yaml: the staging shape and limits, the bridge on; the rest of the ADR-0005 §15 ladder follows after go-live).
Platform half: kubernetes/apps/sf-analytics-platform/ (namespace, quota,
netpols — ingress from the cf-public fleet only, egress to PostHog on 443
with private space excluded — and the PostHog token ExternalSecret); edge:
the route declaration kubernetes/tenants/screamingface/routes/dev/analytics.yaml
(one HTTPRoute on cf-public: /v1/events exactly and the /bridge
prefix, methods GET and POST, 5s timeout,
CF-Connecting-IP and X-User-Email stripped toward the backend, no
SecurityPolicy, no budget rendered — rendered by the tenant-edge chart,
ADR-0005 §14/§15), reached through the tenant's public tunnel
sf-public-dev (connector cloudflared-public in sf-edge). Workload:
tenants-charts ticket kubernetes/tenants/screamingface/charts/analytics.yaml
+ values kubernetes/apps/sf-analytics/values/dev.yaml (chart and image
pinned to one upstream commit; the chart stamps a bare app: label, which
every selector in the netpols keys on).
Colab consent bridge
The tenant's service-side bridge (ScreamingFace/screamingface #1072 and
1073) lets a Colab notebook ask for analytics consent and keep one anonymous
browser ID across runtimes, notebooks and browser restarts. It is on for dev
(OME-1379) and, by owner decision 2026-10-23, for staging; production follows
with the production route. The facts below are written for dev; on staging
the hostname is analytics.staging.screamingface.ai, the settings are in
kubernetes/apps/sf-analytics/values/staging.yaml, and the staging cf-public
access log drops query strings in
kubernetes/infrastructure/pulse-edge/overlays/staging. The Colab SDK adapter that will call it is a separate tenant
change; until then, a bridge test notebook drives it.
Why /bridge answered 404 before OME-1379. The image was not the cause:
the dev pin of 2026-10-12 (main-4ca2ee3c…) already contained the bridge.
Two platform-owned settings blocked it. The route matched only
POST /v1/events, so Envoy answered every /bridge request with an empty
404 (route_not_found, flag NR). And the chart default
analytics.bridge.enabled: false reached the pod as
ANALYTICS_BRIDGE_ENABLED=false, so the app had no /bridge routes either.
What is exposed, all anonymous, under https://analytics.dev.screamingface.ai:
| Method | Path | What the service does |
|---|---|---|
| GET | /bridge/consent |
The iframe page. With ?parent_origin=<Colab output origin> its frame-ancestors is that validated origin plus https://colab.research.google.com; with no query it is 'none'; any other query answers 400. |
| GET | /bridge/script.js |
The iframe's script. |
| GET | /bridge/consent/state |
The consent choice and version. Creates no ID. |
| POST | /bridge/consent |
Stores accepted or declined in a cookie. A decline expires the ID cookie. |
| POST | /bridge/id |
Returns the browser ID and creates it on the first call. Needs accepted consent. |
| POST | /bridge/id/revoke |
Expires the ID cookie. Needs declined consent. |
| POST | /bridge/id/events |
Forwards an event batch to PostHog through the same adapter as /v1/events. Needs both cookies, and every event must carry the cookie's ID. |
The POSTs answer 403 to any Origin other than
https://analytics.dev.screamingface.ai and to any Sec-Fetch-Site other
than same-origin. No CORS is enabled. The cookies are
__Secure-sf_bridge_consent (path /bridge) and __Secure-sf_bridge_id
(path /bridge/id): Secure; HttpOnly; SameSite=None; Partitioned,
host-only, 180 days (the chart default).
Settings (analytics.bridge in kubernetes/apps/sf-analytics/values/dev.yaml):
enabled: true, colabEnabled: true,
origin: https://analytics.dev.screamingface.ai, and empty parentOrigins
and ancestorOrigins (the Colab profile replaces per-notebook lists). They
render as ANALYTICS_BRIDGE_ENABLED=true, ANALYTICS_BRIDGE_COLAB_ENABLED=true
and ANALYTICS_BRIDGE_ORIGIN=https://analytics.dev.screamingface.ai. The
PostHog settings and the dev project token are unchanged; the bridge needs no
new key.
Edge facts for the bridge:
- No login. No Access application covers the hostname (row 1 below), so
the
/bridgepaths need no Cloudflare login. The Gatus row "Analytics Colab bridge" (an anonymousGET /bridge/consent/statemust answer 200 withchoice: unknown) turns red if an Access application covers/bridge, the route loses its/bridgerule, or the bridge is switched off. - Response headers pass unchanged. The route changes request headers
only. Envoy and the tunnel do not change
Set-Cookie,Content-Security-PolicyorCache-Control. - No caching. The app sends
Cache-Control: no-storeon every bridge response, and Cloudflare does not cache ano-storeresponse. This matters for/bridge/script.js: Cloudflare caches.jspaths by default. Check: twocurl -sI https://analytics.dev.screamingface.ai/bridge/script.jscalls both showcache-control: no-storeand acf-cache-statusother thanHIT. Before OME-1379, Cloudflare addedcache-control: max-age=14400to that path's 404, so a browser that fetched it then can keep the 404 for up to four hours: test in a fresh browser profile, or clear the cache. - Logs. The dev
cf-publicaccess log records the path without its query string (%REQ_WITHOUT_QUERY, the patch inkubernetes/infrastructure/pulse-edge/overlays/dev), and no field recordsCookie, a body or the client address. The service writes no access log (uvicornaccess_log=False). The zone is on the Cloudflare Free plan, which has no raw request log export; the dashboard's security events can still show the path and query of a request that a security feature acted on. - Limits. No edge budget on dev (owner decision 2026-09-22; row 6). In
the app, event calls (
/v1/eventsand/bridge/id/events) share one global bucket of 120 per minute and 16 in flight. The bridge's POST consent and ID calls get a second bucket of the same size, so opt-out still works while events are refused. The three GETs have no in-app bound. Bodies are read as a stream and refused with 413 above 64 KiB (events) or 1 KiB (consent and ID calls). Cloudflare Free refuses bodies above 100 MB.
Acceptance (OME-1379), done by a person in a browser, not by CI. Use a bridge test notebook in Colab, on Chrome and on Safari:
- No login and no privacy-setting change is needed.
- Consent checks create no analytics ID and send no events before opt-in.
- Consent and the same anonymous ID persist across fresh runtimes, different notebooks and browser restarts, in the same browser profile and cookie partition.
- Opt-out stops event forwarding and clears the ID.
- Consented events reach the dev PostHog project.
Record the result here, with its date and both browser versions: Safari's
support for Partitioned cookies has changed between releases. The owner
put the bridge on staging on 2026-10-23 before this acceptance passed; run
the same five checks on staging, with the staging PostHog project in step 5.
Production needs its own values, route and edge change.
Where settings live, and how changes reach dev
| What | Where it lives | How a change reaches dev |
|---|---|---|
| Service code, chart templates and chart defaults | ScreamingFace/screamingface, apps/analytics/ |
Automatic. A merge to the tenant's main that changes the app builds screamingface-analytics:main-<sha>, and the tenant's CI pushes it to ACR acropenmined. Kargo stage dev-analytics (project sf-kargo) runs task pin-dev: it sets image.tag in the values file and chartRef in the ticket to that commit, renders the chart with our values (a failed render stops the promotion), then opens and merges a pin(analytics) pull request here. Argo CD syncs it. |
Environment settings: every analytics.* value, analytics.bridge included |
This repository: kubernetes/apps/sf-analytics/values/dev.yaml |
A pull request here. Argo CD syncs it after merge, and the Deployment rolls with the new environment. Kargo changes no key in this file except image.tag. |
| Edge: hostname, paths, methods, header strips, budget | This repository: kubernetes/tenants/screamingface/routes/dev/analytics.yaml |
A pull request here. Platform-owned (ADR-0005 §14). A new anonymous path or method is an edge-auth change, so the platform owner approves it first. |
| PostHog project token | The dev Key Vault, delivered as ExternalSecret analytics-posthog (record name in docs/runbooks/secret-rotation.md, "PostHog project tokens") |
A vault write by the owner. ESO refreshes hourly; restart the Deployment so the pod reads the new value. |
| Cloudflare: DNS, tunnel route, Access, zone settings | ScreamingFace's Cloudflare account | By hand, by the owner (docs/runbooks/move-hostname-between-tunnels.md). |
Nothing reads a values file in the tenant repository: a values-dev.yaml
there is not used, and it is not a deployment prerequisite. The chart's
ingress template is off (ingress.enabled: false), and the tenant fence
rejects chart-rendered edge objects, so a route change in the chart does
nothing here. A new chart value takes its chart default on dev until the
values file here sets it. The order for a new setting is: the tenant merges
the chart change (the pin follows by itself), then a pull request here sets
the value.
Attestation record (the hostname's boundary artifact)
The hostname has no AUD, so its recorded boundary is this dated attestation
set — facts that live in the tenant's Cloudflare dashboard and cannot be
verified from git. Behavioral verification: the Gatus "Analytics public
posture" row (an empty anonymous POST answers 400/415/422 from the app, no
redirect) watches the fact that can drift silently — an Access application
creeping back — the Gatus "Analytics Colab bridge" row does the same for
/bridge (where a path-scoped Access application would not touch the POST
probe), and the delivery-503 alert spec
(observability/alerts/analytics-delivery-503.md) watches the failure that
liveness cannot see.
Re-attestation triggers: Cloudflare plan change · tunnel change · any Access application change on the zone · any abuse incident on the hostname · the "Remove visitor IP headers" transform touched.
| # | Fact | Status | Attested by | Date |
|---|---|---|---|---|
| 1 | NO Access application covers analytics.dev.screamingface.ai. Today the hostname is a member of the shared dev Access application (its user-tier past, #958); the owner removes it LAST in the move order, after the CNAME switch, so the Gatus 302 flips at a known moment. "No app", not a Bypass policy (Bypass is origin-identical but unlogged). |
PENDING — owner removes the hostname from the shared dev app | — | — |
| 2 | Tunnel route on sf-public-dev → cf-public-internal.envoy-gateway-system.svc.cluster.local:80 (added through the API, never a dashboard route on a hostname whose record exists), and the proxied CNAME targets the NEW tunnel's cfargotunnel.com name; the rule on the old tunnel removed through the API. |
PENDING — owner's Cloudflare move (§15 transition order) | — | — |
| 3 | Zone plan: Free — a host- or method-scoped edge rate rule is not expressible (one path-only rule, 10s window, is the zone's whole budget); the per-caller control is the platform's rateBudget on cf-public. |
PENDING — re-attest with the move (attested for the zone on 2026-08-31, report-intake row 4) | — | — |
| 4 | Bot Fight Mode status (zone-wide, unscopable on Free; challenges BEFORE our edge and before the app). Decision at the first SDK acceptance test, together with Pseudo IPv4; no remedy pre-committed (ADR-0005 §13 risk 3, §15). The forbidden lever: never toggled mid-incident. | PENDING — decision at the first SDK test | — | — |
| 5 | The zone's "Remove visitor IP headers" managed transform is OFF. REQUIRED: cf-public detects the client address from CF-Connecting-IP with failClosed: true, so with the transform on every request to every public-intake hostname answers 403 at Envoy — indistinguishable from an app 403 on reports (recorded proof gap). |
PENDING — attest with the move; re-attest on every tunnel change | — | — |
| 6 | No per-IP budget set: rateBudget is {null, none, null} on dev, so no BackendTrafficPolicy renders and the only bound is the service's in-process global bucket (owner decision 2026-09-22: the dev users are known; numbers are a production-ladder item from two weeks of staging 2xx/429 data). |
ATTESTED (from git) | platform | 2026-09-23 |
Staging attestations
The staging hostname analytics.staging.screamingface.ai is new: it had no
DNS record before its route. The owner creates the tunnel row and the DNS
record together, with the public-hostname form on tunnel sf-public-staging
(subdomain
analytics.staging, domain screamingface.ai, service HTTP
cf-public-internal.envoy-gateway-system.svc.cluster.local:80). Do not use
the authenticated staging tunnel: there the hostname gets 404 from
cf-protected, which has no route for it. The Gatus row "Analytics public
posture (staging)" stays red until the row exists. The re-attestation
triggers above apply.
| # | Fact | Status | Attested by | Date |
|---|---|---|---|---|
| 1 | NO Access application covers analytics.staging.screamingface.ai, and no wildcard destination (for example *.staging.screamingface.ai) reaches it. No Bypass policy. |
ATTESTED | owner | 2026-10-23 |
| 2 | Before the route: no DNS record for the hostname (outside check 2026-10-22: no A or CNAME record). After: the hostname's row on sf-public-staging names http://cf-public-internal.envoy-gateway-system.svc.cluster.local:80, and the proxied CNAME names that tunnel's cfargotunnel.com name. Verified 2026-10-23: both cloudflared-public pods loaded configuration version 2 with the hostname, and the authenticated connectors have no analytics row. |
ATTESTED (owner's row) and verified | owner, platform | 2026-10-23 |
| 3 | Zone plan: Free (row 3 above). Not re-checked on 2026-10-23; the zone attestation of 2026-08-31 (report-intake row 4) stands. | CARRIED | — | 2026-08-31 |
| 4 | Bot Fight Mode status, recorded and not changed (row 4 above: decided at the first SDK acceptance test). The owner could not find the setting on 2026-10-23. The last recorded status is ON (report-intake row 5, 2026-08-31). Anonymous curl and Gatus requests from Azure pass today, so it does not challenge them; an SDK caller from another network can still be challenged. |
PENDING — owner reads the zone's Security settings | — | — |
| 5 | The zone's "Remove visitor IP headers" managed transform is OFF (row 5 above). The staging leaderboard reads through cf-public prove it today: with the transform on they would get 403 at Envoy. Proven again on 2026-10-23: an anonymous POST /v1/events on this hostname reached the app (422 invalid_payload) through cf-public, which detects the client address from CF-Connecting-IP with failClosed: true. |
EMPIRICAL | platform | 2026-10-23 |
| 6 | The baseline budget (owner decision 2026-10-23, replacing "no numbers on staging"): 120 a minute per client address and 1200 for the route, rendered as one BackendTrafficPolicy on cf-public keyed on CF-Connecting-IP; the app bucket is 1200 (see Limits). |
ATTESTED (from git) | platform | 2026-10-23 |
Outside-in check, 2026-10-23 (after the owner's row): an empty POST
/v1/events got 422 invalid_payload from the app, with no redirect;
GET /bridge/consent/state got 200 with choice: unknown; GET /v1/events
got 405 from the app; /, /healthz and /readyz got 404 at Envoy;
/bridge/script.js came back cache-control: no-store, cf-cache-status:
BYPASS. The staging cf-public fleet logged each request, with paths
recorded without query strings.
Production hostname
analytics.screamingface.ai is public since 2026-10-23, by owner decision,
before the rest of the ADR-0005 §15 production ladder. The owner added its
row on the production public tunnel sf-public-prod (both
cloudflared-public pods loaded it; the authenticated connectors have no
analytics row) and attested that no Access application covers it. The
route has the staging shape and limits (see Limits), the bridge
is on with origin https://analytics.screamingface.ai, and the production
cf-public access log drops query strings.
Still to follow after go-live: production logs and paging (the staging log alerts exist), the staging shut-off drill, the strip and spoof proofs on the production proxy, and the tenant's SDK test (back-off on both 429 forms, the bridge acceptance, Bot Fight Mode).
Open items
- SDK 429 back-off (tenant): when budgets are set, Envoy Gateway answers
429 with
x-ratelimit-*headers and NORetry-After(v1.5.0), while the tenant contract expects a boundedRetry-Afterfrom the service. The SDK must back off on either shape; the tenant verifies it (ADR-0005 §15 ladder item 11). No SDK caller exists yet on the tenant'smain, which is why this hostname was not dual-homed for its move. - Pseudo IPv4 with the Bot Fight Mode decision (row 4): per-IP budget
keys are
/128for IPv6, so the route ceiling is the IPv6 flood control; whether Cloudflare's Pseudo IPv4 should present v6 callers as v4 addresses is decided at the first SDK acceptance test, never mid-incident. - The move itself: after this change merges the hostname answers 404
through the OLD tunnel (dual-homing is off, so
cf-protectedcarries no route for it) until the owner's CNAME switch, and 302 from Access until the Access-app removal. Rollback is the reverse: CNAME back, hostname back in the shared dev app, revert the declaration.