Files
ARTEX/db/migrations
BaaRai 2613c50363 feat(db): store capture-proxy rewrite rules, sealed at rest
Migration 0005 creates traffic_rewrite_rules. The matchers and actions
columns are two JSON secret columns of db/secrets.go: InitSecrets, which runs
after the migrations, checks the key against them and encrypts any plaintext
row, as it does for the existing columns.

The CRUD lists rules in execution order and enforces 100 rules, 50 of them
enabled, under a table lock so concurrent writers cannot pass a limit.
UpdateTrafficRewriteRule hands the stored rule to an edit callback inside the
transaction, which is where a caller keeps a value it was not sent.

InitSecrets also derives the sub-key that fingerprints sensitive values in
the rewrite trace (HMAC-SHA256 of "artex-traffic-trace" under the secret key).
2026-11-17 00:12:09 +01:00
..