Expert · Cloud security and compliance · topic 43 of 50 · 30 min
Identity is the new perimeter
Explanation
Why identity is the perimeter
In an old office network, the firewall was the wall around the castle. If you were inside the building, you were mostly trusted. In the cloud, every action, from starting a server to reading a file, is an API call over the internet. A perimeter is the boundary that decides who gets in. In the cloud that boundary is the identity making the call: a user, a role or a key. If an attacker steals a valid access key, no firewall stops them.
Lock down the root user
- Turn on MFA (multi-factor authentication: a second proof such as a phone app, passkey or hardware key) for the root user of every account.
- Delete any root access keys and never create new ones.
- Store the root password in a company password manager, not in someone's head or inbox.
- In an AWS Organization you can also manage root access centrally and remove root passwords from member accounts, so the root user cannot sign in at all unless an admin allows a specific task.
MFA everywhere and SSO for people
Every human who can sign in to the console should use MFA. SSO (single sign-on) means people sign in once through the company identity provider, such as Microsoft Entra ID, Okta or Google Workspace, and get access to the AWS accounts they need. On AWS this is IAM Identity Center. When someone leaves the company, HR disables one account and all cloud access stops at once. Without SSO, you must remember to delete IAM users in every account, and people get missed.
Roles and short-lived credentials
A long-lived access key (it starts with AKIA) works until someone deletes it. If it leaks in a GitHub repository, attackers find it within minutes. A role gives temporary credentials (they start with ASIA) that expire on their own, usually within an hour. Use roles for EC2 instance profiles, Lambda functions, ECS tasks, and for CI/CD pipelines through OIDC federation (for example GitHub Actions assuming a role without any stored key).
Least privilege and permission boundaries
Least privilege means each identity gets only the actions and resources it needs, nothing more. Start small and add permissions when a real need appears. IAM Access Analyzer helps: it shows resources shared outside your account, flags unused roles and permissions, and can generate a policy from the actions a role actually used in CloudTrail. A permissions boundary is a managed policy that sets the maximum permissions a user or role can ever have. It is useful when you let developers create their own roles: they can create roles, but never with more power than the boundary allows.
AWS Organizations and Service Control Policies
AWS Organizations groups many accounts under one management account, with organisational units (OUs) such as Security, Production and Development. A Service Control Policy (SCP) sets the maximum permissions for every identity in the accounts it is attached to, including the account root user. SCPs never grant anything; they only limit. They do not affect the management account itself, so keep workloads out of it. The example below keeps everything in the two Indian regions, Mumbai (ap-south-1) and Hyderabad (ap-south-2).
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideIndianRegions",
"Effect": "Deny",
"NotAction": [
"iam:*",
"organizations:*",
"sts:*",
"route53:*",
"cloudfront:*",
"waf:*",
"support:*",
"budgets:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["ap-south-1", "ap-south-2"]
},
"ArnNotLike": {
"aws:PrincipalARN": "arn:aws:iam::*:role/BreakGlassAdmin"
}
}
}
]
}Why the NotAction list? Some services are global: IAM, Organizations, Route 53, CloudFront and others send their API calls to us-east-1 even when your work is in Mumbai. If you deny them, nobody can create a role or a DNS record. The AWS documentation has a longer, maintained list of exceptions; copy from there and test the SCP on a sandbox OU before attaching it to production.
Break-glass accounts and access reviews
A break-glass account (or role) is an emergency identity used only when normal sign-in fails, for example when SSO is down. Protect it with a hardware MFA key kept in a safe, alert on every use, and test it twice a year. An access review is a regular check, usually every quarter, where managers confirm who still needs which access. The IAM credential report lists every user with MFA status, password and key ages.
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 --decode > report.csv
aws accessanalyzer list-analyzersNeed help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Identity is the new perimeter · 1/7
In the cloud, every action is an API call from anywhere. So the real boundary is the identity making the call. Identity is the new perimeter.
Prefer a video by a teacher? Find free videos on “AWS IAM best practices identity center SCP organizations tutorial” on YouTube ↗
In real life: A Bengaluru SaaS startup passes its first customer security review
A 40-person startup in Bengaluru sells HR software to a large Indian bank. The bank's security questionnaire asks how cloud access is controlled. The team moves from 25 IAM users with access keys to IAM Identity Center linked to Google Workspace, with MFA enforced. CI pipelines use GitHub OIDC roles, so no keys are stored. Accounts are split into prod, staging and sandbox under AWS Organizations, an SCP keeps everything in ap-south-1 and ap-south-2, and a break-glass role is protected by two hardware keys in the CTO's and CFO's safes. A quarterly access review is minuted. The bank accepts the answers and signs the contract.
Practice (0/3 done)
Which credential is safest for an application running on EC2 that needs to read S3?
Write audit_users(users) for a quarterly access review. Each user is a dict with "name", "mfa" (True/False), "key_age_days" (a number, or None if the user has no access key), "last_used_days" (days since the user last did anything) and "policies" (a list of policy names). Return a list of findings as strings, user by user in the given order, and for each user in this order: "<name>: no MFA", "<name>: access key older than 90 days" (more than 90), "<name>: unused for 90 days" (90 or more), "<name>: has AdministratorAccess".
Design the account structure and guardrails for a small company with a web app in production. Write: the OUs and accounts, how people sign in, how CI/CD gets credentials, two SCPs you would attach (in words or JSON), and your break-glass plan.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Encryption, keys and secretsCloud security and compliance · same module
- Logging, threat detection and incident responseCloud security and compliance · same module
- Compliance in the cloud, with Indian rulesCloud security and compliance · same module
- Cloud identity and access managementCyber Security: from zero to SOC analyst · Cloud security basics
- Identity and access management, least privilege and RBACCyber Security: from zero to SOC analyst · Identity and network defence
- Google Cloud structure: projects, billing and IAMGoogle Cloud and comparing the clouds
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
What does a Service Control Policy do?
Answer: Sets the maximum permissions for identities in the accounts it is attached to
SCPs only limit; an action must still be allowed by an IAM or resource policy.
Why does a region-restricting SCP usually exclude services like IAM, Route 53 and CloudFront?
Answer: They are global services whose API calls go to us-east-1
Global services are served from a fixed region, so a strict region deny would block them.
An access key ID starts with AKIA. What kind of credential is it?
Answer: A long-lived IAM user or root access key
AKIA marks long-lived keys; temporary STS credentials start with ASIA.
Which tool shows resources shared with outside accounts and unused permissions?
Answer: IAM Access Analyzer
Access Analyzer finds external access, unused access and can help build least-privilege policies.
Developers may create their own IAM roles, but never more powerful than a set limit. What enforces that limit?
Answer: A permissions boundary
A permissions boundary caps the permissions of the users or roles it is set on.
Which IAM identity gives temporary credentials and is the right choice for a Lambda function?Related
Answer: IAM role
Lambda runs with an execution role; AWS supplies temporary credentials.
Why are roles with temporary credentials better than access keys for apps?Related
Answer: Credentials expire automatically, so a leak is useful for a short time only
Short-lived credentials shrink the window of misuse.
What is least privilege?Related
Answer: Each account gets only the access its job needs
Minimum access limits damage when an account is misused.
From Identity and access management, least privilege and RBAC
Which identity can IAM permission policies NOT restrict inside its own account?Related
Answer: The root user
The root user always has full access in its account; that is why it must be locked away.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 3 more topics in “Cloud security and compliance” before its exam: Encryption, keys and secrets, Logging, threat detection and incident response, Compliance in the cloud, with Indian rules.
- Module 11 exam: Cloud security and compliance · 14 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Certifications and cloud careers. 50 topics left in the course before the final exam.