An enterprise archiving application is designed to write raw sensor datasets (each averaging in size) to a self-managed object store. The compliance team mandates client-side encryption before transmission. To minimize AWS KMS API requests and network latency, the development team plans to use local envelope encryption. Which sequence of AWS SDK operations represents the correct and most cost-effective implementation of this encryption workflow?
- Request a data key by calling `GenerateDataKey`. Use the returned plaintext data key to encrypt the dataset locally, immediately wipe the plaintext key from application memory, and store the dataset along with the returned ciphertext data key.Answer
- BEncrypt the dataset directly by calling `Encrypt` with the customer managed key, and then upload the resulting ciphertext to the object store.
- CRequest only the encrypted key structure by calling `GenerateDataKeyWithoutPlaintext`. Use this returned ciphertext data key to perform the local encryption of the dataset.
- DRequest a data key by calling `GenerateDataKey` to get a plaintext key. Use it to encrypt the dataset locally, then call `Encrypt` to encrypt that plaintext key, storing the resulting ciphertext key alongside the data.
Answer
Request a data key by calling `GenerateDataKey`, use the returned plaintext data key to encrypt the dataset locally, wipe the plaintext key from memory, and store the dataset alongside the returned ciphertext data key.
The correct workflow for client-side envelope encryption involves requesting a data key using `GenerateDataKey`. This operation returns both the plaintext key (for immediate encryption) and the encrypted ciphertext key (for storage). The plaintext key should be cleared from memory as soon as encryption completes.
Step-by-Step Solution
Key Concept
AWS KMS Envelope Encryption Workflow
Estimated Time:1m 30s