Implementing Role-Based and Attribute-Based Access Control
As organisations grow, the way permissions are organised matters as much as the permissions themselves. Role-based access control assigns permissions by job function; attribute-based access control grants access by matching attributes, such as tags, of principals and resources. This lesson explains both models, how they are implemented in IAM and IAM Identity Center, and how to choose between and combine them.
Learning outcomes
After completing this lesson, you will be able to:
- Explain role-based access control and how it is implemented with IAM roles and Identity Center permission sets.
- Explain attribute-based access control using principal tags, resource tags and request tags.
- Describe session tags and how identity provider attributes flow into ABAC decisions.
- Compare RBAC and ABAC and describe the controls that keep tags trustworthy.
Role-Based Access Control
In role-based access control (RBAC), permissions are attached to roles that represent job functions, such as developer, operator, auditor or database administrator, and people receive roles according to their function. On AWS, RBAC is implemented with IAM roles in each account and, for people, with IAM Identity Center permission sets: a permission set defines policies once, and assigning a group to a permission set in an account creates the corresponding role there. Group membership in the corporate directory then controls access across all accounts.
RBAC is easy to understand and audit, but it scales poorly when access depends on many combinations of function and resource ownership. If each of 50 teams needs developer access only to its own resources, RBAC requires 50 developer roles, each listing that team's resources, and every new resource or team requires policy changes. This is called role explosion.
Attribute-Based Access Control
In attribute-based access control (ABAC), policies grant access when attributes match. On AWS, the attributes are tags: tags on the principal (aws:PrincipalTag), tags on the resource (aws:ResourceTag) and tags in the request (aws:RequestTag and aws:TagKeys). One policy, such as "developers may start and stop instances whose Project tag equals their own Project tag", serves every team, and new resources and people are covered as soon as they are tagged.
{
"Version": "2012-10-17",
"Statement": [
{"Sid": "ManageOwnProjectInstances", "Effect": "Allow",
"Action": ["ec2:StartInstances", "ec2:StopInstances", "ec2:RebootInstances"],
"Resource": "*",
"Condition": {"StringEquals": {"aws:ResourceTag/Project": "${aws:PrincipalTag/Project}"}}},
{"Sid": "CreateOnlyWithOwnProjectTag", "Effect": "Allow",
"Action": ["ec2:RunInstances", "ec2:CreateTags"],
"Resource": "*",
"Condition": {"StringEquals": {"aws:RequestTag/Project": "${aws:PrincipalTag/Project}"},
"ForAllValues:StringEquals": {"aws:TagKeys": ["Project", "Environment", "Name"]}}}
]
}Not every action supports tag-based conditions, so ABAC policies must be checked against the service authorisation reference, and some services support only some condition keys.
The following diagram shows one ABAC policy deciding three requests.

ABAC condition keys
Session Tags and Identity Provider Attributes
For people, principal tags usually come from the corporate identity provider. When a user federates through SAML or OIDC, or signs in through IAM Identity Center with attributes for access control enabled, attributes such as department, cost centre or project are passed as session tags and become aws:PrincipalTag values for that session. A user who moves to another project receives the new attribute in the directory and immediately gets access to the new project's resources, without any IAM change. Session tags can also be passed by applications calling AssumeRole, and EKS Pod Identity adds session tags for the cluster and namespace, which supports ABAC for pods. Transitive session tags persist through role chaining.
Keeping Tags Trustworthy
ABAC is only as secure as the tags. If a developer can change a resource's Project tag or their own principal tags, they can grant themselves access. The following controls protect tags.
- Deny
iam:TagRole,iam:UntagRole,iam:TagUserand similar actions to non-administrators, so principals cannot change their own tags. - Allow tagging of resources only with conditions that require the principal's own value, and deny changing the access-control tag keys on existing resources except through approved automation.
- Use SCPs to protect access-control tags organisation-wide.
- Use tag policies in Organizations to standardise tag keys and values, and enforce them on resource types where supported.
- Monitor tag changes with AWS Config and EventBridge rules on tagging API calls.
Choosing RBAC, ABAC or Both
The two models are complementary. RBAC defines what a job function may do; ABAC narrows it to the resources that belong to the person's team or project. The comparison below summarises their characteristics.
RBAC or ABAC?
Access for 40 Product Teams
Forty product teams share several AWS accounts. Each developer may operate only the resources of their own team, teams are reorganised frequently, and the IAM team cannot maintain 40 sets of policies.
-
Function roles
Create Developer and Operator permission sets in IAM Identity Center (RBAC by function).
-
Attributes
Enable attributes for access control and map the directory's team attribute to the session tag Team.
-
ABAC policies
Write the permission sets' policies with conditions that aws:ResourceTag/Team equals aws:PrincipalTag/Team, and require aws:RequestTag/Team on creation.
-
Protect tags
Deny changing the Team tag except to a tagging automation role, enforce tag values with a tag policy, and alert on tagging API calls.
In an ABAC design, what prevents a developer from tagging another team's instance with their own Team value to gain access?
Show answer
Policies (and preferably an SCP) that deny changing the Team tag on existing resources, except for an approved automation role, combined with monitoring of tagging actions.
Exam Tips
Remember for the exam
- RBAC assigns permissions by job function (IAM roles, Identity Center permission sets); it can cause role explosion.
- ABAC matches aws:PrincipalTag with aws:ResourceTag and requires aws:RequestTag on creation; new resources are covered when tagged.
- Session tags from the identity provider (attributes for access control in Identity Center) supply principal attributes.
- Protect access-control tags with IAM and SCP denies, tag policies and monitoring.