gstack/supabase
Garry Tan a5588ec061
feat(supabase): schema migration for attack_attempt telemetry fields
Extends telemetry_events with five nullable columns:
  * security_url_domain   (hostname only, never path/query)
  * security_payload_hash (salted SHA-256 hex)
  * security_confidence   (numeric 0..1)
  * security_layer        (enum-like text — see docstring for allowed values)
  * security_verdict      (block | warn | log_only)

Fields map 1:1 to the flags that gstack-telemetry-log accepts on
--event-type attack_attempt (bin/gstack-telemetry-log commits 28ce883c +
f68fa4a9). All nullable so existing skill_run inserts keep working.

Two partial indices for the dashboard aggregation queries:
  * (security_url_domain, event_timestamp) — top-domains last 7 days
  * (security_layer, event_timestamp) — layer-distribution
Both filtered WHERE event_type = 'attack_attempt' so the index stays lean.

RLS policies (anon_insert, anon_select) from 001_telemetry already
cover the new columns — no RLS changes needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 04:58:08 +08:00
..
functions fix: security wave 1 — 14 fixes for audit #783 (v0.15.7.0) (#810) 2026-04-04 22:12:04 -07:00
migrations feat(supabase): schema migration for attack_attempt telemetry fields 2026-04-20 04:58:08 +08:00
config.sh fix: Supabase telemetry security lockdown (v0.11.16.0) (#460) 2026-03-24 15:01:31 -07:00
verify-rls.sh fix: verify-rls.sh matches deployed policy (inserts allowed, HTTP parsing) (#461) 2026-03-24 15:10:50 -07:00