An AWS resource-based policy is a set of access rules attached to a cloud resource, saying who may use it.
This guide is for anyone who has heard the term and wants a plain answer. You do not need to write code. If your business keeps files or data in Amazon Web Services (AWS), some of it is probably guarded by rules like these.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of December 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
In short
- Most AWS rules sit on a person or program and say what it can do. A resource-based policy sits on the thing being used, such as a storage bucket, and says who can use it.
- These rules can let people and programs from other AWS accounts in, which is useful for sharing.
- One star symbol in the "who" part can mean "anyone at all", including strangers on the internet.
- Name the exact accounts you trust, keep public access blocked unless it is planned, and review sharing reports.
What you will learn
- Explain the difference between rules on a person and rules on a resource.
- Spot a resource rule that lets everyone in.
- Check which of your resources are shared outside your account.
- Ask your cloud team clear questions about who can reach your data.
- Thing being used (resource)
- an item in the cloud, such as a storage bucket, a message queue or an encryption key.
- Who is asking (principal)
- the person, program or account that wants to use a resource.
- Rule sheet (policy)
- a short document that lists who may do what, and what is not allowed.
What is an AWS resource-based policy?
Think of a guest list pinned to the door of a private room. The list belongs to the room, not to the guests. Anyone whose name is on it may walk in.
AWS has two main kinds of rule sheet. An identity-based policy (a rule sheet attached to a user, group or role) says what that identity can do [1]. A resource-based policy is attached to the resource itself. It says who can use the resource and what they can do with it [1].
Storage buckets, message queues, encryption keys and some database tables can all carry this kind of rule [1]. The "who" part is written in a field called the principal [2].
Where the comparison stops working: a guest list names people. A resource rule can name a whole AWS account, a cloud service, or a star that means everyone. A guest list at a door is easy to see, but these rules are spread across many resources.
New to AWS rules in general? Start with AWS IAM for Beginners. This page looks only at rules that live on the resource.
Why does it matter?
Resource rules are a common way to share data between accounts. A small mistake in one of them can open that data to far more people than planned.
If you own business data in AWS
What could happen: a bucket rule written for one partner is widened "for testing" and lets anyone read your files.
Check this: ask your cloud team which of your buckets are shared outside your account, and why.
If you are new to cloud work
What could happen: you copy a rule from a forum post, and its star symbol makes a resource public.
Check this: read the "who" part of every rule before you save it.
If you manage a cloud team
What could happen: access granted to a supplier years ago is still there after the contract ends.
Check this: ask for a list of outside accounts named in your resource rules, with an owner for each.
What does it look like?
Here is a made-up rule for a storage bucket. Rules like this are written in a text format called JSON.
Example only. All values are made up.
{
"Effect": "Allow", (1)
"Principal": "*", (2)
"Action": "s3:GetObject", (3)
"Resource": "arn:aws:s3:::EXAMPLE-reports-bucket/*" (4)
}
- This rule gives access. Other rules can deny it.
- The "who" part. A star here means anyone, including people who are not signed in.
- The action allowed: reading files from the bucket.
- In a real file, this line would contain the name of the bucket the rule protects.
Why this is risky: AWS says a star in the "who" part of an allow rule grants access to all users, including anonymous users [2]. Everyone on the internet could read these reports, unless another setting blocks it.
The safer way: name the exact account or role that needs access, and allow only the actions it needs.
How does it work?
- Someone asks to use a resource. A program in your account, or in another account, asks to read a file in a bucket.
- AWS reads the rules on the asker. It checks the identity-based policy attached to that user or role.
- AWS reads the rule on the resource. It checks whether the bucket's own policy names the asker.
- A "deny" anywhere wins. If any rule says no, the answer is no.
- Across accounts, both sides must agree. When the asker is in a different account, the asker's own rules must allow the request, and the resource rule must allow it too [3].

Resource rules are written directly on the resource. You cannot save one copy and reuse it on many resources, as you can with some identity rules [1]. That is one reason they are easy to lose track of.
AWS has a guard for storage buckets called Block Public Access (a setting that overrides public rules). By default, new buckets do not allow public access [4]. If someone turns the guard off, an old public rule can work again [4].

