Sub topic 5
What a Permission Set Is
This chapter assumes you know IAM roles and policy JSON, and that you have a working idea of AWS Organizations, with a management account, member accounts, and OUs. You should also be comfortable running AWS CLI commands. It covers what a permission set contains, where it lives, and how to create one. Assignment, provisioning, and the details of each policy type get their own chapters.
The definition
A permission set is a template for IAM permissions, stored in your IAM Identity Center instance. It is not an IAM role, and it grants nothing by itself. It becomes useful when you assign it to a principal (a user or group) for a specific AWS account. At that point Identity Center creates an IAM role in that account from the template. People who sign in through the access portal assume that role.
A permission set therefore answers one question: what can someone do once they are in an account? Who gets it and in which accounts are answered separately by account assignments.
Where it lives
A permission set belongs to one Identity Center instance. For an organization instance, you manage it from the management account or from a delegated administrator account. Member accounts do not have the permission set object. They only receive the role that results from an assignment.
This has two practical consequences:
- You define the permissions once. Changing the template and re-provisioning it updates the role in every account that uses it.
- The same permission set produces independent roles in different accounts. Each role is a separate IAM object. What its policies can do depends on resources in that account, and on any service control policies applied to it.
What a permission set contains
| Part | Required | Purpose |
|---|---|---|
| Name | Yes | Identifies the permission set. It cannot be changed after creation, and it appears in the generated role name. |
| Description | No | Free text for people reading the console or CLI output. |
| Session duration | No | How long credentials from this permission set stay valid. The default is one hour. |
| Relay state | No | A console URL to open after sign-in. |
| AWS managed policies | No | Policies maintained by AWS, attached by ARN. |
| Customer managed policy references | No | Names and paths of policies that you create in each target account. |
| Inline policy | No | A single policy document stored inside the permission set. |
| Permissions boundary | No | A managed policy that limits the maximum permissions the role can have. |
A permission set with no policies is valid, but anyone who assumes the resulting role can do almost nothing. Permissions come only from what you attach.
The effective permissions of the role are the union of the attached policies and the inline policy, limited by the permissions boundary if you set one. Service control policies and any resource policies then apply as they would for any other role.
Session duration and relay state are covered in their own chapter. Policy types and the permissions boundary are covered in the next one. Here it is enough to know that all of these belong to the template.
Name rules
Permission set names can contain letters, digits, and the characters _+=,.@-, up to 32 characters. Because the name is permanent, pick one that describes the access, not the team, for example ReadOnlyAuditor or NetworkAdmin. A team name goes stale when teams are reorganized. A description of the access stays true.
What the template becomes in an account
When you assign a permission set to an account, Identity Center creates a role there. Its name has this shape:
AWSReservedSSO_<PermissionSetName>_<hash>The role sits under the path /aws-reserved/sso.amazonaws.com/, or a Region-specific variant of it. The trust policy lets Identity Center, acting through the SAML sign-in, assume the role. Do not edit or delete these roles by hand. Identity Center owns them and will overwrite your changes the next time it provisions. If you need different permissions, change the permission set.
Creating a permission set with the CLI
The following commands create a permission set with a four-hour session and attach the AWS managed ReadOnlyAccess policy.
INSTANCE_ARN=$(aws sso-admin list-instances --query 'Instances[0].InstanceArn' --output text)
PS_ARN=$(aws sso-admin create-permission-set \
--instance-arn "$INSTANCE_ARN" \
--name ReadOnlyAuditor \
--description "Read-only access for auditors" \
--session-duration PT4H \
--query 'PermissionSet.PermissionSetArn' --output text)
aws sso-admin attach-managed-policy-to-permission-set \
--instance-arn "$INSTANCE_ARN" \
--permission-set-arn "$PS_ARN" \
--managed-policy-arn arn:aws:iam::aws:policy/ReadOnlyAccessRun these in the management account or the delegated administrator account, in the Region where Identity Center is enabled. Three things to notice:
list-instancesreturns the instance ARN that everysso-admincall needs. The command is not account-specific, so it works anywhere you can reach the instance.--session-durationuses ISO 8601 durations, so four hours isPT4H. Valid values run from one to twelve hours.create-permission-setreturns an ARN of the formarn:aws:sso:::permissionSet/ssoins-.../ps-.... You use this ARN in every later call, so keep it in a variable.
At this point no role exists in any account. You can confirm that by listing assignments, which returns nothing for this permission set:
aws sso-admin list-account-assignments-for-principal --help >/dev/null 2>&1 && \
aws sso-admin list-accounts-for-provisioned-permission-set \
--instance-arn "$INSTANCE_ARN" \
--permission-set-arn "$PS_ARN"An empty AccountIds list means the permission set is defined but not provisioned anywhere.
Common errors
- Expecting a change to take effect immediately. When you edit a permission set that is already assigned, the console usually prompts you to re-provision. With the CLI or an API, the template changes and the roles in the accounts stay as they were until you call
provision-permission-set. The state is "out of date", not "broken". - Trying to rename a permission set. The name is fixed. To change it, create a new permission set, move the assignments, and delete the old one.
- Looking in a member account for the permission set. It is not there. Only the generated role is.
- Editing the generated role in IAM. Your change is lost at the next provisioning, and the role is protected from modification in most cases. Change the template instead.
- Putting everything in one inline policy. Inline policies have a size limit, and they are copied into each account. Prefer AWS managed policies where they fit, and customer managed policy references where you need custom logic that must be the same everywhere.
- Creating the permission set in the wrong place. Running
sso-admincalls from a member account fails or targets the wrong instance. Check which account and Region you are in before you create anything.
Design guidance
Make each permission set represent one job function, not one person or one account. A good test is whether you can describe it in a few words, such as "read-only auditor", "database administrator", or "billing viewer". The same permission set can then be assigned to many groups and accounts without change. If you find yourself creating AdminTeamA and AdminTeamB with identical policies, you want one permission set and two assignments.
Exercise
A permission set named ReadOnlyAuditor exists in Identity Center, but no one can use it in account 111122223333. You check the account's IAM roles and find no role whose name starts with AWSReservedSSO_ReadOnlyAuditor. What is the most likely reason, and what do you do?
Show answer
The permission set has no account assignment for that account. A permission set is only a template, and Identity Center creates the role in an account when a principal is assigned the permission set there. Create an account assignment that links a user or group, the permission set, and account 111122223333. You can confirm the cause with list-accounts-for-provisioned-permission-set, which would not include that account.
Exercise
You change the inline policy of an assigned permission set using the CLI, but users in the target accounts still have the old permissions. Which command fixes this, and why was it needed?
Show answer
Run aws sso-admin provision-permission-set with the instance ARN, the permission set ARN, and --target-type ALLPROVISIONEDACCOUNTS. Editing the permission set changes only the template. The roles already created in the accounts keep their old policies until the updated permission set is provisioned to them.