Lambda Compute Platform Should Not Use Default Deployment Configuration
More Info:
Ensure Lambda compute platform is not using default configuration
Risk Level
Medium
Address
Performance Efficiency, Operational Excellence, Reliability, Security
Compliance Standards
CBP
Remediation
Using Console
To remediate the misconfiguration of Lambda Compute Platform using default deployment configuration for AWS CodeBuild in AWS console, follow these steps:
-
Access AWS CodeBuild Console:
- Go to the AWS Management Console and navigate to the AWS CodeBuild service.
-
Select the Project:
- Select the CodeBuild project that is used for building and deploying the Lambda function.
-
Edit Build Project:
- Click on the project name to access the project details.
-
Update Buildspec File:
- Update the buildspec file to include the necessary configurations for Lambda deployment. Make sure to specify the deployment configurations for Lambda function in the buildspec file.
-
Update Deployment Configuration:
- In the CodeBuild project settings, navigate to the deployment configuration section and ensure that the deployment configuration is set up correctly for Lambda function deployment. You can specify the deployment settings such as the Lambda function name, runtime, handler, memory size, timeout, etc.
-
Save Changes:
- Save the changes made to the CodeBuild project settings.
-
Trigger Build:
- Trigger a new build for the CodeBuild project to deploy the Lambda function with the updated deployment configuration.
By following these steps, you can remediate the misconfiguration of Lambda Compute Platform using default deployment configuration for AWS CodeBuild in the AWS console.
Using CLI
To remediate the misconfiguration of Lambda Compute Platform using default deployment configuration in AWS CodeBuild using AWS CLI, follow these steps:
-
Open your terminal or command prompt.
-
Run the following command to update the AWS CodeBuild project to ensure that Lambda Compute Platform does not use default deployment configuration:
Replace
<project-name>
with the actual name of your AWS CodeBuild project. -
This command will update the AWS CodeBuild project’s environment settings to use a specific compute type (BUILD_GENERAL1_SMALL) and a specific Docker image (aws/codebuild/standard:4.0) which ensures that Lambda Compute Platform does not use default deployment configuration.
-
Once the command is executed successfully, the AWS CodeBuild project will be updated with the remediated configuration.
By following these steps, you can remediate the misconfiguration of Lambda Compute Platform using default deployment configuration in AWS CodeBuild using AWS CLI.
Using Python
To remediate the misconfiguration where the Lambda Compute Platform is using the default deployment configuration for AWS CodeBuild, you can follow these steps in Python:
-
Create a CodeBuild Project with Custom Deployment Configuration:
Use the AWS SDK for Python (Boto3) to create a new CodeBuild project with a custom deployment configuration. You can specify the deployment configuration in the
environment
parameter when creating the project. -
Update Existing CodeBuild Project:
If you already have an existing CodeBuild project that is using the default deployment configuration, you can update the project to use a custom deployment configuration.
-
Verify the Deployment Configuration:
After creating or updating the CodeBuild project with the custom deployment configuration, verify that the project is using the specified deployment configuration by checking the project settings in the AWS Management Console or using the AWS CLI or SDK.
By following these steps and providing a custom deployment configuration for your Lambda Compute Platform in AWS CodeBuild, you can remediate the misconfiguration and ensure that your Lambda functions are deployed securely and efficiently.