A guideline stating that Lambda functions must be within a VPC
Rule | Lambda functions should be in a VPC |
Framework | FedRAMP Moderate Revision 4 |
Severity | ✔ Low |
Rule Description
Lambda functions should be configured to run within a Virtual Private Cloud (VPC) for compliance with FedRAMP Moderate Revision 4 requirements. Running Lambda functions within a VPC ensures better security and isolates the function's network traffic from the public internet.
Remediation
To comply with the rule, you need to configure your Lambda function to run within a VPC. Follow the step-by-step guide below for the necessary remediation:
Step 1: Determine VPC Configuration
Step 2: Configure Lambda Function
Open the AWS Management Console and navigate to the Lambda service.
Select the relevant Lambda function that needs to be configured within a VPC.
Click on the "Configuration" tab.
Scroll down to the "Network settings" section and click on "Edit" for the "VPC" configuration.
Select the desired VPC from the dropdown list.
Choose the appropriate subnets within the VPC for your Lambda function to use.
Define the Security Groups that should be associated with the Lambda function.
Click on "Save" to apply the changes.
Step 3: Configure VPC Networking
Open the Amazon VPC service in the AWS Management Console.
Navigate to the "Subnets" section.
Ensure that the chosen subnets for the Lambda function are appropriately configured to meet your networking requirements.
Consider configuring Network Access Control Lists (NACLs) to restrict inbound and outbound traffic for the subnets, if necessary.
Review and modify the Security Groups associated with the Lambda function to allow the required inbound and outbound traffic.
Troubleshooting Steps
If you encounter any issues while configuring your Lambda function to run within a VPC, consider the following troubleshooting steps:
Issue: Unable to select the desired VPC from the dropdown list.
Issue: Network connectivity issues after configuring the Lambda function within a VPC.
Issue: Unexpected latency or performance issues after configuring the Lambda function within a VPC.
Code Samples
There are no specific code samples required for this configuration. However, you may use the AWS Command Line Interface (CLI) or AWS CloudFormation to programmatically configure your Lambda function's VPC settings.
Example AWS CLI command to update Lambda function configuration:
aws lambda update-function-configuration \ --function-name <lambda-function-name> \ --vpc-config SubnetIds=<subnet-ids>,SecurityGroupIds=<security-group-ids>
Replace
<lambda-function-name>
with the actual name or ARN of the Lambda function. <subnet-ids>
and <security-group-ids>
should be replaced with the relevant subnet and security group IDs specified as a comma-separated list.Please note that the actual syntax and parameter names may vary depending on the version of AWS CLI you are using.
Conclusion
By configuring your Lambda function to run within a VPC, you ensure compliance with FedRAMP Moderate Revision 4 requirements related to network isolation and security. Following the provided guidelines and steps will help you successfully configure your Lambda functions within a VPC and meet the necessary compliance standards.