What is the simplest and MOST secure way to decrypt this data when required?
Request KMS to provide the stored unencrypted data key and then use the retrieved data key to decrypt the data.
Keep the plaintext data key stored in Amazon DynamoDB protected with IAM policies. Query DynamoDB to retrieve the data key to decrypt the data
Use the Encrypt API to store an encrypted version of the data key with another customer managed key. Decrypt the data key and use it to decrypt the data when required.
Store the encrypted data key alongside the encrypted data. Use the Decrypt API to retrieve the data key to decrypt the data when required.
Explanations:
This option suggests requesting the stored unencrypted data key from KMS. However, KMS does not allow retrieval of plaintext data keys. Instead, KMS provides access to encrypted data keys, which must be decrypted using the KMS API. This process is not secure as it implies a misconception of KMS functionality.
Storing the plaintext data key in DynamoDB, even with IAM policies, exposes the data key to potential unauthorized access. If the DynamoDB table is compromised, the plaintext key could be retrieved, compromising the encryption security. Best practices recommend keeping sensitive keys in a more secure environment, like KMS.
This option suggests using the Encrypt API to encrypt the data key with another customer-managed key. While it involves good practices of key management, it adds unnecessary complexity. Additionally, it doesn’t clarify how to securely decrypt the data key when required, as it depends on the management of an additional key.
This option describes a secure and straightforward approach. By storing the encrypted data key alongside the encrypted data, the application can use the Decrypt API to retrieve and decrypt the data key when needed. This method leverages KMS effectively, ensuring that sensitive keys are not exposed in plaintext and maintaining strong security by using KMS for key management.