Question

Difficulty: MediumAWS KMS and Encryption

An application running on AWS Fargate needs to encrypt sensitive PDF contract files (each approximately 5 MB5\text{ MB} in size) before storing them in an Amazon Elastic File System (Amazon EFS) volume. The application must use envelope encryption with a customer managed key in AWS KMS.

Which two actions should a developer implement to meet these requirements? (Select TWO.)

  1. Call the GenerateDataKey API operation of AWS KMS using the customer managed key to obtain a plaintext data key and an encrypted data key.Answer
  2. Encrypt the PDF files locally with the plaintext data key, store the encrypted data key alongside the encrypted PDF files on Amazon EFS, and immediately delete the plaintext data key from memory.Answer
  3. C
    Call the Encrypt API operation of AWS KMS with the customer managed key, passing the entire PDF file payload directly to return the encrypted ciphertext.
  4. D
    Call the GenerateDataKeyWithoutPlaintext API operation of AWS KMS to retrieve only the encrypted data key, and decrypt it locally using an SSL certificate.
  5. E
    Store the PDF files as secure parameters in AWS Systems Manager Parameter Store using a SecureString parameter type encrypted with the customer managed key.

Answer

Call the GenerateDataKey API operation of AWS KMS using the customer managed key to obtain a plaintext data key and an encrypted data key, and encrypt the PDF files locally with the plaintext data key, store the encrypted data key alongside the encrypted PDF files on Amazon EFS, and immediately delete the plaintext data key from memory.
To encrypt payloads larger than 4 KB4\text{ KB}, envelope encryption is required. The developer calls the `GenerateDataKey` API operation, which returns a plaintext data key and an encrypted data key. The application encrypts the PDF locally using the plaintext key, stores the encrypted data key alongside the ciphertext on Amazon EFS, and discards the plaintext data key from memory.

Step-by-Step Solution

1
Generate a unique data key using AWS KMS.
The application receives a plaintext version and an encrypted version of the data key.
Because the files are larger than the 4 KB4\text{ KB} limit of KMS direct encryption, envelope encryption must be used.
2
Perform local client-side encryption.
The PDF file is encrypted into ciphertext using the plaintext data key.
To secure the data locally before writing it to the shared file system.
3
Store the encrypted data key and cleanup memory.
The encrypted PDF file and the encrypted data key are written to Amazon EFS, and the plaintext data key is purged from memory.
The encrypted key is required for future decryption, and removing the plaintext key from memory protects against unauthorized memory dumps.

Key Concept

AWS KMS envelope encryption workflow for objects larger than 4 KB4\text{ KB}
Estimated Time:1m 30s
Rate this question