A developer is implementing client-side encryption for an application that processes large database backups with an average size of GB before uploading them to an Amazon S3 bucket. To comply with corporate security policies, the developer must use AWS KMS and envelope encryption. Which sequence of operations should the developer implement to encrypt the backup files?
- ARetrieve a symmetric encryption key from AWS Secrets Manager using the GetSecretValue API, encrypt the database backup locally using this key, and upload the encrypted backup along with the secret version ID.
- Call the GenerateDataKey API operation on AWS KMS to receive a plaintext data key and an encrypted data key. Use the plaintext data key to encrypt the database backup locally, erase the plaintext key from memory, and upload the encrypted backup along with the encrypted data key.Cevap
- CCall the Encrypt API operation on AWS KMS directly, passing the database backup as the plaintext parameter, and upload the resulting ciphertext to the Amazon S3 bucket.
- DCall the GenerateDataKeyWithoutPlaintext API operation on AWS KMS to obtain an encrypted data key, use the encrypted data key to encrypt the database backup locally, and upload the encrypted backup.
Cevap
Call the GenerateDataKey API operation on AWS KMS to receive a plaintext data key and an encrypted data key. Use the plaintext data key to encrypt the database backup locally, erase the plaintext key from memory, and upload the encrypted backup along with the encrypted data key.
The correct approach uses the GenerateDataKey API to obtain both a plaintext key (used for local encryption of the 15 GB file) and an encrypted data key (saved alongside the encrypted file). Discarding the plaintext key from memory after use adheres to the principle of least privilege and prevents memory scraping attacks.
Adım Adım Çözüm
Anahtar Kavram
AWS KMS Envelope Encryption
Tahmini Süre:2m 0s