This rule ensures CodeBuild project environments have a proper logging configuration.
Rule | CodeBuild project environments should have a logging configuration |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Medium |
Rule Description
The CodeBuild project environments should have a logging configuration in place to adhere to the AWS Foundational Security Best Practices. Logging is crucial for monitoring and analyzing system activities, identifying security incidents, and troubleshooting issues in the environment.
Troubleshooting Steps
Remediation Steps
Enable Logging for CodeBuild Project Environment
CLI Command
If you prefer to use the AWS Command Line Interface (CLI) for enabling logging, you can use the following command:
aws codebuild update-project --name <project-name> --logs-config cloudWatchLogsEnabled=true [--logs-config cloudWatchLogsGroupName=<group-name> --logs-config cloudWatchLogsStreamName=<stream-name>]
Replace
<project-name>
with the name of your CodeBuild project, <group-name>
with the desired log group name (optional), and <stream-name>
with the desired log stream name (optional). Run the command in your preferred CLI tool, such as AWS CLI or AWS CloudShell.Note: Make sure you have the necessary permissions to modify the CodeBuild project and access the AWS CLI.
By following these steps, you will enable logging for the CodeBuild project environment as recommended by the AWS Foundational Security Best Practices. This will help you to monitor and protect your environment effectively.