You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share AES-GCM sealing of a secret at rest (low priority; two copies) #152
Two places seal a secret with AES-256-GCM, each with its own key handling, and a third use is plausible. This is a low-priority candidate: the two copies differ enough that extraction should wait for a decision about key handling. It comes from dioad/eventbroker#108 (candidate X6, row E14 and decision D5).
What exists today
auth/http/browsersession/crypto.go: newGCM(key), encrypt (seal and base64url encode) for cookies, with a fixed keySize of AES-256.
eventbroker/pkg/webhook/storage_encryption.go: secretCipher wrapping cipher.AEAD, built once from a 64-hex-character key read from EVENTBROKER_WEBHOOK_SECRET_KEY, used to encrypt webhook secrets at rest. When the variable is unset it returns (nil, nil) and secrets are stored in plaintext with a startup warning.
Proposal (when picked up)
A small seal helper with New(key), Seal, Open, and a versioned envelope so a key can be rotated, and a clear policy for a missing key (fail closed by default, with an explicit opt-out), which is decision D5 in #108. Home: dioad/auth or dioad/util.
Why not now
The two copies solve different problems (a cookie value versus a database column), and the right envelope depends on whether rotation is needed. Revisit when eventbroker settles D5, or when a third use appears.
Activity