| name | cis-aws-compute-12.3 |
| description | Ensure AWS Secrets manager is configured and being used by Lambda for databases |
| category | cis-compute |
| version | 1.1.0 |
| author | cyberstrike-official |
| tags | ["cis","aws","compute","lambda","serverless","secrets-manager","credentials","database"] |
| cis_id | 12.3 |
| cis_benchmark | CIS AWS Compute Services Benchmark v1.1.0 |
| tech_stack | ["aws"] |
| cwe_ids | [] |
| chains_with | ["cis-aws-compute-12.4","cis-aws-compute-12.12"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure AWS Secrets manager is configured and being used by Lambda for databases
Description
Lambda functions often have to access a database or other services within your environment.
Rationale
Credentials used to access databases and other AWS Services need to be managed and regularly rotated to keep access into critical systems secure. Keeping any credentials and manually updating the passwords would be cumbersome, but AWS Secrets Manager allows you to manage and rotate passwords.
Impact
Lambda code should be checked for correct configuration to get the credentials from AWS Secrets Manager. This audit and remediation is only to confirm you have the credentials in Secrets manager.
Audit Procedure
Using AWS Console
- Login to AWS Console using https://console.aws.amazon.com
- Click
All services, click Secrets Manager under Security, Identity and Compliance.
- Click on
Secrets.
- Review the secrets listed
- Confirm that the secret required for Lambda functions is included in the list.
- If it is, review your code and confirm that you are calling the credentials during runtime.
- If the credentials are not listed refer to the remediation below.
- Repeat steps 2-7 for all regions used.
Using AWS CLI
N/A - This control is Console-based audit only.
Expected Result
All database credentials used by Lambda functions are stored in AWS Secrets Manager and Lambda code retrieves credentials from Secrets Manager at runtime.
Remediation
Using AWS Console
- Login to AWS Console using https://console.aws.amazon.com
- Click
All services, click Secrets Manager under Security, Identity and Compliance.
- Click on
Secrets.
- Click on
Store a new secret
- Select the
Secret type
- Enter the information
For the 3 db types listed enter the credentials and select the database.
For other database enter the credentials, select the db type and enter the connection parameters.
For Other type of secret (Lambda) create the keys and values used. - example Username yepyep Password yepyep
Choose an encryption key or create a new one. If you add a new key it will take you to the KMS console. Once you create the new key you can then select it here.