Identity and access management

Every request is checked twice: who are you, and may you do this?

The request:delete reports/q3.pdf from the bucket finance-dataAsha1 Authenticationwho are you?proved by a password and a codenot proven: stopped here ✗it is Asha2 Authorisationmay you do this?decided by policiesno rule allows it: denied ✗allowedfinance-dataEvery request to the cloud passes two checks: who is asking, and whether they are allowed.Authentication proves an identity. Authorisation decides what that identity may do, and the answer is no unless apolicy says yes. Both checks run on every single request, whether it comes from a person, a script or anotherservice. The service that does this is IAM on AWS and Google Cloud, and Microsoft Entra ID with Azure RBAC on Azure.

Authentication proves who is asking. Authorisation decides whether they may. Both run on every request.

Identity and access management · Going deeper

How the decision is made: deny by default, and Deny wins

A request arrivesdenied to begin withDoes any rule say Deny?yesDenieda Deny always winsnoDoes any rule say Allow?noDeniednothing allowed ityesAllowedThree rules settle every decision: denied by default, an Allow opens it, and a Deny beats any Allow.Because the starting point is no, forgetting to write a rule is safe: nothing happens. Because a Deny always wins,an organisation can set a limit that no team’s Allow can override. This is how AWS evaluates policies. Azure andGoogle Cloud are also deny-by-default and add up the roles granted at each level; both have deny rules that win too.

A request is denied unless a rule allows it, and an explicit Deny overrides any Allow.

Users, groups and roles

Permissions attach to groups and roles, not to one person at a time

Group: Developers3 peoplePolicydeploy and restart the apponApp serversGroup: Finance2 peoplePolicyread invoicesonInvoice bucketRole: web-serverworn by softwarePolicyread product photosonPhoto bucketPermissions are attached to groups and roles, never to one person at a time.A person joins a group and gets what the group may do; when they change jobs, you change the group, not fortyseparate rules. A role is an identity for software, or for a person doing a particular task: whoever takes therole gets its permissions for a limited time. People sign in; software assumes roles.

People belong to groups; software and tasks use roles. Policies attach to those, and identities inherit them.

Users, groups and roles · Going deeper · 1 of 2

The same parts under different names

AWSAzureGoogle CloudThe directoryIAM, IAM Identity CenterMicrosoft Entra IDCloud IdentityA personIAM useruserGoogle accountA set of peopleIAM groupgroupGoogle groupAn identity for softwareIAM rolemanaged identityservice accountA bundle of permissionspolicyrole (Owner, Contributor, Reader)role (Owner, Editor, Viewer)Granting itattach the policyrole assignment at a scoperole binding on a resourceSame parts, different words. Beware “role”: on AWS it is an identity; on Azure and Google it is a set of permissions.On AWS you assume a role and act as it. On Azure and Google Cloud you are granted a role, meaning a namedbundle of permissions, on some resource. Microsoft Entra ID was called Azure Active Directory until 2023, andolder exam material still uses that name. It is also the directory behind Microsoft 365.

IAM users, groups, roles and policies on AWS; Entra ID users, groups, managed identities and role assignments on Azure; accounts, groups, service accounts and role bindings on Google Cloud.

Users, groups and roles · Going deeper · 2 of 2

The root user: the one identity nothing can restrict

The identity that created the account can do anything, and no policy can limit it. Lock it away.

What it is

When you open an AWS account, the email address and password you used become the root user. It can close the account, change the payment method and remove every other user. Azure’s nearest equivalent is the Global Administrator of the tenant; Google Cloud’s is the super administrator.

What to do with it, on day one

  • Turn on multi-factor authentication preferably with a hardware key kept somewhere safe.
  • Create no access keys for it and delete any that exist.
  • Make an administrator identity for daily work and sign in with that instead.
  • Use root only for the few tasks that need it such as changing the support plan or closing the account.
This is a reliable exam question: the root user should be protected with MFA and not used for everyday tasks.

Policies

A policy says who may do what, to which resources, and when

A policy attached to the group Finance{}"Effect": "Allow",Effectallow, or deny"Action": ["s3:GetObject", "s3:PutObject"],Actionwhich operations: read and write files"Resource": "arn:aws:s3:::finance-data/reports/*",Resourceon what: one folder of one bucket"Condition": { "IpAddress": { "aws:SourceIp": "203.0.113.0/24" } }Conditiononly if it comes from the officeA policy is a short document with four parts: allow or deny, which actions, on which resources, on what condition.This one lets Finance read and write files in one folder of one bucket, and only from the office network. Nothingelse is granted, so everything else stays denied. Providers supply hundreds of ready-made policies, such asReadOnlyAccess, and you write your own when you need something narrower.

