Cis AWS Compute 12.9
DevOps & Securitycis-aws-compute-12.9Cis AWS Compute 12.9 is an Agent Skill for devops & security published in the CyberStrikeus/CyberStrike repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Ensure there are no Lambda functions with admin privileges within your AWS account
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/CyberStrikeus/CyberStrike/blob/HEAD/.cyberstrike/skill/CIS_benchmarks/Cloud_Providers/AWS/CIS_AWS_Compute_Services_Benchmark_v1.1.0/cis-aws-compute-12.9/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cis-aws-compute-12-9, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
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.
Rationale
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.
Impact
Removing admin privileges from Lambda execution roles may break functions that rely on broad permissions. Functions should be tested after permission changes.
Audit Procedure
Using AWS Console
- Login in 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 Configuration tab
- Click on
Permissionsin the left column. - In the Execution role section, click the
Role nameto access the IAM role details. **Note this will bring you to the IAM Console. - Select the Permissions tab to view the identity-based policies attached
- In the Permissions policies section click on the Policy name.
- Select the Permissions tab. **Note The policy summary should show below in JSON format.
- Within the {} JSON policy, identify the "Action" element defined for each statement and check the value.
- If any of the "Action" element values are set to "*" and the "Effect" element is set to "Allow", the role policy provides access to all the supported AWS cloud services and resources.
- Repeat this step for each IAM policy attached to the selected execution role.
If one or more policies allow access to all AWS services and resources, the execution role provides administrative permissions. Refer to the remediation below. Repeat steps for each Lambda function within the current region. Then repeat the Audit process for all other regions.
Using AWS CLI
N/A - This control requires manual review of IAM policies through the Console.
Expected Result
No Lambda function execution role has policies with "Action": "*" and "Effect": "Allow", ensuring no function has administrative privileges.
Remediation
Using AWS Console
- Login in 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 you want to remediate - Click the Configuration tab
- Click on
Permissionsin 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.
Using AWS CLI
N/A - This control is Console-based remediation only.
Default Value
Lambda functions are not created with administrative privileges by default, but users may attach overly permissive policies to execution roles.
References
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 6.8 Define and Maintain Role-Based Access Control - Define and maintain role-based access control, through determining and documenting the access rights necessary for each role within the enterprise to successfully carry out its assigned duties. Perform access control reviews of enterprise assets to validate that all privileges are authorized, on a recurring schedule at a minimum annually, or more frequently. | x | ||
| v7 | 1.7 Deploy Port Level Access Control - Utilize port level access control, following 802.1x standards, to control which devices can authenticate to the network. | x | x |
Profile
Level 1 | Manual