An organization is deploying a microservices-based application on Amazon ECS. The services require access to a third-party payment gateway API token. The security policy dictates that the API token must be stored securely, encrypted at rest, and automatically rotated every 30 days to mitigate credential exposure risks.
Which solution should a solutions architect recommend to satisfy these requirements with the least operational overhead?
- Store the API token in AWS Secrets Manager. Configure automatic rotation using a custom or template AWS Lambda function on a 30-day schedule, and update the ECS tasks to retrieve the token dynamically.Answer
- BStore the API token in AWS Systems Manager Parameter Store as a standard String parameter. Configure an Amazon EventBridge rule and an AWS Lambda function to update the parameter value every 30 days.
- CStore the API token in AWS Systems Manager Parameter Store as a SecureString parameter, and enable the native automatic 30-day key rotation option directly in the Parameter Store console.
- DStore the API token in an Amazon S3 bucket encrypted with an AWS KMS Customer Managed Key. Enable automatic annual rotation on the KMS key to rotate the API token every 30 days.
Answer
Store the API token in AWS Secrets Manager, configure automatic rotation using an AWS Lambda function, and retrieve it dynamically within the ECS tasks.
Storing the API token in AWS Secrets Manager is the correct approach because Secrets Manager is designed specifically for managing secrets and natively integrates with AWS Lambda to rotate credentials automatically. It encrypts secrets at rest using AWS KMS and allows ECS tasks to retrieve the values dynamically via IAM roles, ensuring security and low operational overhead.
Step-by-Step Solution
Key Concept
AWS Secrets Manager vs Systems Manager Parameter Store for Secret Rotation