Skip to content

Expert · Cloud security and compliance · topic 43 of 50 · 30 min

Identity is the new perimeter

Explanation

In the cloud there is no office wall around your servers: anyone with valid credentials can reach the API from anywhere. So identity becomes the perimeter. You lock away the root user, require MFA everywhere, sign people in through SSO, give machines roles with short-lived credentials, grant the least privilege needed, and use AWS Organizations with Service Control Policies to set guardrails no one can break.

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.

Think of it like this: Think of a hotel. There is no wall around each room; the key card is the security. A lost key card that never expires, opens every floor and has no photo check is a disaster. Short-lived, room-specific key cards with an ID check at the front desk are what good cloud identity looks like.

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).

json
{
  "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"
        }
      }
    }
  ]
}
Deny every request outside Mumbai and Hyderabad, except for global services listed in NotAction and the break-glass role.

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.

bash
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 --decode > report.csv
aws accessanalyzer list-analyzers
The credential report is a CSV with one row per IAM user: MFA, password last used, access key age and last use.
Careful: Common mistakes: (1) Long-lived access keys on laptops and in CI, instead of SSO and roles. Fix: move people to Identity Center and pipelines to OIDC roles. (2) Giving AdministratorAccess "for now" and never removing it. Fix: put an expiry date on every exception and review quarterly. (3) An SCP that denies global services and locks everyone out of IAM. Fix: start from the AWS example, keep a break-glass exception and test on a sandbox OU. (4) Running workloads in the management account, where SCPs do not apply.

Need 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

Identity is the new perimeter

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)

Task 1 · Question

Which credential is safest for an application running on EC2 that needs to read S3?

Task 2 · Code · Python

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".

Task 3 · Practice

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

Question 1

1.What does a Service Control Policy do?

Question 2

2.Why does a region-restricting SCP usually exclude services like IAM, Route 53 and CloudFront?

Question 3

3.An access key ID starts with AKIA. What kind of credential is it?

Question 4

4.Which tool shows resources shared with outside accounts and unused permissions?

Question 5

5.Developers may create their own IAM roles, but never more powerful than a set limit. What enforces that limit?

Read more (free)

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.

From IAM: users, groups, roles and least privilege

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.

From Cloud identity and access management

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.

From Creating and securing an AWS account

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

  1. 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.
  2. Module 11 exam: Cloud security and compliance · 14 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Certifications and cloud careers. 50 topics left in the course before the final exam.

← Previous: The Well-Architected Framework