Find secrets in Lambda functions code.
Risk
The use of a hard-coded password increases the possibility of password guessing. If hard-coded passwords are used, it is possible that malicious users gain access through the account in question.
Run this check with Prowler CLI
prowler aws --checks awslambda_function_no_secrets_in_code
ARN template
arn:partition:lambda:region:account-id:function/function-name
Remediation
WUIReferences:
Use Secrets Manager to securely provide database credentials to Lambda functions and secure the databases as well as use the credentials to connect and query them without hardcoding the secrets in code or passing them through environmental variables.
Source Code
Resource Type
AwsLambdaFunction