Sub topic 9
Single sign-on for people with IAM Identity Center
This chapter assumes you know IAM users, roles and policy documents, and that you have an organization with several member accounts. It also assumes you have used sts assume-role, which the previous chapter covered. Here you replace long-lived IAM users with workforce sign-in that spans every account.
The problem with per-account sign-in
With cross-account roles alone, people still need an identity somewhere. If you create an IAM user per person in the management account, you manage passwords, access keys and MFA by hand. If you create users in every account, you multiply that work by the number of accounts. Leavers become a risk because one forgotten user keeps working.
IAM Identity Center (the successor to AWS Single Sign-On) solves this by giving each person one identity and one sign-in. That identity is mapped to roles in many accounts. Credentials are temporary, so there are no access keys to rotate or leak.
The working model
Identity Center is an organization-level service. You enable it once, and it works across all accounts in the organization. It has four parts:
| Part | What it is |
|---|---|
| Identity source | Where users and groups come from. |
| Permission set | A reusable template of permissions, defined once. |
| Assignment | A link between a principal (user or group), a permission set and an AWS account. |
| Access portal | The sign-in page where people pick an account and role. |
When you create an assignment, Identity Center creates an IAM role in the target account. The role name starts with AWSReservedSSO_ and includes the permission set name. People never sign in to the account directly. They sign in to the portal, and Identity Center uses the role to hand them temporary credentials.
Enabling Identity Center
Enable Identity Center from the management account, or from a delegated administrator account if you have registered one (see the later chapter on trusted access and delegated administrators). Identity Center needs an organization with all features enabled. It also needs a home Region. The Region you pick holds the configuration and cannot be changed afterward without deleting the instance, so choose it deliberately, typically the Region closest to your users or your main operations.
Two instance types exist. An organization instance is tied to your organization and can assign access to member accounts. An account instance is limited to supported applications in a single account and cannot assign account access. For a multi-account strategy you want the organization instance.
Choosing an identity source
You pick one identity source at a time:
- Identity Center directory. Users and groups live inside Identity Center. This is the quickest start and suits small teams or labs.
- Active Directory. You connect AWS Managed Microsoft AD or a self-managed directory through AD Connector or a trust. Choose this if Active Directory is already your system of record.
- External identity provider. You connect Okta, Microsoft Entra ID or another provider using SAML 2.0. Sign-in happens at your provider. Users and groups are usually synchronized into Identity Center using SCIM.
For most companies the external provider is the right target. HR offboarding then disables the person in one place, and the change flows to AWS.
Changing the identity source later is possible but disruptive. Assignments reference users and groups, and switching sources can break those links. Settle this early.
Permission sets
A permission set describes what a person can do once signed in. It can contain:
- AWS managed policies, such as
ReadOnlyAccessor the job-function policies. - Customer managed policies, which must already exist by name in every target account.
- An inline policy written in the permission set itself.
- A permissions boundary.
- A session duration, from one hour to twelve hours.
Design permission sets around jobs, not people. A short list such as PlatformAdmin, Developer, ReadOnly and Billing is easier to audit than dozens of one-off sets.
Customer managed policies are a common source of errors. If a permission set refers to a policy named TeamBoundary and an account has no policy with that exact name, provisioning fails for that account. Create such policies in every account first, for example with your baseline automation.
A permission set also interacts with SCPs. The effective permissions in a member account are the intersection of the SCPs that apply to that account and the role's policies. An assignment can grant AdministratorAccess and still be blocked by an SCP deny. Many "access denied" tickets for administrators trace back to this.
Assigning access with groups
Assign groups, not individual users. A group such as app1-developers can be assigned the Developer permission set in the prod-app1 account. Membership then controls access, and your identity provider manages membership.
You can create an assignment from the CLI. The sso-admin commands take the instance ARN and the permission set ARN. Find the instance first:
aws sso-admin list-instances
aws sso-admin create-account-assignment \
--instance-arn arn:aws:sso:::instance/ssoins-examplea1b2c3d4 \
--target-id 111122223333 \
--target-type AWS_ACCOUNT \
--permission-set-arn arn:aws:sso:::permissionSet/ssoins-examplea1b2c3d4/ps-examplee5f6a7b8 \
--principal-type GROUP \
--principal-id 90670e1234-example-group-idThe call is asynchronous. It returns a request status, and the role appears in the account a short time later.
You can also assign a permission set to an OU's accounts one by one, but Identity Center does not assign to an OU as a unit. When you create new accounts, your automation needs to create their assignments too.
Changing a permission set after assignment
Editing a permission set does not update the roles in accounts right away. Identity Center marks the accounts as out of date, and you must re-provision the set to push the change. This is a frequent gotcha: you edit a policy, nothing changes for users, and the cause is a missing re-provision step.
aws sso-admin provision-permission-set \
--instance-arn arn:aws:sso:::instance/ssoins-examplea1b2c3d4 \
--permission-set-arn arn:aws:sso:::permissionSet/ssoins-examplea1b2c3d4/ps-examplee5f6a7b8 \
--target-type ALL_PROVISIONED_ACCOUNTSUsing the CLI with Identity Center
Developers can sign in from a terminal without access keys. Configure a profile with the guided command, then log in:
aws configure sso
aws sso login --profile prod-app1-developer
aws sts get-caller-identity --profile prod-app1-developeraws configure sso asks for the start URL of the portal, the Region, an account and a permission set. aws sso login opens a browser for sign-in and caches a token. The CLI then fetches short-lived role credentials as needed. When the session expires, run aws sso login again.
Security practices
- Require MFA in the identity source, or in Identity Center if you use its own directory. Prefer phishing-resistant methods such as passkeys or security keys.
- Keep session durations short for privileged permission sets, and longer for read-only ones.
- Keep a break-glass path. If the identity source or Identity Center has an outage, you need a way in. Create a small number of IAM users or a locked-down emergency role in the management account, protect them with hardware MFA, and alert on their use through CloudTrail.
- Do not give people direct access to the management account for daily work. Assign powerful permission sets there only to a small administrator group.
Common errors
| Symptom | Likely cause |
|---|---|
| Policy edit has no effect | The permission set was not re-provisioned. |
| Provisioning fails in some accounts | A customer managed policy is missing in those accounts. |
| Administrator is denied an action | An SCP in the account's path denies it. |
| Users disappear after changing the source | Assignments referenced users from the old source. |
| CLI says the token has expired | The cached portal token ended. Run `aws sso login`. |
Exercise
A developer was assigned the Developer permission set in prod-app1. You add an S3 permission to the permission set, but the developer still gets AccessDenied on S3. List two things to check, in order.
Show answer
First, confirm the permission set was re-provisioned to the account, because edits do not reach existing roles until you run provision-permission-set. Second, check whether an SCP on the account or its parent OUs denies the S3 action, since SCPs limit the role even if the permission set allows the action.
Exercise
Why should you assign permission sets to groups rather than to individual users, and where should group membership be managed?
Show answer
Group assignments keep the number of assignments small and make access follow membership, so adding or removing a person changes their access everywhere without touching Identity Center assignments. Membership should be managed in the identity source, usually the external identity provider, and synchronized by SCIM.