Encryption and crypto-shredding
Personal data (PII) is encrypted at field level with envelope encryption (pkg/cryptox):
- each subject (Keycloak user ID, later external person ID) gets its own random data encryption key (DEK), AES-GCM;
- the DEK is stored wrapped by the key encryption key (KEK) in the
data_keyscollection of the service database, together with the KEK fingerprint (rotation); - the KEK comes from OpenStack Barbican in production (
CRYPTO_KEK_SOURCE=barbican) or from theCRYPTO_KEKenv var locally (CRYPTO_KEK_SOURCE=env, base64 32 bytes).
Keyring.Seal / SealString create the subject key on first use; Open returns ErrShredded once the key was
destroyed. Crypto-shredding = deleting the DEK: every copy of the subject's sealed data (current-state
documents, events, Kafka messages, backups) becomes unreadable without touching it.
In members
| Data | Storage |
|---|---|
Member events (members.member.*) | every PII field sealed (first/last/display name, e-mails, phone, birth date, pronouns) |
members current state | personal_email, phone, birth_date sealed; names and Workspace e-mail in clear for search, replaced by a pseudonymous stub on erasure |
provisionings | PII and the initial password sealed with a per-provisioning subject |
| Terms, mandates, trainings, role history | no PII (identifiers only) |
Audit records never contain PII, so they are not encrypted and survive erasure. Erasure flow: see main flows.