A developer is deploying a web application to Amazon EC2 instances. The application requires access to a sensitive API key for a third-party marketing platform. The company's security policy mandates that the API key must be encrypted at rest and rotated every 90 days. The developer wants to implement a solution that supports automatic rotation with minimal custom code. Which service and configuration should the developer choose to store and manage the API key?
- AStore the API key in AWS Systems Manager Parameter Store as a SecureString parameter. Enable the built-in Parameter Store automatic rotation feature and set the rotation interval to 90 days.
- Store the API key in AWS Secrets Manager. Configure an AWS Lambda function to perform the rotation logic, and associate it with the secret to rotate every 90 days.Cevap
- CStore the API key in AWS Systems Manager Parameter Store as a String parameter. Use a customer managed key in AWS KMS to encrypt the parameter, and write a cron job on the EC2 instances to update the parameter every 90 days.
- DStore the API key as an environment variable in the EC2 instance launch template. Use an AWS SDK client within the application code to retrieve the value from the instance metadata service.
Cevap
Store the API key in AWS Secrets Manager. Configure an AWS Lambda function to perform the rotation logic, and associate it with the secret to rotate every 90 days.
Storing the API key in AWS Secrets Manager and using a custom AWS Lambda function for rotation is the correct approach. Secrets Manager natively supports automatic rotation of secrets using Lambda functions. Since this is a third-party API key, a custom Lambda function is required to perform the rotation steps, meeting the 90-day rotation requirement with minimal custom code.
Adım Adım Çözüm
Anahtar Kavram
AWS Secrets Manager vs. AWS Systems Manager Parameter Store for secrets rotation
Tahmini Süre:1m 30s