This rule ensures that CodeBuild project environment variables do not expose clear text credentials.
Rule | CodeBuild project environment variables should not contain clear text credentials |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Critical |
Rule Description:
This rule aims to ensure that AWS CodeBuild project environment variables do not contain clear text credentials. Storing credentials in clear text within environment variables poses a security risk, as it makes them easily accessible to potential attackers.
Remediation Steps:
To remediate this issue, follow the steps below:
1. Identify CodeBuild Projects with Clear Text Credentials:
2. Update Environment Variables:
For each identified CodeBuild project, update the environment variables to remove any clear text credentials. There are two recommended approaches for managing credentials securely:
a. Use AWS Secrets Manager:
b. Use AWS Systems Manager Parameter Store:
3. Test and Validate:
Troubleshooting Steps:
Issue: Build fails after updating environment variables
Possible Cause: Incorrect reference to AWS Secrets Manager or AWS Systems Manager Parameter Store ARN.
Resolution:
Issue: Credentials are still exposed in environment variables
Possible Cause: Failure to delete original environment variables containing clear text credentials.
Resolution:
Example Code:
There is no specific code provided for this rule. The remediation steps involve using AWS Secrets Manager or AWS Systems Manager Parameter Store, where you will need to create and reference the relevant secrets or parameters.