Catalogue / github-2022-activerecord-column-encryption

GitHub migrates plaintext and legacy-encrypted Rails columns to ActiveRecord::Encryption with per-model previous encryptors and inverted flags

GitHub. Rails ActiveRecord column encryption migration.

Organisation
GitHub
Evidence
Reported from production
Source
How GitHub converts previously encrypted and unencrypted columns to ActiveRecord encrypted columns

The GitHub Blog, published 2022-11-03

Records

Decision#d1

Scope plaintext fallback per model with a validated previous encryptor instead of global support_unencrypted_data

Decision#d2

Use an inverted binary feature flag in a custom ActiveRecord type instead of gradual percentage rollout

Failure#f1

Inherited string comparison in custom encrypted type caused false 2FA recovery-code audit alerts during rollout

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free.