A policy lists an effect, actions, resources and optional conditions. Anything it does not allow stays denied.

Policies · Going deeper

Azure and Google: a role, given to someone, at a level

Management group: the whole companySubscription: Online shopResource group: shop-prodAsha is Contributor hereDatabaseVirtual machineand so on everything inside itA role assignment has three partsWhoAsha, or better the group DevelopersRoleContributor: change things, not grant accessScopethe resource group shop-prodGranted at one level, inherited by all below it.On Azure and Google Cloud, access is a role given to someone at a level, and it flows down from there.Azure calls this role-based access control (RBAC). Its three basic roles are Owner (everything, including grantingaccess), Contributor (everything except granting access) and Reader. Google Cloud works the same way down itsown levels, organisation, folder, project, with the basic roles Owner, Editor and Viewer.

A role assignment joins who, which role and what scope. It is inherited by everything beneath that scope.

Least privilege

Grant only what the job needs, and a stolen key can do only that

A key that can do everythingIf it is stolen: all six are exposeddatabases read, servers deleted, new ones created at your costA key for one jobIf it is stolen: one bucket, read onlythe thief gets what the job needed and nothing moreLeast privilege: give each identity only what its job needs, so a stolen key can do only that.Keys do get stolen and people do make mistakes; what matters is how far the damage can spread. Start from nothingand add permissions as the work requires them. Broad access granted “for now” is rarely removed, so providerssupply tools that list permissions nobody has used: IAM Access Analyzer, Entra access reviews, IAM Recommender.

Least privilege limits each identity to what its task requires, which limits the damage when it is misused.

Least privilege · Going deeper · 1 of 2

Defence in depth: seven layers, not one wall

Physicalguarded buildings, run by the providerIdentity and accessmulti-factor sign-in, least privilegePerimeterDDoS protection, firewalls at the edgeNetworkprivate subnets, security groupsComputepatched machines, no stray open portsApplicationreviewed code, no passwords inside itDataencrypted, every access loggedDefence in depth: seven layers, so an attacker who gets through one still faces the next.No single control is trusted to hold. A stolen password meets multi-factor sign-in; a breached server meets anetwork that lets it reach almost nothing; stolen disks hold only encrypted data. This layered model is how Azureteaches security and it applies on any cloud. The top layer is the provider’s job; the rest are shared or yours.

Defence in depth stacks independent protections from the building to the data, so one failure is not a breach.

Least privilege · Going deeper · 2 of 2

Zero trust: verify every request, wherever it comes from

Zero trust drops the idea that anything inside the company network is safe. Every request is checked on its own merits.

The old model and the new

Castle and moat

Trust anyone inside the office network. Once an attacker is in, by a stolen laptop or one phishing email, they can reach everything.

Zero trust

Trust nothing by location. Each request must prove who is asking and that the device is healthy, and gets only what that task needs.

Three principles

Verifyexplicitly: identity, device, location, every time
Leastprivilege: just enough access, for just long enough
Assumebreach: limit what any one compromise can reach

How it shows up in practice

  • Conditional access rules such as “administrators must use a second factor” or “block sign-ins from unfamiliar countries” (Microsoft Entra Conditional Access).
  • Short-lived credentials roles and temporary passes instead of permanent keys.
  • Private subnets and security groups so that being inside the network grants nothing by itself.

Multi-factor authentication

A stolen password opens nothing when a second proof is required

AshaPasswordsomething she knows+Code from her phonesomething she hasSigned inA thiefPasswordstolen by a fake login page+?no phone, no codeStopped ✗Multi-factor authentication asks for two different kinds of proof, so a stolen password alone opens nothing.The factors are something you know (a password), something you have (a phone app, a hardware key) and somethingyou are (a fingerprint). Microsoft reports that it blocks more than 99.9% of attacks on accounts. It is free onevery provider. Turn it on for every person, and first for administrators and the account’s root user.

Multi-factor authentication (MFA) requires two kinds of proof, such as a password and a code from a phone.

Multi-factor authentication · Going deeper

Single sign-on: one identity for every system

Ashasigns in onceThe company directoryone account per personpassword and second factorAWSAzureGoogle CloudEmail, HR, payrollissues a short-lived pass for each system:no second password anywhereSingle sign-on: one identity, checked in one place, opens every system a person is allowed to use.The clouds trust the company directory instead of keeping their own passwords; this trust is called federation.When someone leaves, disabling one account ends their access everywhere. The directory is usually MicrosoftEntra ID, Google Workspace or Okta, connected through AWS IAM Identity Center or Google Workforce Identity Federation.

