Identity-Based vs Resource-Based Policies
What you'll learn: You'll understand the two fundamental ways cloud platforms attach permissions — to the identity performing an action or to the resource being accessed.
The Two Permission Models
In cloud IAM, there are two primary ways to grant access:
-
Identity-Based Policies: Attached directly to identities (users, groups, or roles). These policies answer the question: "What can this identity do?"
-
Resource-Based Policies: Attached to the resources themselves (like storage buckets, databases, or queues). These policies answer: "Who can access this resource?"
A Real-World Analogy
Think of a library:
-
Identity-based: Your library card lists what sections you're allowed to enter (children's area, reference room, archives). The permissions travel with you.
-
Resource-based: A special collection room has a sign on the door: "Only faculty members and researchers may enter." The permission is attached to the room itself, regardless of what your library card says elsewhere.
How They Work Together
Both policy types work in conjunction. For an action to succeed, the identity must have permission to perform it (identity-based), AND the resource must allow it (resource-based). If either denies access, the action fails.
Identity-based example: "Alice can read all storage buckets"
Resource-based example: "Bucket-X allows reads from Alice's account"
Most commonly, you'll use identity-based policies to control what your team members can do. Resource-based policies become essential when you need cross-account access or when the resource itself needs to define who can touch it.
Key Takeaway: Identity-based policies attach permissions to who you are; resource-based policies attach permissions to what you're accessing. Both follow the Principle of Least Privilege you learned earlier.