This rule ensures Lambda functions have restricted public access.
Rule | Lambda functions should restrict public access |
Framework | NIST 800-53 Revision 5 |
Severity | ✔ Critical |
Rule Description
Lambda functions should restrict public access to comply with the NIST 800-53 Revision 5 standard. This rule ensures that Lambda functions are not accessible by the general public, thereby minimizing the risk of unauthorized access and data breaches.
Troubleshooting Steps
If you encounter issues with public access to Lambda functions, follow these troubleshooting steps:
Necessary Code
The following code snippet can be used to restrict public access to Lambda functions:
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
FunctionName: MyFunction
Role: !Ref MyLambdaExecutionRole
Code:
S3Bucket: my-lambda-bucket
S3Key: lambda-function.zip
Handler: index.handler
Runtime: nodejs12.x
VpcConfig:
SecurityGroupIds:
- sg-xxxxxxxx
SubnetIds:
- subnet-xxxxxxxx
- subnet-xxxxxxxx
In the above code, the Lambda function is associated with a VPC configuration, which restricts public access by connecting to the specified security groups and subnets.
Remediation Steps
To remediate public access to Lambda functions and comply with NIST 800-53 Revision 5, follow these steps:
By following the above steps, you can effectively restrict public access to Lambda functions, aligning with the NIST 800-53 Revision 5 standard.