Sub topic 5
What a permission set is
This chapter assumes you know IAM roles and policy JSON, AWS Organizations basics, and how to run AWS CLI commands. It also assumes you have enabled an organization instance of IAM Identity Center.
A template for roles
A permission set is a template that defines what a person can do in an AWS account. It lives in your Identity Center instance, not in any member account. On its own it grants nothing. Access exists only after you assign the permission set to a user or group for a specific account. Identity Center then creates an IAM role in that account from the template.
A permission set bundles these parts:
| Part | Purpose |
|---|---|
| Name and description | The name identifies the set and appears in the role name. It can be up to 32 characters. |
| AWS managed policies | Policies maintained by AWS, such as `ReadOnlyAccess`. |
| Customer managed policy references | Names of policies that you create in each target account. |
| Inline policy | A custom policy document stored in the permission set. |
| Permissions boundary | A policy that caps the maximum permissions. |
| Session duration | How long a sign-in session lasts. |
| Relay state | The console page opened after sign-in. |
The next chapters cover each policy type and the session settings in detail.
Creating one 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 in a delegated administrator account. --session-duration uses ISO 8601 format. The default is one hour (PT1H) and the maximum is twelve hours (PT12H).
What happens in the member account
After you assign the set to an account, Identity Center creates a role there. Its name follows the pattern AWSReservedSSO_ReadOnlyAuditor_<hash>, and it lives under the IAM path /aws-reserved/sso.amazonaws.com/. The trust policy lets Identity Center assume the role for signed-in users. The role carries the policies from the permission set.
Keep these points in mind:
- The permission set is defined once, but each account gets its own role. Changes to the set reach those roles only after provisioning.
- Do not edit or delete these roles in the member account. Identity Center manages them and will overwrite your changes.
- Renaming is not possible. The name is fixed at creation, so choose one that describes the job, such as
ReadOnlyAuditor, rather than a person or team.
Exercise
You create a permission set named DevAdmin but have not assigned it to any account. Does an IAM role named AWSReservedSSODevAdmin<hash> exist in your member accounts? Why or why not?
Show answer
No. A permission set is only a template stored in Identity Center. A role appears in an account only after you assign the permission set to a user or group for that account, which causes Identity Center to provision the role there.