Check ID: awslambda_function_inside_vpc
Provider: AWS
Service: awslambda
Severity: LOW
Categories: trust-boundaries
Resource type: AwsLambdaFunction

What this check verifies

AWS Lambda function uses VPC networking with specified subnets and security groups, rather than the default Lambda-managed network. Presence of a VPC association (vpc_id) indicates private connectivity to VPC resources.

Risk

Without VPC attachment, functions lack network isolation and granular egress control, weakening confidentiality and integrity. Traffic must use public endpoints, raising risks of data exfiltration and SSRF via unrestricted outbound. If private databases are required, missing VPC access can impact availability.

Recommendation

Attach functions to a VPC with private subnets and restrictive security groups to enforce least privilege and egress control.
  • Prefer VPC endpoints for AWS services
  • Use NAT only when necessary
  • Spread subnets across AZs for resilience
  • Govern with IAM conditions requiring VpcIds, SubnetIds, and SecurityGroupIds.

Remediation

aws lambda update-function-configuration --function-name <example_resource_name> --vpc-config SubnetIds=<example_subnet_id>,SecurityGroupIds=<example_security_group_id>

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = awslambda_function_inside_vpc. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks