A company has an AWS Lambda function that processes sensitive financial data. The function uses environment variables to store database connection strings. A security audit requires that all sensitive data be encrypted at rest and in transit. The developer must ensure that the environment variables are encrypted with a customer-managed key that is rotated quarterly. What should the developer do?
Trap 1: Use AWS Systems Manager Parameter Store with a SecureString…
AWS Systems Manager Parameter Store, while capable of securely storing sensitive data using SecureString parameters, does not offer built-in automatic rotation capabilities. Implementing a quarterly rotation for secrets stored here would require developing and managing custom automation scripts and scheduling mechanisms, which falls short of the requirement for an integrated, automatic solution.
Trap 2: Encrypt the environment variables using the Lambda service key
While AWS Lambda encrypts environment variables at rest using an AWS-managed service key, this key is not configurable for customer-scheduled rotation. Furthermore, environment variables are static configuration elements; frequently updating them quarterly would necessitate redeploying or reconfiguring the Lambda function, which is an operationally complex and inefficient method for managing dynamic secret rotation.
Trap 3: Use AWS KMS to encrypt the environment variables and set a manual…
Encrypting environment variables with AWS KMS provides strong encryption for data at rest, but the proposed manual rotation policy directly contradicts the requirement for *automatic* quarterly rotation. A manual process would require human intervention or external, unscheduled scripting to update the secret, failing to provide the necessary automation. Additionally, environment variables are not designed for the dynamic, frequent updates required for secret rotation.
- A
Use AWS Systems Manager Parameter Store with a SecureString parameter using an AWS managed key
Why wrong: AWS Systems Manager Parameter Store, while capable of securely storing sensitive data using SecureString parameters, does not offer built-in automatic rotation capabilities. Implementing a quarterly rotation for secrets stored here would require developing and managing custom automation scripts and scheduling mechanisms, which falls short of the requirement for an integrated, automatic solution.
- B
Store the connection string in AWS Secrets Manager and enable automatic rotation with a custom Lambda function
AWS Secrets Manager is specifically designed for the secure storage and automatic rotation of secrets, including connection strings. Its robust integration with custom Lambda functions enables highly flexible and tailored rotation logic, allowing for automatic secret updates every 90 days (quarterly) using a customer-managed KMS key. This solution perfectly aligns with the requirement for automatic quarterly rotation of sensitive financial data.
- C
Encrypt the environment variables using the Lambda service key
Why wrong: While AWS Lambda encrypts environment variables at rest using an AWS-managed service key, this key is not configurable for customer-scheduled rotation. Furthermore, environment variables are static configuration elements; frequently updating them quarterly would necessitate redeploying or reconfiguring the Lambda function, which is an operationally complex and inefficient method for managing dynamic secret rotation.
- D
Use AWS KMS to encrypt the environment variables and set a manual rotation policy
Why wrong: Encrypting environment variables with AWS KMS provides strong encryption for data at rest, but the proposed manual rotation policy directly contradicts the requirement for *automatic* quarterly rotation. A manual process would require human intervention or external, unscheduled scripting to update the secret, failing to provide the necessary automation. Additionally, environment variables are not designed for the dynamic, frequent updates required for secret rotation.