Managing Workforce Access and Storing Credentials Securely
This lesson explains how larger organisations manage workforce access centrally, let employees use their corporate credentials, and keep secrets out of application code.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish workforce identity with IAM Identity Center from customer identity with Amazon Cognito.
- Describe how access keys and password policies are protected.
- Distinguish AWS Secrets Manager from AWS Systems Manager Parameter Store for storing secrets.
Workforce and customer identity
Different people need access to AWS in different ways. An organisation's own employees, its workforce, should not each have IAM users in every account. AWS IAM Identity Center gives them single sign-on: they sign in once to a portal and reach every AWS account and business application they are allowed to use. Federation lets employees sign in with the identity they already have, in a corporate directory such as Active Directory, Microsoft Entra ID or Okta, and receive temporary AWS access; when someone leaves and their corporate account is disabled, their AWS access ends too. Cross-account roles let a person or application work in another AWS account without separate credentials there.
The customers of an organisation's applications are a different audience. Amazon Cognito provides sign-up and sign-in for web and mobile applications, including sign-in with social accounts such as Google, and scales to millions of users. The following table summarises the options.
| Service or feature | Use for |
|---|---|
| AWS IAM Identity Center (formerly AWS SSO) | Single sign-on to many AWS accounts and business apps from one portal |
| Federation | Employees sign in with an existing corporate identity (Active Directory, Microsoft Entra ID, Okta) and get temporary AWS access; disabling their corporate account removes AWS access |
| Cross-account roles | Working in another AWS account without separate credentials |
| Amazon Cognito | Sign-up and sign-in for the customers of your web and mobile apps, including social logins |
Choosing identity options
Protecting credentials
IAM credentials must be protected against misuse. The following list describes access keys and password policies.
- Access keys (access key ID and secret access key) provide programmatic access. Never put them in code or public repositories, and rotate them.
- Password policies enforce strong passwords for IAM users.
Storing secrets
Passwords and API keys should never be written into application code, where anyone who can read the code can see them. Two services store them securely instead. AWS Secrets Manager is built for secrets such as database passwords and API keys, and can rotate them automatically, changing the password on a schedule without breaking the application. It is charged per secret per month. Systems Manager Parameter Store stores configuration values and secrets, encrypted as SecureString parameters, at little or no cost, but it does not rotate them. The following table summarises the differences.
Secrets Manager or Parameter Store?
Employees, customers and an application password
A company has three identity needs, each with a different answer:
| Need | Solution |
|---|---|
| 200 employees should sign in to four AWS accounts with their existing Microsoft work accounts | IAM Identity Center, federated with the corporate directory |
| Customers should sign up to the company's mobile app, including with Google accounts | Amazon Cognito |
| The application needs a database password that changes every 30 days | AWS Secrets Manager with automatic rotation |
When an employee leaves and their work account is disabled, their AWS access ends at once, because they never had separate AWS passwords. That is the main benefit of federation.
Which service gives employees single sign-on to several AWS accounts?
Show answer
AWS IAM Identity Center.
Exam Tips
Remember for the exam
- For single sign-on across many AWS accounts, use IAM Identity Center.
- Letting employees sign in with their existing corporate credentials is federation.
- For sign-in by the customers of your mobile app, use Amazon Cognito.
- To store database passwords and rotate them automatically, use Secrets Manager.
- Never embed access keys in code.