Medium
CloudFront
CloudFront distributions should use origin access control for Lambda function URL origins
Description
Flags Amazon CloudFront distributions that use AWS Lambda function URLs as origins without origin access control (OAC) enabled. Without OAC, the Lambda function URL is publicly reachable and bypasses the protections CloudFront provides.
Remediation
Configure OAC on every Lambda function URL origin in a CloudFront distribution.
Steps
- Open the CloudFront console and select the distribution.
- Choose Origins, then edit the Lambda function URL origin.
- Under Origin access, select Origin access control settings and choose or create an OAC for Lambda.
- Update the Lambda function's resource policy to allow the OAC principal.
- Save the changes.