How to Find AWS Lambda Function CORS Vulnerabilities
Publicly accessible services could expose sensitive data to bad actors.
This security check is part of the CIS Amazon Web Services Benchmarks and is rated severity medium.
This guide assumes that you have already installed and configured Resoto to collect your AWS cloud resources.
Execute the following
searchcommand in Resoto Shell or Resoto UI:
> search is(aws_lambda_function) and function_url_config.cors.allow_origins ~ "*"
kind=aws_lambda_function, ..., region=resoto-poweruser
kind=aws_lambda_function, ..., account=poweruser-team
searchcommand into the
> search is(aws_lambda_function) and function_url_config.cors.allow_origins ~ "*" | dump
The command output will list the details of all non-compliant
- Grant usage permissions on a per-resource basis, applying least privilege principle.
Please refer to the AWS Lambda documentation for details.