Root User, Federation and Directory Services
Overview
Every AWS account starts with one all-powerful identity: the root user. Beyond it, organisations need ways to let thousands of people and apps in without creating an IAM user for each one. This lesson covers protecting the root user, identity federation, directories and sharing resources safely.
Imagine a building master key (root user). You lock it in a safe and give staff badges instead. Federation is a badge issued by another trusted authority - your company login - which the building accepts for a day. Cross-account roles are visitor passes for people from a neighbouring building.
This maps to exam Tasks 2.2 and 2.3 and is full of simple "which feature" questions.
Key Concepts
- The root user has unrestricted access and should be used only for a few tasks that require it.
- Protect root with a strong password, MFA and no access keys; never use it for daily work.
- Federation lets users sign in with an existing identity provider (SAML 2.0, OIDC) and receive temporary AWS credentials.
- IAM Identity Center (successor to AWS SSO) provides single sign-on to multiple accounts and applications.
- Amazon Cognito manages sign-up, sign-in and access for customers of your web and mobile apps.
- AWS Directory Service offers managed Microsoft Active Directory and connectors to existing directories.
- Cross-account roles and AWS RAM (Resource Access Manager) let accounts share access or resources without copying credentials.
- IAM credential report and Access Advisor show credential status and last service access.
Detailed Notes
Tasks only the root user can perform
| Root-only task | Why |
|---|---|
| Change account name, email address, root password or root access keys | Account ownership settings |
| Close the AWS account | Highest-level action |
| Change or cancel the AWS Support plan | Account-level billing relationship |
| Restore IAM user permissions when no admin can | Last-resort recovery |
| Register as a seller in the Reserved Instance Marketplace | Account-level capability |
| Enable MFA delete on S3 buckets (in the legacy method) | Account-level control |
Everything else, including daily administration, should be done by IAM identities.
Protecting the root user
| Practice | Detail |
|---|---|
| Enable MFA | Virtual, hardware TOTP or passkey/security key |
| No access keys | Delete any root access keys |
| Strong unique password | Store in a secured password manager |
| Use a shared mailbox | Avoid tying the account to one person |
| Monitor | CloudWatch alarm or EventBridge rule on root sign-in |
Identity types
| Type | Description | Best for |
|---|---|---|
| IAM user | Long-lived identity with credentials inside one account | Small setups, legacy tools |
| IAM role | Assumed identity with temporary credentials | Services, cross-account and federated users |
| Federated identity | External identity (corporate directory, Google) mapped to a role | Workforce access |
| IAM Identity Center user | Central workforce identity with multi-account access | Organisations with many accounts |
| Cognito user | Customer identity for your application | Mobile and web app users |
Federation and single sign-on
With federation the identity provider (IdP) authenticates the user and AWS STS issues temporary credentials. Benefits: one place to enforce MFA and offboarding, no extra IAM users and short-lived credentials. IAM Identity Center connects to Microsoft Active Directory, Okta or its own directory and assigns permission sets to accounts.
Cognito versus IAM
| Question | Answer |
|---|---|
| Who are the users? | Cognito: your application's customers. IAM/Identity Center: your workforce |
| Can Cognito use Google, Facebook, SAML? | Yes, through identity pools and user pools federation |
| Do customers need AWS accounts? | No |
Directory Service options
| Option | When to use |
|---|---|
| AWS Managed Microsoft AD | Real Active Directory in AWS, trusts with on-premises |
| AD Connector | Proxy requests to an existing on-premises AD |
| Simple AD | Basic, low-cost directory (limited features) |
Cross-account access and sharing
{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111122223333:root" },
"Action": "sts:AssumeRole"
}
A trust policy like this lets account 111122223333 assume a role. AWS Resource Access Manager (RAM) shares resources such as subnets, Transit Gateways and License Manager configurations with other accounts in the Organization without duplication.
Password policies and credential storage
IAM password policies set minimum length, complexity, expiry and reuse rules. Applications should never embed secrets in code: use Secrets Manager (rotation) or Systems Manager Parameter Store.
Access reports
| Report | Shows |
|---|---|
| Credential report | All users and status of passwords, MFA and access keys |
| IAM Access Advisor | Last time a service was used by a user or role, to trim permissions |
| IAM Access Analyzer | Resources shared externally and unused access |
Real World Example
A software company acquires a new AWS account, immediately enables MFA on the root user, deletes root access keys and stores the credentials in a vault. Employees sign in through IAM Identity Center connected to the corporate directory and receive time-limited permission sets per account.
The mobile app uses Amazon Cognito for customer sign-in with Google login, while a partner agency assumes a cross-account role to deploy updates. Subnets are shared to other accounts with RAM, and each quarter the security team reviews the credential report to remove stale users.
Architecture Diagram
- 1The employee signs in to the corporate identity provider.
- 2The provider sends an assertion to IAM Identity Center or STS.
- 3AWS verifies trust and issues temporary credentials for a role.
- 4The employee accesses AWS resources until the session expires.
Best Practices
- ✓Lock root with MFA, remove access keys and use it only for root-only tasks.
- ✓Prefer federation and IAM Identity Center over many individual IAM users.
- ✓Use roles (including cross-account roles) instead of sharing access keys.
- ✓Use Cognito for customer identities, not IAM users.
- ✓Review the credential report and Access Advisor regularly to remove unused access.
Common Interview Questions
Exam Tips
CLF-C02 focus
- "Task only root can perform" - closing the account or changing the support plan.
- "Single sign-on to multiple accounts" = IAM Identity Center.
- "Sign-up and sign-in for mobile app users" = Amazon Cognito.
- "Credential report" lists users and MFA status; "Access Advisor" shows last-used services.
Finished this lesson?
0 of 43 lessons done · 0% of the course

