Lesson 1 of 5 Identity Federation and Cross-Account Access

Federating Workforce and Workload Identities

This lesson explains how workforce identity is centralised in one place and federated to every account and application with no long-term IAM user keys, and how workloads follow the same principle with their own federation methods.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how IAM Identity Center works with an external identity provider.
  • Choose a federation method for each kind of workload.
  • Use ABAC with permission sets to serve many projects.

IAM Identity Center

IAM Identity Center gives the workforce single sign-on to every account in the organisation and to business applications. Users sign in once, through the access portal or with aws sso login from the CLI, choose an account and a role, and receive temporary credentials. Nobody needs an IAM user in any account, and removing a person's access in one place removes it everywhere.

Each Identity Center instance has one identity source. It can be the built-in directory; an Active Directory, either AWS Managed Microsoft AD or an on-premises directory through AD Connector; or an external identity provider, such as Okta, Microsoft Entra ID, Ping Identity or Google Workspace. With an external provider, users sign in through SAML 2.0, and users and groups are provisioned automatically through SCIM, so joiners and leavers in the corporate directory are reflected in AWS without manual work.

Access is defined with permission sets, which bundle AWS managed, customer managed and inline policies, an optional permissions boundary and a session duration. Assigning a permission set to a group for an account creates an IAM role in that account, which the group's members can use. Attributes for access control pass identity provider attributes, such as department or cost centre, into sessions as tags, which supports attribute-based access control with one permission set for many teams. Trusted identity propagation carries the individual user's identity into services such as Amazon Redshift, AWS Lake Formation, S3 Access Grants, Amazon Quick Sight and Amazon Q, so data access is authorised and audited per person rather than per shared role.

Workload identity

Workloads, like people, should obtain temporary credentials through federation rather than storing long-term access keys, and the method depends on where the workload runs. GitHub Actions and other CI/CD systems present an OpenID Connect (OIDC) token, which an IAM role trusts, so pipelines deploy without stored secrets. Kubernetes service accounts use IAM roles for service accounts (IRSA) or EKS Pod Identity. Legacy applications may federate with SAML. On-premises servers and other workloads outside AWS use IAM Roles Anywhere, which exchanges an X.509 certificate from a trusted certificate authority for temporary credentials. The following table summarises the methods.

WorkloadFederation method
GitHub Actions and other CI/CDOIDC to an IAM role
Kubernetes service accountsIRSA or EKS Pod Identity
Legacy applicationsSAML
On-premises servers and workloads outside AWSIAM Roles Anywhere, with X.509 certificates from a trusted CA
Worked example

One permission set, many projects with ABAC

A company has 60 project teams. Creating a permission set per project would mean 60 sets to maintain. Instead, the identity provider sends each user's Project attribute, Identity Center passes it as a session tag (attributes for access control), and one permission set compares it with the tag on resources:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ManageOwnProjectInstances",
      "Effect": "Allow",
      "Action": ["ec2:StartInstances", "ec2:StopInstances", "ec2:RebootInstances"],
      "Resource": "arn:aws:ec2:*:*:instance/*",
      "Condition": { "StringEquals": { "aws:ResourceTag/Project": "${aws:PrincipalTag/Project}" } }
    },
    {
      "Sid": "TagNewResourcesWithOwnProject",
      "Effect": "Allow",
      "Action": "ec2:RunInstances",
      "Resource": "*",
      "Condition": { "StringEquals": { "aws:RequestTag/Project": "${aws:PrincipalTag/Project}" } }
    }
  ]
}

When a person moves to another project, the change happens once, in the identity provider, and SCIM provisioning carries it to Identity Center. No policy changes. To stop users simply retagging resources into another project, pair this with a statement that denies ec2:CreateTags on the Project key except at creation.

Check yourself

How are users and groups kept in sync between an external identity provider and IAM Identity Center?

Show answer

With SCIM automatic provisioning, which creates, updates and removes users and groups in Identity Center as they change in the identity provider.

Exam Tips

Remember for the exam

  • An existing identity provider with automatic user provisioning calls for IAM Identity Center with SAML and SCIM.
  • Permission sets become IAM roles in each account to which they are assigned.
  • When on-premises servers need AWS credentials without long-term keys, use IAM Roles Anywhere.
  • ABAC based on identity provider attributes uses attributes for access control (session tags).
  • For CI/CD pipelines without stored keys, use OIDC federation to an IAM role.
  • For per-user auditing of data access in Redshift or S3, use trusted identity propagation.