passdrill
AWS SAA-C03 · IAM & Security · Card 009/014 hard

An application encrypts large files by calling AWS KMS's GenerateDataKey operation to obtain a plaintext data key and its KMS-encrypted copy, encrypts the file locally with the plaintext data key, discards the plaintext key from memory, and stores only the encrypted copy of the data key alongside the file. What is this pattern called, and why does KMS support it?

  1. Client-side master key rotation, used because KMS cannot rotate customer master keys automatically
  2. Envelope encryption, used because AWS KMS's Encrypt and Decrypt API calls have a payload size limit unsuited to large data, so the bulk data is encrypted locally with a data key while only that small data key is protected directly by KMS
  3. Field-level encryption, used because KMS can only encrypt structured JSON fields, not arbitrary binary files
  4. Envelope encryption, used specifically to avoid ever calling the KMS API during encryption operations
Next card → Shuffle