What is the MOST secure and flexible way to obtain password credentials during deployment?
Retrieve an access key from an AWS Systems Manager SecureString parameter to access AWS services. Retrieve the database credentials from a Systems Manager SecureString parameter.
Launch the EC2 instances with an EC2 IAM role to access AWS services. Retrieve the database credentials from AWS Secrets Manager.
Retrieve an access key from an AWS Systems Manager plaintext parameter to access AWS services. Retrieve the database credentials from a Systems Manager SecureString parameter.
Launch the EC2 instances with an EC2 IAM role to access AWS services. Store the database passwords in an encrypted config file with the application artifacts.
Explanations:
While using AWS Systems Manager SecureString for storing credentials is a good practice, retrieving an access key from a Systems Manager parameter is not ideal as it introduces additional complexity and the potential for mismanagement of access keys, which can lead to security vulnerabilities. Additionally, access keys can be compromised, whereas IAM roles are more secure for managing permissions.
Launching EC2 instances with an EC2 IAM role provides secure and flexible access to AWS services without hardcoding credentials. Using AWS Secrets Manager to retrieve database credentials ensures that sensitive information is stored securely and can be rotated easily, enhancing security and compliance. This option aligns with AWS best practices for security.
Using a plaintext parameter to retrieve access keys is not secure, as plaintext credentials can be exposed. Although retrieving database credentials from a SecureString parameter is good, the use of plaintext access keys undermines the overall security of the deployment process.
While launching EC2 instances with an IAM role is a secure practice, storing database passwords in an encrypted config file poses risks. If the file is not handled correctly, there is potential for exposure of sensitive information. Moreover, this approach does not provide the flexibility of securely managing and rotating database credentials like AWS Secrets Manager does.