To find shared resources, AWS offers IAM Access Analyzer. It reads your resource rules and creates a finding for each resource shared outside your account [5]. You then decide if each one is planned and safe.
A worked example
This story is made up to show the idea.
Keisha Robinson runs a small online print shop. Her sales reports live in an AWS storage bucket. Logan Pierce, a freelance developer, looks after the shop's cloud account.
An accounting firm needs to read the monthly reports. Logan adds a rule to the bucket. To get it working fast, he puts a star in the "who" part and plans to tidy it later.
A week later Keisha asks a simple question: "Who can see our sales reports now?" Logan opens the sharing report in IAM Access Analyzer. It shows a finding for the reports bucket, shared outside the account.
Logan checks the bucket. Block Public Access is still on, so in the records they can see, the files were not open to the internet. Still, the rule is far wider than it should be.
Logan rewrites the rule. The "who" part now names only the accounting firm's AWS account. The rule allows reading files and nothing else. He writes the firm's name and an end date in the shop's access list.
Keisha adds a new line to her yearly supplier review. It says: "Check who our cloud data is shared with." When the accounting contract ends, Logan removes the firm's account from the rule.
Keisha learned that a rule on the resource can open the door to outsiders. Naming the exact visitor, and reviewing the list, keeps sharing under control.
Myths and mistakes
| What people think | What is true |
|---|---|
| If my users have tight rules, my data is safe. | A rule on the resource can let in people from other accounts. Check both kinds of rule. |
| A star just means "everyone in my company". | In an allow rule on a resource, a star can mean anyone, including anonymous users. |
| Once a partner leaves, their access ends. | Their account stays in the rule until someone removes it. |
| Turning off Block Public Access is harmless if no bucket looks public. | Old public rules can start working again once the guard is off. |
| A quick "temporary" wide rule is fine. | Temporary rules are easy to forget. Add an owner and an end date, or write it narrowly from the start. |
What can I do this week?
- Ask your cloud team if IAM Access Analyzer is on, and how many sharing alerts are open.
- Ask for a list of outside accounts named in your resource rules, with an owner for each.
- Check that Block Public Access is on for your storage, unless a bucket is meant to be public.
- Pick one shared resource and confirm the business reason for sharing it is still true.
Checklist
- I can explain the difference between rules on an identity and rules on a resource.
- I know a star in the "who" part can mean anyone at all.
- Every outside account named in our resource rules has an owner and a reason.
- Resource rules allow only the actions that are needed.
- Block Public Access stays on unless public access is planned and approved.
- Someone reviews sharing findings on a regular schedule.
- Access is removed when a partner or supplier contract ends.
Common questions
What is the difference between identity-based and resource-based policies?
The difference is where the rule lives. An identity-based policy is attached to a user, group or role and says what that identity can do. A resource-based policy is attached to the resource, such as a bucket, and says who can use it and how.
Which AWS resources can have a resource-based policy?
Many can, but not all. AWS lists storage buckets, message queues, encryption keys, some database tables and several others as examples. Your cloud team can check AWS's list of services for the ones you use.
Can a resource-based policy let in people from another company?
Yes, that is one of its main uses. The rule can name another AWS account. For the request to work, that other account must also allow its own user or program to make the request. Both sides need to say yes.
Does a resource-based policy affect AI agents and other software?
Yes. Programs, scripts and AI agents use AWS roles, which are a kind of non-human identity. A resource rule that names a role, or uses a star, decides whether that software can reach the data. The same care applies.
How do I find resources that are shared too widely?
Use a tool that reads the rules for you. IAM Access Analyzer reviews resource rules and lists each resource shared outside your account. Someone then checks every finding and either approves it or narrows the rule.
Where next?
Ready for the detail? Read the practitioner guide: AWS Resource-Based Policies Guide. It goes further into condition keys, organisation-wide guardrails and how to review resource rules at scale.
Also useful:
- Cross-Account Roles vs Resource-Based Policies
- AWS IAM for Beginners
- AWS Permission Boundaries for Beginners
- AWS Role Chaining for Beginners
Related NHI Mgmt Group resources: Cloud Storage Buckets for Beginners, Least Privilege for Beginners and Non-Human Identities for Beginners.
Key terms
- Resource-based policy
- A rule sheet that lives on a resource and says which identities can use it.
- Identity-based policy
- A rule sheet attached to a user, group or role that says what it may do.
- AWS IAM policy
- An AWS rule document that allows or denies actions on resources, attached to identities or resources.
- Cross-account access
- A trust that lets an identity in one account reach resources in another account.
- Least privilege
- Giving each person or program only the access it needs for its job.
- Principal
- The "who" part of a rule: the user, role, account or service that is allowed or denied.
Sources and further reading
- Amazon Web Services, "Identity-based policies and resource-based policies", AWS Identity and Access Management User Guide. https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html (accessed 4 Dec 2026).
- Amazon Web Services, "AWS JSON policy elements: Principal", AWS Identity and Access Management User Guide. https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html (accessed 4 Dec 2026).
- Amazon Web Services, "Cross-account policy evaluation logic", AWS Identity and Access Management User Guide. https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic-cross-account.html (accessed 4 Dec 2026).
- Amazon Web Services, "Blocking public access to your Amazon S3 storage", Amazon S3 User Guide. https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html (accessed 4 Dec 2026).
- Amazon Web Services, "What is IAM Access Analyzer?", AWS Identity and Access Management User Guide. https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html (accessed 4 Dec 2026).