This rule ensures that IAM policies do not have statements granting admin access.
Rule | IAM policy should not have statements with admin access |
Framework | CISA-cyber-essentials |
Severity | ✔ High |
Ensuring IAM Policy Compliance with CISA Cyber Essentials
Overview of CISA Cyber Essentials Policy Implementation
CISA (Cybersecurity and Infrastructure Security Agency) recommends organizations adhere to cybersecurity essentials to manage and reduce risks. Admin access in AWS IAM (Identity and Access Management) can be extremely powerful and potentially risky if not managed correctly. Organizations subject to these recommendations must therefore restrict admin-level access.
An IAM policy with administrative privileges essentially allows users to perform nearly any action on any resource in an AWS environment. To adhere to CISA's Cyber Essentials, such broad access should be restricted to limit the risk of unauthorized changes or access to sensitive resources.
Rule Detail: No Admin Access in IAM Policies
Description of the Rule
To comply with the CISA Cyber Essentials, your IAM policies must not grant full administrative privileges. This means avoiding policies that allow actions like
iam:*
, s3:*
, ec2:*
or other wildcards that indicate full access. Policies should instead adopt the principle of least privilege—providing only the permission necessary to perform required tasks.Potential Risks of Admin Access
Troubleshooting and Remediation Steps
If a non-compliant IAM policy is identified, follow these steps to remediate:
Identify Non-compliant Policies
"Effect": "Allow"
with "Action": "*"
or wildcards like iam:*
.Example script snippet using AWS CLI:
aws iam list-policies --scope Local --query 'Policies[?PolicyName!=`AdministratorAccess`].[Arn]' --output text | xargs -n1 aws iam get-policy-version --version-id --query 'PolicyVersion.Document' --policy-arn
Create Compliant Policies
Apply Compliant Policies
Steps Guide for Remediation
Detaching Non-Compliant IAM Policies
# Detach the non-compliant policy from all IAM entities aws iam list-entities-for-policy --policy-arn [non-compliant-policy-arn] --query 'PolicyGroups[].GroupName' --output text | xargs -I {} aws iam detach-group-policy --policy-arn [non-compliant-policy-arn] --group-name {} aws iam list-entities-for-policy --policy-arn [non-compliant-policy-arn] --query 'PolicyUsers[].UserName' --output text | xargs -I {} aws iam detach-user-policy --policy-arn [non-compliant-policy-arn] --user-name {} aws iam list-entities-for-policy --policy-arn [non-compliant-policy-arn] --query 'PolicyRoles[].RoleName' --output text | xargs -I {} aws iam detach-role-policy --policy-arn [non-compliant-policy-arn] --role-name {}
Attaching Compliant IAM Policies
# Attach the compliant policy to specific IAM groups, users, or roles aws iam attach-group-policy --policy-arn [compliant-policy-arn] --group-name [target-group-name] aws iam attach-user-policy --policy-arn [compliant-policy-arn] --user-name [target-user-name] aws iam attach-role-policy --policy-arn [compliant-policy-arn] --role-name [target-role-name]
Ensure that your remediation steps are well documented and communicated to relevant teams handling IAM. Regular audits and reviews should be part of your security governance to maintain compliance with the CISA Cyber Essentials.
In conclusion, while this guidance provides a methodical approach to comply with CISA recommendations regarding IAM policies, it is also vital to consistently train and educate your team on the importance of cybersecurity best practices. Proper management of IAM policies contributes to a strong security posture and supports overall SEO strategies by protecting your organization's online reputation and trustworthiness.