IAM at Scale: Boundaries, Federation, STS and ABAC
Overview
Identity is the first control plane of AWS. At small scale you create users and attach policies; at enterprise scale that approach collapses. DOP-C02 expects you to use roles instead of long-lived keys, federation instead of IAM users, permissions boundaries to delegate administration safely, and tag-based (ABAC) policies so one policy serves hundreds of teams.
Think of a hotel. Staff do not get a personal copy of the master key; they badge in and receive a temporary key card for specific floors (STS and roles). The hotel's security rules (SCPs and boundaries) cap what any card can ever open, even if a manager tries to program something broader.
The exam repeatedly tests which tool limits permissions (SCP, boundary, session policy) versus which tool grants them (identity-based and resource-based policies), and how cross-account and machine identities get credentials without static secrets.
Key Concepts
- Effective permissions are the intersection of SCPs, permissions boundary, session policy and the identity or resource policy; an explicit Deny always wins.
- A permissions boundary is a managed policy that sets the maximum permissions an IAM user or role can have; it grants nothing by itself and enables safe delegation.
- A session policy passed to AssumeRole or federation further restricts a single session; it can never expand permissions.
- AWS STS issues temporary credentials: AssumeRole, AssumeRoleWithSAML, AssumeRoleWithWebIdentity, GetSessionToken (for MFA) and GetFederationToken.
- IAM Identity Center gives workforce SSO across accounts through permission sets, with an external IdP (SAML/SCIM) or its own directory.
- Cross-account access needs a trust policy in the target role and an identity policy allowing sts:AssumeRole in the source; use ExternalId for third parties.
- ABAC compares principal tags with resource tags (aws:PrincipalTag, aws:ResourceTag) so access scales without new policies.
- Cognito federates customer identities (user pools, identity pools) to AWS credentials; IAM roles for EC2/ECS/EKS (IRSA, Pod Identity)/Lambda remove static keys for machines.
Detailed Notes
Which control does what
| Control | Grants permissions? | Scope | Typical use |
|---|---|---|---|
| SCP | No (filter only) | Accounts and OUs in an organisation | Region restriction, deny leaving the org, protect security tooling |
| Permissions boundary | No (ceiling) | One IAM user or role | Let developers create roles but only within a limit |
| Session policy | No (restricts) | One STS session | Narrow a broad role for a single task |
| Identity-based policy | Yes | User, group or role | Everyday permissions |
| Resource-based policy | Yes (can be cross-account) | S3, KMS, SQS, Lambda, role trust | Cross-account access without assuming a role |
| RCP (resource control policy) | No (filter) | Resources in organisation | Data perimeter: deny access from outside the org |
Within one account, an identity policy or a resource policy is enough to allow a same-account principal. Across accounts both sides must allow, except when the principal assumes a role in the resource's account.
Delegating administration with permissions boundaries
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["iam:CreateRole", "iam:AttachRolePolicy", "iam:PutRolePermissionsBoundary"],
"Resource": "arn:aws:iam::111122223333:role/app-*",
"Condition": {
"StringEquals": {
"iam:PermissionsBoundary": "arn:aws:iam::111122223333:policy/AppTeamBoundary"
}
}
}
]
}
The condition forces any role the developer creates to carry the boundary, so they cannot escalate beyond it. Pair it with a deny on iam:DeleteRolePermissionsBoundary and on editing the boundary policy itself. This pattern is the standard answer to "let teams create their own roles without becoming administrators".
Federation patterns
| Population | Preferred approach |
|---|---|
| Workforce (employees) | IAM Identity Center with corporate IdP, permission sets per account, short sessions |
| Legacy SAML apps in one account | IAM SAML identity provider + role |
| Mobile/web customers | Cognito user pools + identity pools |
| CI/CD (GitHub Actions, GitLab) | OIDC identity provider and a role with trust conditions on repo/branch (no stored keys) |
| Third-party SaaS | Cross-account role with ExternalId to prevent the confused deputy problem |
| On-premises servers | IAM Roles Anywhere with X.509 certificates, or SSM hybrid activations |
aws sts assume-role --role-arn arn:aws:iam::444455556666:role/DeployRole \
--role-session-name pipeline --duration-seconds 900 \
--policy-arns arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
The optional policy ARN is a session policy; the session gets the intersection of the role and that policy.
ABAC example
{
"Effect": "Allow",
"Action": ["ec2:StartInstances", "ec2:StopInstances"],
"Resource": "*",
"Condition": {
"StringEquals": { "aws:ResourceTag/team": "${aws:PrincipalTag/team}" }
}
}
With IAM Identity Center, attributes from the IdP become principal tags, so adding a new team only needs tags, not new policies. Enforce tagging through tag policies, SCPs requiring tags on creation, and Config rules.
MFA and credential hygiene
- Enforce MFA with a condition on
aws:MultiFactorAuthPresent(andaws:MultiFactorAuthAge) for sensitive actions; STS GetSessionToken with an MFA code is how CLI users obtain MFA-backed credentials. - Prefer roles for machines; where keys are unavoidable rotate through Secrets Manager and alarm on keys older than 90 days using the IAM credential report or Config rule
access-keys-rotated. - Use IAM Access Analyzer policy generation from CloudTrail to produce least-privilege policies and validation to catch overly broad ones.
Common failure causes
Implicit deny from a missing boundary allowance, an SCP in the path that blocks the action, a KMS key policy that does not trust the role, or a trust policy with the wrong principal. The IAM policy simulator and CloudTrail error messages (the errorCode AccessDenied and the explanation text) pinpoint which layer denied the call.
Real World Example
Scenario: a company wants 40 product teams to self-serve IAM roles without central review. The platform team creates a boundary policy limiting services and Regions, then grants each team a role that can create roles only when the boundary is attached. SCPs prevent changing or removing the boundary.
Developers sign in via IAM Identity Center with IdP attributes mapped to a team tag. ABAC policies let each team manage only resources tagged with their team, so onboarding the 41st team requires no policy changes. CI runs use GitHub OIDC roles with no stored keys.
Architecture Diagram
Each layer can only narrow permissions; the grant comes from identity or resource policies.
- 1A user authenticates with the corporate identity provider.
- 2IAM Identity Center issues a session for an assigned permission set via STS.
- 3The SCP in the account limits which actions are possible at all.
- 4The role's permissions boundary and optional session policy narrow the grant.
- 5ABAC conditions compare principal tags with resource tags to allow the call.
Best Practices
- ✓Use IAM Identity Center and roles; avoid IAM users and long-lived access keys.
- ✓Delegate role creation only with a permissions boundary condition and protect the boundary with SCPs.
- ✓Adopt ABAC with enforced tagging to avoid policy sprawl.
- ✓Use OIDC federation for CI/CD and ExternalId for third-party cross-account roles.
- ✓Continuously validate with Access Analyzer (unused access, external access, policy generation).
Common Interview Questions
Exam Tips
DOP-C02 focus
- "Let developers create roles but not exceed a limit" = permissions boundary with an iam:PermissionsBoundary condition.
- "Restrict across all accounts including the root user of members" = SCP; SCPs never apply to the management account.
- "Scale access without editing policies per team" = ABAC with tags.
- "Temporary credentials for on-premises workloads" = IAM Roles Anywhere; for CLI with MFA = sts get-session-token.
Finished this lesson?
0 of 44 lessons done · 0% of the course

