Control: 4.9 Ensure there are no Lambda functions with admin privileges within your AWS account
Description
Ensure that your Amazon Lambda functions don't have administrative permissions potentially giving the function access to all AWS cloud services and resources.
In order to promote the Principle of Least Privilege (POLP) and provide your functions the minimal amount of access required to perform their tasks the right IAM execution role associated with the function should be used. Instead of providing administrative permissions you should grant the role the necessary permissions that the function really needs.
Remediation
From the Console:
- Login in 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 remediate. - Click the Configuration tab.
- Click on
Permissions
in the left column. - In the Execution role section, click the
Edit
. - Edit basic settings configuration page:
- associate the function with an existing, compliant IAM role- click Use an existing role from the Execution role- select the required role from the Existing role dropdown- click Save
OR
- apply a new execution role to your Lambda function- click Create a new role from AWS policy templates- Provide a name for the new role based on org policy- select only the necessary permission set(s) from the Policy templates -optional dropdown list.- click Save
- Repeat steps for each Lambda function within the current region that failed the Audit.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.cis_compute_service_v100_4_9
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.cis_compute_service_v100_4_9 --share
SQL
This control uses a named query:
manual_control