AWS resource policies should not grant access to every principal with a wildcard
This check looks at resource-based policies, such as those on S3 buckets or queues, for a Principal of "*" that is not limited by a condition. The safe setting is to name specific accounts, roles or an organization instead of everyone.
Why it matters
In a resource-based policy, a Principal of "*" means anyone, including people with no AWS account at all, unless a condition narrows it. A policy like that on a bucket, queue, key or secret can expose data or let strangers call the resource. These policies are easy to write by accident while testing and then forgotten.
AWS documents how the Principal element works and warns about wildcard use in the IAM Principal element reference. IAM Access Analyzer can report resources shared outside your account or organization; see What is IAM Access Analyzer.
How to check it yourself
In the AWS console open IAM > Access Analyzer and review the external access findings. For a single resource, open its permissions or policy tab and look for statements with "Principal": "*" and no restricting condition.
Read-only commands (they only list and read):
aws accessanalyzer list-analyzers
aws accessanalyzer list-findings-v2 --analyzer-arn ANALYZER_ARN
aws s3api get-bucket-policy --bucket BUCKET_NAME --query Policy --output textA statement is acceptable when a condition such as aws:PrincipalOrgID or aws:SourceAccount limits who can use it; a bare wildcard is not.
How to fix it
Replace the wildcard with the specific account IDs, roles or users that need access. If a whole organization needs access, keep the wildcard only together with a condition on your organization ID. If the resource really is meant to be public, such as a website bucket, document that decision and keep the policy as narrow as possible.
Example for an S3 bucket policy, saved to a file and then applied (this changes your account, so review it and apply it yourself; ConfigCobra never changes your environment):
aws s3api put-bucket-policy --bucket BUCKET_NAME --policy file://policy.jsonIn policy.json, set Principal to the specific role ARN, or keep "*" only with an aws:PrincipalOrgID condition.
What changes when you fix it
Anyone who reached the resource anonymously, or from an account you did not intend, loses access. That can include old integrations, partner accounts or public links that nobody remembered. Before tightening, check the resource's access logs to see who actually uses it, add the needed principals by name first, then remove the wildcard. Users and services inside the named accounts keep working unchanged.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Amazon Web Services Foundations v7.0.0 | 2.21 | Level 1 |
Check this on your AWS
ConfigCobra runs this check with every other control of the CIS Amazon Web Services Benchmarks, read-only.