Control: 4.10 Ensure Lambda functions do not allow unknown cross account access via permission policies
Description
Ensure that all your Amazon Lambda functions are configured to allow access only to trusted AWS accounts in order to protect against unauthorized cross-account access.
Allowing unknown (unauthorized) AWS accounts to invoke your Amazon Lambda functions can lead to data exposure and data loss. To prevent any unauthorized invocation requests for your Lambda functions, restrict access only to trusted AWS accounts.
Remediation
From the Console:
- Login to the AWS Console using https://console.aws.amazon.com/lambda/.
- In the left column, under
AWS Lambda
, clickFunctions
. - Under
Function name
click on the name of the function that you want to review. - Click the Configuration tab.
- In the left column, click
Permissions
. - In the
Resource-based policy statements
section, select the policy statement that allows the unknown AWS Account cross-account access. - Click Edit.
- On the
Edit permissions
page, replace or remove the AWS Account(s) ARN of the unauthorized principal in the Principal box. - Click Save.
- Repeat steps for each Lambda function that failed the Audit.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.cis_compute_service_v100_4_10
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.cis_compute_service_v100_4_10 --share
SQL
This control uses a named query:
manual_control