Identity and Access
Chapters and transcript
Identity and Access In the cloud, your login is your front door. Watch this attacker. They have a valid password, so the firewall lets them through. It looks like a normal user. Inside, they get full access. In this lesson, you will learn how cloud providers control who can do what, and how to set it up safely.
Who can do what Every provider has a system for Identity and Access Management, or IAM. It answers two questions. First, who are you? That is authentication. You prove it with a password, a key or another method. Second, what are you allowed to do? That is authorisation. Rules decide which actions you can take on which resources.
Who can do what The names differ between providers. AWS calls its service IAM. Microsoft uses Entra ID for identities, and Azure role-based access control for permissions. Google Cloud also calls its service IAM. The ideas are the same everywhere.
Who can do what An identity is not always a person. It can be a person, such as a developer or an accountant. It can be a group of people, such as the finance team. Or it can be a service, such as an application or a virtual machine that needs to read a database.
Policies Permissions are written as policies or role assignments. Here is a simplified AWS-style policy. Read it as a sentence. Allow the action, get object, on files inside the bucket called company reports. That means reading files from one bucket, and nothing else.
The root account When you first create a cloud account, you get one identity with full control. AWS calls it the root user. In Azure, the top roles include Owner and Global Administrator. In Google Cloud, it is the Owner role and the super administrators. This identity can do anything, even close the account. If it is stolen, the attacker owns your cloud.
The root account So protect it. Turn on multi-factor authentication immediately. Use a long, unique password in a password manager. Do not use it for daily work. Create named accounts instead. Never create access keys for the root user. Keep the recovery email and phone up to date, and protect that email too. And keep the number of owners small.
Least privilege The principle of least privilege means each person or service gets only the permissions it needs. Sana in finance only needs to view the bill, so she is a billing viewer. Now an attacker steals her password. They can view the bill. But when they try to delete the database, it is refused. Her small role limited the damage.
Least privilege Good habits for least privilege. Start with no access, then add only what is needed. Use built-in roles that match a job, such as read-only. Give permissions to groups, not one by one. Review access regularly, because people change teams and keep old rights. This slow build-up is called permission creep. And remove access on the same day someone leaves.
Multi-factor authentication Multi-factor authentication, or MFA, asks for a second proof after the password. An attacker stole a password through phishing, and tries to log in. The password is correct, but the console asks for the second factor. The attacker does not have it, so the login is stopped.
Multi-factor authentication MFA comes in types, from weaker to stronger. SMS codes are better than nothing, but they can be stolen through SIM swap fraud or phishing pages. Authenticator app codes and push prompts are stronger, but a user can still be tricked. Hardware security keys and passkeys are the strongest common option. They check the real website address. Require MFA for every human user, not just admins.
Access keys and roles People use a password and MFA. Programs often use access keys. A long-lived key keeps working until someone disables it. If it leaks, it works from anywhere, and MFA does not protect it. The safer option is roles with temporary credentials. They expire automatically, often after an hour or less.
Access keys and roles Here is how to check keys with the AWS command line. First, list the access keys for the user Ali. There is one active key. Ali no longer needs it, so we set it to inactive. Now the key stops working, even if someone copied it.
Quick check Quick check. A new reporting app only needs to read files from one storage bucket. A developer wants to give it full administrator rights, to save time. What should you give it instead? Choose your answer.
Key takeaways Let us put it together. IAM decides who you are and what you can do. Protect the root account with MFA, and keep it out of daily work. Give only the permissions each identity needs. Require MFA for every human user. And prefer roles with temporary credentials over long-lived keys. Now read the lesson below, and answer the quiz.
In the cloud, your login is your front door. If an attacker gets in with a valid identity, firewalls and encryption may not stop them. This lesson explains how cloud providers control access, and how to set it up safely.
Who can do what
Every cloud provider has a system for Identity and Access Management (IAM). IAM answers two questions:
- Who are you? This is authentication. You prove your identity with a password, a key or another method.
- What are you allowed to do? This is authorisation. Rules decide which actions you can take on which resources.
The names differ between providers. AWS calls its service IAM. Microsoft uses Microsoft Entra ID for identities and Azure role-based access control for permissions. Google Cloud also calls its service IAM. The ideas are the same.
An identity can be:
- A person, such as a developer or an accountant
- A group of people, such as "finance team"
- A service, such as an application or a virtual machine that needs to read a database
Permissions are usually written as policies or role assignments. Here is a simplified AWS-style policy that allows reading files from one storage bucket and nothing else:
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::company-reports/*"
}
Read it as a sentence: allow the action "get object" on files inside the bucket company-reports.
The root or owner account
When you first create a cloud account, you get one identity with full control. AWS calls it the root user. In Azure, the top roles include Owner on a subscription and Global Administrator in Entra ID. In Google Cloud, it is the Owner role and the organisation's super administrators.
This identity can do anything, including deleting every resource, changing billing, and closing the account. If it is stolen, the attacker owns your cloud.
Rules for the root or owner account:
- Turn on multi-factor authentication for it immediately.
- Use a long, unique password stored in a password manager.
- Do not use it for daily work. Create named accounts instead.
- Do not create access keys for the root user.
- Keep the email address and recovery phone number up to date, and protect that email account too.
- Limit the number of people who hold top-level owner rights.
Least privilege
The principle of least privilege means each person or service gets only the permissions it needs, and nothing more.
Example: Sana in finance needs to view the monthly bill. She does not need to create servers or delete databases. Giving her full administrator rights "to save time" means that if her password is stolen, the attacker gets everything.
Good habits for least privilege:
- Start with no access, then add only what is needed.
- Use the provider's built-in roles that match a job, such as read-only or billing viewer.
- Give permissions to groups, not to individuals one by one. It is easier to review.
- Review access regularly. People change teams and keep old permissions. This slow build-up is called permission creep.
- Remove access on the same day someone leaves the organisation.
Multi-factor authentication
Multi-factor authentication (MFA) asks for a second proof after the password. Even if an attacker steals the password through phishing or a data leak, they still need the second factor.
Common types of MFA, from weaker to stronger:
- SMS codes: better than nothing, but codes can be stolen through SIM swap fraud or phishing pages.
- Authenticator app codes or push prompts: stronger, but a user can still be tricked into typing a code into a fake site, or into approving a push prompt they did not start.
- Hardware security keys and passkeys: the strongest common option. They are built to resist phishing because they check the real website address.
Require MFA for every human user who can log in to the cloud console, not just administrators.
Access keys and roles
People log in with a password and MFA. Programs and scripts often use access keys instead. An AWS access key, for example, has two parts: an access key ID and a secret access key.
A long-lived key keeps working until someone disables or deletes it. If it leaks, an attacker can use it from anywhere, and MFA does not protect it. Leaked keys are one of the most common causes of cloud break-ins.
The safer option is roles and temporary credentials. A role is an identity that a person or service can take on for a short time. The provider gives out credentials that expire automatically, often after an hour or less. Examples include IAM roles in AWS, managed identities in Azure, and service accounts attached to resources in Google Cloud.
You can check which access keys a user has with the AWS CLI:
aws iam list-access-keys --user-name ali
And disable a key you no longer trust:
aws iam update-access-key --user-name ali --access-key-id AKIAEXAMPLEKEYID --status Inactive
How to defend
- Protect the root or owner account with MFA, and lock it away from daily use.
- Give every person their own named account. Never share logins.
- Require MFA for all human users. Prefer security keys or passkeys for administrators.
- Follow least privilege, and review permissions on a schedule.
- Prefer roles and temporary credentials over long-lived access keys.
- If you must use access keys, rotate them, delete unused ones, and never put them in code.
- Remove accounts and keys as soon as someone leaves.
Check your understanding
Answer every question correctly to complete this lesson. If you miss one, try the quiz again.
1. What does the principle of least privilege mean?
2. Which is the best way to use the root or owner account?
3. Why are long-lived access keys risky?
Locked: answer every quiz question above correctly to complete this lesson.
Spotted a mistake or something unclear? Report a mistake