| name | cis-aws-foundations-2.21 |
| description | Ensure AWS resource policies do not allow unrestricted access using "Principal": "*" |
| category | cis-iam |
| version | 7.0.0 |
| author | cyberstrike-official |
| tags | ["cis","aws","iam","resource-policies","principal-wildcard","s3","sqs","sns","lambda","least-privilege"] |
| cis_id | 2.21 |
| cis_benchmark | CIS AWS Foundations Benchmark v7.0.0 |
| tech_stack | ["aws"] |
| cwe_ids | [] |
| chains_with | ["cis-aws-foundations-2.14","cis-aws-foundations-2.18"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure AWS resource policies do not allow unrestricted access using "Principal": "*"
Description
Ensure AWS resource-based policies, such as Amazon S3 bucket policies, Amazon SQS queue policies, Amazon SNS topic policies, and AWS Lambda resource policies, do not grant unrestricted access using "Principal": "*" with "Effect": "Allow" unless the policy includes restrictive conditions that limit access to specific trusted identities, accounts, services, or network boundaries.
Rationale
Resource-based policies are evaluated alongside identity-based IAM policies during authorization decisions. When a policy statement specifies "Principal": "*" with "Effect": "Allow", it grants the specified permissions to any AWS principal unless additional conditions restrict the request. This may unintentionally allow access from users, roles, or services in any AWS account. Such broad access significantly increases the risk of unauthorized data access, resource abuse, or data exfiltration.
Impact
Unrestricted resource-based policies may expose data or services to unauthorized access, potentially leading to data breaches, service misuse, or unintended public exposure.
Audit Procedure
- Identify resources that support resource-based policies within the AWS account, such as S3 buckets, SQS queues, SNS topics, and Lambda functions
- Retrieve the resource policies for each resource. Example CLI commands:
SQS Queue Policies
aws sqs get-queue-attributes \
--queue-url https://sqs.region.amazonaws.com/account/QUEUE \
--attribute-names Policy
S3 Bucket Policies
aws s3api get-bucket-policy \
--bucket YOUR-BUCKET-NAME
SNS Topic Policies
aws sns get-topic-attributes \
--topic-arn TOPIC-ARN \
--query "Attributes.Policy" \
--output text
- Inspect the retrieved policies and identify statements containing:
- Evaluate whether the statement includes restrictive conditions such as:
aws:SourceArn
aws:SourceAccount
aws:PrincipalArn
- Other service-specific condition keys