DVA-C02 · Question #509
A company is building an application to accept data from customers. The data must be encrypted at rest and in transit. The application uses an Amazon API Gateway API that resolves to AWS Lambda…
The correct answer is B. Add a Lambda function that uses the KMS key to decrypt the data fields before saving the data to. This question tests understanding of CloudFront field-level encryption and the requirement to decrypt encrypted fields at the origin before persisting data to a database.
Question
A company is building an application to accept data from customers. The data must be encrypted at rest and in transit. The application uses an Amazon API Gateway API that resolves to AWS Lambda functions. The Lambda functions store the data in an Amazon Aurora MySQL DB cluster. The application worked properly during testing. A developer configured an Amazon CloudFront distribution with field-level encryption that uses an AWS Key Management Service (AWS KMS) key. After the configuration of the distribution, the application behaved unexpectedly. All the data in the database changed from plaintext to ciphertext. The developer must ensure that the data is not stored in the database as the ciphertext from the CloudFront field-level encryption. Which solution will meet this requirement?
Options
- AChange the CloudFront Viewer protocol policy from "HTTP and HTTPS" to "HTTPS only."
- BAdd a Lambda function that uses the KMS key to decrypt the data fields before saving the data to
- CEnable encryption on the DB cluster by using the same KMS key that is used in CloudFront.
- DRequest and deploy a new SSL certificate to use with the CloudFront distribution.
How the community answered
(29 responses)- A17% (5)
- B69% (20)
- C10% (3)
- D3% (1)
Why each option
This question tests understanding of CloudFront field-level encryption and the requirement to decrypt encrypted fields at the origin before persisting data to a database.
Changing the viewer protocol policy to HTTPS only affects transport-layer encryption between the client and CloudFront; it has no effect on field-level encryption, which operates at the application layer and is applied before the payload reaches the origin.
CloudFront field-level encryption uses asymmetric encryption to protect specific form fields at the edge using a public key. The encrypted ciphertext is forwarded as-is to the origin Lambda function, which must use the corresponding private key via AWS KMS to decrypt the fields before writing to Aurora. Without this explicit decryption step, the ciphertext is stored directly in the database instead of the original plaintext values.
Enabling Aurora storage encryption with the same KMS key encrypts data at rest in the database but does not decrypt the CloudFront field-level encrypted ciphertext before it is inserted; both layers operate independently.
Deploying a new SSL certificate affects TLS termination at the CloudFront distribution for HTTPS traffic, but has no relationship to field-level encryption, which is a separate application-layer feature that encrypts specific payload fields.
Concept tested: CloudFront field-level encryption origin decryption with KMS
Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html
Community Discussion
No community discussion yet for this question.