With single sign-on the clouds trust the company directory, so one account and one sign-in cover everything.

Identities for software

Software gets a temporary pass from a role, never a key stored in code

A permanent key, typed into the codeApplication codekey = AKIA…Shared repositoryWhoever finds itIt works from anywhere, for anyone,until somebody notices and deletes it.A role, with a pass that expiresIdentity service1-hour passServer with a roleBucketNothing is stored and nothing can leak.Each pass is replaced before it expires.Software should get its access from a role, as a temporary pass, and never from a key written into code.Keys committed to code are the most common way cloud accounts are broken into; scanners find them on publicsites within minutes. Attach a role to the virtual machine, container or function instead, and the platformsupplies short-lived credentials automatically: an IAM role on AWS, a managed identity on Azure, a service account on Google Cloud.

Give servers and functions a role. The platform supplies temporary credentials that expire and renew.

Identities for software · Going deeper

Encryption and secrets: in transit, at rest, in a vault

Encrypted in transitscrambled on the wire: readable onlyat the two ends (HTTPS, TLS)certificates from the provider, freeEncrypted at restkey servicescrambled on disk: useless to anyonewithout the keyAWS KMS · Azure Key Vault · Cloud KMSSecrets kept out of codeaskssecret storepasswords fetched when needed,changed on a scheduleSecrets Manager · Key Vault · Secret ManagerThree protections for data and passwords: encrypt it moving, encrypt it stored, and keep secrets in a vault.Encryption at rest is on by default for most storage on all three providers, with keys the provider manages; youcan hold the keys yourself in the key service when rules require it. A secret store hands database passwordsand API keys to the software that needs them at run time, logs every use and can rotate them automatically.

Data is encrypted on the wire and on disk with keys from a key service; passwords live in a secret store.

Accounts and organisations

Separate accounts are the strongest wall, under one set of rules

Organisationone bill, one set of rulesguardrail: “nothing outside Europe”applies to every account belowProductionDevelopmentshop-prodan accountpayments-prodan accountshop-devan accountsandboxan accountAn account is the strongest wall in the cloud. An organisation groups accounts and sets rules none can break.Nothing in one account can touch another unless both sides allow it, so a mistake in the sandbox cannot reachproduction, and each account’s costs are listed separately on one bill. The wall is called an account on AWS,a subscription on Azure and a project on Google Cloud. Guardrails set at the top apply to everything beneath.

An account (subscription, project) isolates resources and costs. An organisation applies guardrails to all of them.

Accounts and organisations · Going deeper · 1 of 2

Organisation, subscription, project: the levels by provider

AWSAzureGoogle CloudThe toporganisationtenant, root management grouporganisationGroupingorganisational unit (OU)management groupfolderThe wall, and the billaccountsubscriptionprojectInside the wallresources, grouped by tagsresource groupresources, grouped by labelsGuardrailsservice control policyAzure Policyorganisation policyReady-made setupControl Towerlanding zonesGoogle Cloud SetupFour levels on each provider: the top, groups, the unit that isolates and bills, and the resources inside it.Guardrails differ from permissions: they set the outer limit of what anyone in an account can be allowed, such aswhich regions may be used or that storage must be encrypted. Azure Policy can also check existing resources andreport or fix the ones that break a rule. An Azure resource belongs to exactly one resource group.

AWS: organisation, OU, account. Azure: management group, subscription, resource group. Google: organisation, folder, project.

Accounts and organisations · Going deeper · 2 of 2

The audit log: who did what, and when

WhenWhoDid whatTo whatFrom whereResult09:14:02ashaStartInstancesweb-3officeallowed09:20:41role web-serverGetObjectphotos/cat.jpginside the networkallowed02:13:55benDeleteBucketfinance-dataunknown addressdenied02:14:10benCreateUserbackdoorunknown addressdeniedTwo attempts at 2 a.m. from an address never seen before: Ben’s password has probably been stolen.Every request is written down: who, what, when, from where, and whether it was allowed.The audit log answers “who deleted that?” and reveals break-ins like this one. It is on by default: AWS CloudTrailkeeps 90 days of history, as does the Azure Activity Log, and Google Cloud Audit Logs keep admin activity for 400 days.Send the logs to a separate, locked account so that an intruder cannot erase the evidence.

An audit log such as CloudTrail records every request with its identity, time, origin and result.

Lesson complete

You finished “Identity and access”

Nicely done.

Open in a new tab