# Ensure There Are No Lambda Functions with Admin Privileges within Your AWS Account

- Source: https://support.icompaas.com/support/solutions/articles/62000234118-ensure-there-are-no-lambda-functions-with-admin-privileges-within-your-aws-account
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS AWS Compute Services Benchmark v1.1.0](https://support.icompaas.com/support/solutions/62000112682) › [AWS Compute Services Benchmark v1.1.0](https://support.icompaas.com/support/solutions/folders/62000169228)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

### **Profile Applicability:**

-   **Level 1**

### **Description:**

AWS Lambda functions operate based on permissions granted to their associated execution roles, which are governed by AWS Identity and Access Management (IAM) policies. To minimize the risk of unauthorized or excessive access, it's essential to ensure that no Lambda function within your AWS account is granted admin privileges, such as AdministratorAccess or equivalent, which could provide broader access to AWS resources.

### **Rationale:**

Lambda functions with admin privileges (e.g., AdministratorAccess or wildcard \* permissions) can inadvertently or maliciously perform actions across your entire AWS environment, including the ability to modify, delete, or access sensitive resources. Limiting Lambda functions to the principle of least privilege reduces security risks and ensures compliance with regulatory standards like SOC 2, HIPAA, and others.

**Impact:**

**Pros:**

-   Restricting Lambda functions to least-privilege access reduces the risk of security breaches.  
    
-   It ensures that Lambda functions can only perform the specific actions required for their functionality.  
    
-   Improves compliance with data protection regulations and internal security policies.  
    

**Cons:**

-   May require regular auditing of IAM roles and permissions.  
    
-   Potential disruption of Lambda functions if policies are misconfigured, requiring careful management.  
    
-   Administrative effort is needed to restrict roles and permissions for each Lambda function.  
    

### **Default Value:**

Lambda functions should not have admin privileges by default. However, if policies are misconfigured, functions may inherit broad permissions that include administrative rights.

### **Pre-requisites:**

-   Access to AWS Management Console or AWS CLI with sufficient permissions to view Lambda functions and IAM roles/policies.  
    
-   Familiarity with IAM roles and policies associated with Lambda functions.  
    
-   Regular audits of IAM policies and Lambda functions to ensure compliance with least privilege access.  
    

### **Remediation:**

### **Test Plan:**

#### **Using AWS Console:**

1.  Test Lambda Functions After Policy Changes:  
    
    -   Ensure that after modifying the IAM role, the Lambda function performs as expected.
        
    -   Test that the function does not encounter permission errors related to the changes made in the IAM role.  
          
        

#### **Using AWS CLI:**

1.  Verify Lambda Function Access:  
    

Run the following command to test access and ensure the Lambda function executes with the correct permissions:  

aws lambda invoke --function-name <function-name> output.txt

2.  Check for Permission Errors:  
    
    -   Ensure that no permission errors occur that could indicate over-permissive access.  
        

### **Implementation Plan:**

**Using AWS Console:**  

1.  Log into the AWS Management Console and navigate to the Lambda section.  
    
2.  Select the Lambda function and review its execution role.  
    
3.  In the IAM console, inspect the policies attached to the execution role.  
    
4.  If necessary, modify the policy to remove overly permissive permissions such as AdministratorAccess.  
    
5.  Test the function to ensure it still operates correctly with the updated permissions.  
    

**Using AWS CLI:**

1.  Retrieve the IAM role associated with the Lambda function using:  
    
    aws lambda get-function-configuration --function-name <function-name>
    
2.  Review the policies attached to the IAM role.
    
3.  If required, update the IAM policy using:  
    
    aws iam put-role-policy --role-name <role-name> --policy-name <policy-name> --policy-document file://updated-policy.json
    
4.  Test the Lambda function after the policy change to ensure it performs as expected.  
    

### **Backout Plan:**

#### **Using AWS Console:**

1.  If issues arise after modifying permissions, navigate to the IAM role associated with the Lambda function.  
    
2.  Revert to the original policy configuration or use a backup of the original permissions.  
    
3.  Test the Lambda function to ensure it continues to function properly.
    

#### **Using AWS CLI:**

1.  Revert the IAM policy to its previous state using the following command:  
    
    aws iam put-role-policy --role-name <role-name> --policy-name <policy-name> --policy-document file://original-policy.json
    
2.  Test the Lambda function after rolling back the policy to confirm functionality.
    

### **References:**

-   [AWS Lambda: Managing Execution Role  
    ](https://docs.aws.amazon.com/lambda/latest/dg/access-control-identity-based.html)
    
-   [AWS IAM: Identity-Based Policies  
    ](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
    
-   [AWS CLI: Lambda Commands  
    ](https://docs.aws.amazon.com/cli/latest/reference/lambda/index.html)
    
-   [AWS CLI: IAM Commands  
    ](https://docs.aws.amazon.com/cli/latest/reference/iam/index.html)
    

### **CIS Controls:**

<table style="border:none;border-collapse:collapse;font-family:&quot;Helvetica Neue&quot;"><colgroup style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"></colgroup><tbody style="font-family:&quot;Helvetica Neue&quot;"><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Version</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Control ID</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></p></td></tr><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">v8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">14.3</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Restrict Lambda function permissions to only those necessary for specific tasks, avoiding admin access.</span></span></span></p></td></tr><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">14.3</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Ensure that Lambda functions do not have overly permissive IAM policies, such as&nbsp;</span></span><span style="font-family:&quot;Helvetica Neue&quot;;color:rgb(0, 0, 0)"><span style="font-family:&quot;Helvetica Neue&quot;">AdministratorAccess</span><span style="font-family:&quot;Helvetica Neue&quot;">.</span></span></span></p></td></tr></tbody></table>

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
