Documentation
README
Ensure every Lambda function has its own IAM Role
Description
Every Lambda function should have a one to one IAM execution role and the roles should not be shared between functions.
Rationale
The Principle of Least Privilege means that any Lambda function should have the minimal amount of access required to perform its tasks. In order to accomplish this Lambda functions should not share IAM Execution roles.
Impact
Creating unique IAM roles for each Lambda function increases the number of IAM roles to manage but provides better security isolation between functions.
Audit Procedure
Using AWS Console
- Login to the AWS console using https://console.aws.amazon.com/lambda/
- In the left column, under
AWS Lambda, clickFunctions. - Under
Function nameclick on the name of the function that you want to review. - Click the
Configurationtab - Under General configuration on the left column, click
Permissions. - Under the
Execution rolesection,Role namenot the name listed as this is the IAM is the role that defines the access permissions for the selected function. - Repeat steps 2 - 6 for all the Lambda functions listed within the AWS region.
- If any Lambda functions share the same Execution role, refer to the remediation below.
- Repeat this Audit for all the AWS Regions.
Using AWS CLI
N/A - This control is Console-based audit only.
Expected Result
Each Lambda function has a unique IAM execution role that is not shared with any other Lambda function.
Remediation
Using AWS Console
- Login to the AWS console using https://console.aws.amazon.com/lambda/
- In the left column, under
AWS Lambda, clickFunctions. - Under
Function nameclick on the name of the function that you want to change/update. - Click the
Configurationtab - Under General configuration on the left column, click
Permissions. - Under the
Execution rolesection, clickEdit. - Scroll down to
Execution role
To use an existing IAM role:
- Click
Use an existing role - Select the role from the
Existing roledropdown. - The IAM role can't be associated with another Lambda function and must follow the Principle of Least Privilege.
To use a new IAM role:
- Click
Create a new role from AWS policy templates - Provide a unique name based on company policy in the
Role name - Select the policy templates from the
Policy templatesdropdown.
- Click
Save - Repeat steps 2 - 8 for all the Lambda functions listed within the AWS region that do not have a unique IAM Execution Role.
- Repeat this remediation process for all the AWS Regions.
Using AWS CLI
N/A - This control is Console-based remediation only.
Default Value
When creating a Lambda function, AWS creates a default execution role, but multiple functions can be configured to share the same role.
References
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 3.3 Configure Data Access Control Lists - Configure data access control lists based on a user's need to know. Apply data access control lists, also known as access permissions, to local and remote file systems, databases, and applications. | x | x | x |
| v7 | 8.3 Enable Operating System Anti-Exploitation Features/Deploy Anti-Exploit Technologies - Enable anti-exploitation features such as Data Execution Prevention (DEP) or Address Space Layout Randomization (ASLR) that are available in an operating system or deploy appropriate toolkits that can be configured to apply protection to a broader set of applications and executables. | x | x |
Profile
Level 1 | Manual