Difference between AWS IAM "Identity" and "Entity"

Viewed 2599

I am reading through the AWS documentation Understanding how IAM works and I'm confused about the definitions for identities and entities.

Identities
The IAM resource objects that are used to identify and group. You can attach a policy to an IAM identity. These include users, groups, and roles.

Entities
The IAM resource objects that AWS uses for authentication. These include IAM users, federated users, and assumed IAM roles.

What's the difference between the two? They are both IAM resource objects. They both include users and roles (although only identities have groups). You can only attach a policy to an identity but not an entity, but you ultimately authenticate an entity but not an identity. Is the naming difference just a question of grammar, or is there something fundamentally different between the two?

3 Answers

My understanding was helped by this diagram from the Wikipedia page on IAM.

Entities represent the actors on the system, and they may each have multiple identities.

Unfortunately this doesn't translate well to IAM resources, and the IAM User Guide itself is pretty loose when referring to entities, identities, and principals (it often seems to use them interchangeably). As you've already noticed, identities are special since they can have policies attached to them directly. While some entities can have policies attached to them (since they also happen to be identities), that's more of an implementation detail, rather than a feature.

As far as I understand an Entity is about authentication where as Identities are about authorization.

For example, let's say we can have two entities (Admin Andy & Janitor Jerry). Both can login because they are both entities. Admin Andy (the entity) is a "User". As a "User" he also has the identity of "User Admin Andy". Janitor Jerry (the entity) is also a "User". As a "User" he has the identity of "User Janitor Jerry".

There might exist a Group called "Janitors" which has permissions to access the mop closet. This "Group" is an Identity but not an Entity. The policy defining access to the mop closet would then be attached to the Group not the User.

There might be another policy which gets attached to the User Identity for Jerry called "Jerries Locker Access".

An alternative way to handle the "Janitors" group is to define a Role called "Janitor" instead of defining a Group called "Janitors". You would attach the policy for the mop closet to the "Janitor Role" and attach the "Janitor Role" to the User "Jerry".

Conclusion:

Entities can login.

Identities can Receive permissions in the form of policies.

--

At least that is how I understand it. If I'm wrong, please correct me.

Related