Aller au contenu principal

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_keys collection of the service database, together with the KEK fingerprint (rotation);
  • the KEK comes from OpenStack Barbican in production (CRYPTO_KEK_SOURCE=barbican) or from the CRYPTO_KEK env 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​

DataStorage
Member events (members.member.*)every PII field sealed (first/last/display name, e-mails, phone, birth date, pronouns)
members current statepersonal_email, phone, birth_date sealed; names and Workspace e-mail in clear for search, replaced by a pseudonymous stub on erasure
provisioningsPII and the initial password sealed with a per-provisioning subject
Terms, mandates, trainings, role historyno PII (identifiers only)

Audit records never contain PII, so they are not encrypted and survive erasure. Erasure flow: see main flows.