Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

IAM: manage identities and permissions in the cloud

By updated

Improve this page

IAM (Identity and Access Management) lets you control precisely who can do what on your cloud infrastructure. Without it, everyone uses the same root account with full access: a junior developer can delete production, an intern can see the invoices, and one leaked credential compromises your whole infrastructure.

This guide teaches you to configure IAM properly, whichever cloud provider you use. You will see how to create users, organise them into groups, define permission policies and read a permission according to the provider. It also sets three design rules that you lay down before configuring anything: link people to the company directory, follow access rights from arrival to departure and require a usable audit log. Applying the principle of least privilege, the foundation of cloud security, is the subject of the lesson Least privilege in practice (in French).

What you will learn

  • Explain why a shared account is a risk, and what an IAM system brings.
  • Tell apart identity, group, policy, root user and what they have in common from one cloud to another.
  • Read a permission depending on whether it is a document, an assigned role or a binding on the resource.
  • Attach a right to a group on five clouds, check it, then clean up.
  • Design the federation of human identities with the company directory, with its exceptions: the break-glass account and the accounts that administer the whole environment.
  • Describe the lifecycle of access rights (joiner, mover, leaver) and their recertification.
  • State what to require from an audit log: content, retention, readers, alerts.
  • Avoid the five common pitfalls and diagnose an Access Denied.

To follow this guide, you need to understand the API-first principle of the cloud. If you do not, start with the guide API-first in the cloud (in French).

The problem: who is allowed to do what?

Before talking about tools, you need to pin down the problem that IAM solves. In the cloud, every resource is created by an authenticated API call: the only question that matters is therefore which identity is allowed to make which call. As long as nobody answers it explicitly, the default answer stays "anyone can do anything", since everyone shares the same account.

Catastrophe scenario: a shared account

In a company where everyone uses the same cloud account with the same credentials, every line of the table becomes a very real risk:

RiskConsequence
The junior developer has the same rights as the CTOThey can delete the production servers by mistake
The intern can access billing informationConfidential data exposed
The external contractor sees all resourcesWider attack surface
Credentials leak (Git commit, Slack...)Everything is compromised: no isolation
An incident occursImpossible to know who did what

These five risks have one and the same origin: the absence of an individual identity. The cloud sees a single caller, so it can neither restrict rights by person nor attribute an action to someone in its logs.

The solution: an IAM system

An IAM (Identity and Access Management) system solves these problems by providing:

NeedIAM solution
Identify each personA distinct user with their own credentials
Group by functionGroups (developers, ops, accounting...)
Define rightsPolicies that list the allowed actions
Trace actionsAudit logs that say who did what and when

The core building blocks of IAM

All cloud providers use the same basic concepts, even if the names vary slightly.

Overview

Six notions are found at every provider, even if each one names and implements them in its own way. Remembering them lets you read an unfamiliar IAM system without knowing its vocabulary.

Universal notionWhat it meansExamples
IdentityWho acts: a person, a service, a machinealice, a service account, an instance
GroupingWhat factors the rights of several identitiesgroup, team, organisational unit
PermissionWhat is allowed or deniedread an object, start an instance
AttachmentHow the permission reaches the identityattached document, role assignment, binding on the resource
ScopeHow far the rule reachesan account, a project, an organisation
Proof of identityWhat authenticates the calltemporary token, certificate, static secret

The root user: powerful but dangerous

When you create a cloud account, you get a root user. This account has unlimited permissions:

  • Create, modify, delete all resources
  • Manage users and their permissions
  • Access billing information
  • Close the account

Users: one identity per person or service

A user represents a person or a service that needs access to your cloud resources. Each user has:

  • Their own credentials (distinct access keys)
  • Their own permissions (defined by policies)
  • Their own history of actions (traceability)

The fundamental rule is to never share credentials between several people or services.

Groups: simplify management at scale

Take 10 developers who all need the same permissions. You could attach the same policy to each of them individually... but that is tedious and error-prone.

The solution is to create a developers group, attach the policy to it, then add the users to the group.

Without groupsWith groups
10 users × 1 policy = 10 attachments1 group with 10 members = 1 attachment
New developer = remember to attach the policyNew developer = add to the group
Change the rights = 10 changesChange the rights = 1 change

A user can belong to several groups and accumulates their permissions:

alice → group "developers" → development permissions
alice → group "on-call" → production monitoring permissions

Typical group layout

This breakdown is a starting point in most organisations. Above all, remember the isolation of the ci-cd group: a pipeline is not a human, it acts without supervision and at high speed, so it deserves its own set of permissions and its own environment scope.

GroupPermissionsTypical members
administratorsEverything (sometimes except billing)CTO, Lead Ops
developersVMs, volumes, networks in devDevelopment team
readonlyRead-only on everythingAuditors, support
billingAccess to consumption informationAccounting
ci-cdCreation in staging (deletion to be granted only on a disposable account)GitLab/GitHub pipelines

Policies: define who can do what

A policy is a document, usually in JSON, that defines permissions. Whatever the provider, a permission answers the same six questions. Remembering them lets you read any policy, from any provider, even without knowing its syntax:

Building blockThe questionConcrete example
PrincipalWho acts?a user, a group, a role, a machine, a service
ActionWhat do they want to do?read an object, start an instance, delete a snapshot
ResourceOn what?one specific bucket, all the databases of a project, an encryption key
ScopeWhere does this rule apply?an account, a project, a resource group, a whole organisation
ConditionUnder what restrictions?only from a given network, only with two-factor authentication, only before a date
EffectAllow or deny?allow by default, deny explicitly to create an exception

The condition is a very useful building block, and too often neglected. It lets you tighten a right without rewriting the policy: the same read right becomes harmless if it can only be used from your corporate network, or only by a session authenticated with two factors. Many overly broad policies could be made acceptable by a single well-placed condition.

The scope is the one that varies a lot from one provider to another, and it is a frequent source of misunderstanding when you change cloud. At some providers, it is deduced from the targeted resource; at others, it is a piece of data in its own right that you choose explicitly when granting the right. The next section shows exactly where each one puts it.

How a permission is written, depending on the cloud

There is not one IAM syntax, there are three families, and confusing the three is a costly mistake when you change provider. Many guides let you believe that AWS's model is the cloud's model, because it is the oldest and the most copied. An administrator trained on that model alone arrives on Azure and finds nothing of what they look for, not because the names change, but because the object the permission attaches to is not the same.

Here is the question that separates the three families: where does the permission live?

FamilyThe permission is attached toRepresentative clouds
Policy attached to the identitythe identity (user, group, role or application)AWS and OUTSCALE (JSON document), Scaleway (rules on permission sets)
Role assignmentan identity + scope pairAzure
Binding on the resourcethe resource itselfGoogle Cloud

Family 1: a document attached to the identity

This is AWS's model, taken up by OUTSCALE. You write a document, often in JSON, and you attach it to a user, a group or a role. The document lists actions and resources.

{
"Statement": [
{
"Sid": "AllowReadVMs",
"Effect": "Allow",
"Action": ["compute:ReadInstances", "compute:DescribeInstances"],
"Resource": ["*"]
}
]
}
ElementRequiredDescription
StatementyesContains one or more statements
SidnoReadable identifier for the statement
EffectyesAllow (permit) or Deny (forbid)
ActionyesList of the actions concerned
ResourceyesResources concerned (* = all)

Scaleway also attaches its policy to the identity (user, group or application), but does not write it action by action. A policy there contains rules, and each rule links permission sets (for example InstancesFullAccess) to a scope: the whole organisation or a list of projects. Scaleway rules are allow-only: there is no Deny to write. The command scw iam rule update --help documents these fields.

The prefix of an action designates the service, and it changes from one cloud to another. It is the most visible difference within this family, but not the only one.

Three mechanisms also vary, and they decide the outcome when two rules contradict each other:

  • The evaluation model. At AWS, an explicit Deny always wins over any Allow, and the absence of a rule means refusal. Outscale (EIM) documents the same rule, but do not assume it for another provider: Azure and GCP have no Deny in their basic authorisation policies (see the lesson Least privilege in practice, in French).
  • Policies attached to resources. A storage bucket can carry its own policy, which combines with the identity's. The effective right is then the intersection or the union of the two depending on the provider, which is not the same thing at all.
  • Higher-level guardrails. Permission boundaries, organisation policies, constraints inherited from a parent unit: they can remove a right that the identity's policy grants.

In other words, knowing how to read a policy document is not enough to predict what an identity can really do. That is why AWS offers a policy simulator (IAM policy simulator, aws iam simulate-principal-policy) and Google Cloud a Policy Troubleshooter and a Policy Simulator: the tool gives the effective right, not a reading of the JSON. Azure offers a "Check access" screen that shows an identity's rights on a scope, without simulating a change. For Scaleway and OUTSCALE, the official CLI (scw, octl) exposes no simulation command: do not assume such a tool exists, and test with a test identity.

PrefixServiceExample actions
ec2:Computeec2:RunInstances, ec2:DescribeInstances
s3:Object storages3:GetObject, s3:PutObject
iam:Identitiesiam:CreateUser, iam:CreatePolicy

The * character replaces part of the action name. ec2:Describe* covers all read actions, and *:* covers everything, which amounts to restricting nothing at all.

Family 2: a role assignment on a scope

This is Azure's model, and it is disorienting when you come from AWS because you almost never write a document there. You assign an existing role to an identity, on a precise scope: a subscription, a resource group, or a single resource.

The permission is therefore born from the triplet who / which role / on what, and the scope is a first-class object, not a string in a Resource field. Roles accumulate by inheriting from the parent scope: a role given on a subscription applies to all the resource groups it contains.

What this changes in practice: you first look for the right scope, then the role. The opposite of the AWS reflex, where you first look for the actions.

Family 3: a binding held by the resource

This is Google Cloud's model, and it is the furthest from the other two. The policy is not attached to the user but to the resource, which declares the list of roles and, for each, the members who benefit from it.

# Reading: on THIS resource, these members have this role.
bindings:
- role: roles/compute.viewer
members:
- user:alice@example.com
- serviceAccount:ci@project.iam.gserviceaccount.com

Roles are mostly predefined (roles/compute.viewer, roles/storage.objectAdmin), and inheritance follows the hierarchy organisation, folder, project, resource.

What this changes: to find out what a person can do, you do not inspect their profile, you inspect the resources. It is destabilising at first, and much more readable afterwards when the question is "who has access to this bucket".

Inline policy or reusable object

In the first family, the same permission can be written in two forms that differ not by their content but by their lifecycle. An inline policy exists only attached to one object and disappears with it; a managed policy is a standalone object to which several users or groups attach.

TypeDescriptionAdvantagesDrawbacks
InlineWritten inside the user or groupSimple, single useNot reusable, disappears with its holder
ManagedIndependent object, attachable to severalReusable, versionableOne more object to administer

The same need, on five clouds

Let us take a concrete need and follow it everywhere: give Alice, a developer, the right to read the virtual machines, and nothing else. It is an ordinary case, and that is exactly why it reveals the differences well.

The approach is the same everywhere, and it is the one to remember: you create an identity, you put it in a grouping, you describe a permission, you attach the permission to the grouping rather than to the person. That last point is not a whim: the day Alice changes team, you move one person instead of rereading her rights one by one.

Prerequisites for this practical part. You need an administrator account on the cloud you want to try (or a dedicated test account, never your production), and only the CLI of that cloud: aws for AWS, scw for Scaleway, octl for OUTSCALE, az for Azure, gcloud for Google Cloud. You can test just one tab. The identities created are test identities: the cleanup section, after the tabs, deletes them. They serve to show the mechanism; in production, people come from the federation described below, not from users created by hand.

At Scaleway, a policy contains rules that link a permission set to a scope, here a project, and it attaches to a group. Scaleway users are invited by email; to keep a trial reproducible without inviting anyone, an IAM application (a technical identity) plays Alice's part. Replace <PROJECT_ID> with the identifier of your Scaleway project. The jq command extracts the identifier from each JSON response: install it if it is missing.

Terminal window
# 1. The test identity and the grouping
APP=$(scw iam application create name=alice-dev -o json | jq -r .id)
GRP=$(scw iam group create name=developers -o json | jq -r .id)
# 2. The membership
scw iam group add-member group-id="$GRP" application-id="$APP"
# 3. and 4. The permission (read-only on Instances, limited to the project)
# and its attachment to the group
POL=$(scw iam policy create name=DevReadOnly group-id="$GRP" \
rules.0.project-ids.0=<PROJECT_ID> \
rules.0.permission-set-names.0=InstancesReadOnly -o json | jq -r .id)

The InstancesReadOnly set is the one from the lesson Open your practice environment (in French). The scope comes from project-ids: the rule applies only to this project. Scaleway rules are allow-only, there is no Deny to write.

None of the five examples is exactly "the VMs and nothing else". At Scaleway, InstancesReadOnly covers all the read access of the Instances product, not only the machines; at AWS, ec2:Describe* also covers volumes, networks and security groups; at Azure, Reader covers the whole resource group; at Google Cloud, roles/compute.viewer covers all Compute Engine resources. Only the OUTSCALE example, which names the action api:ReadVms, is as narrow as the need. The precision of a right is decided in the detail of the action or role chosen.

Check the permission granted, then clean up the test identities

A right is verified, not assumed. At AWS, the policy simulator answers without running anything: ec2:DescribeInstances should be allowed and ec2:RunInstances implicitDeny. At Scaleway, OUTSCALE, Azure and Google Cloud, you reread the policy, group or assignment created. Replace the values in angle brackets with your own.

Terminal window
# AWS: simulate two actions for alice-dev (through her group)
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::ACCOUNT_ID:user/alice-dev \
--action-names ec2:DescribeInstances ec2:RunInstances \
--query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text
# Scaleway: reread the policy and the group's members
scw iam policy get "$POL" -o json
scw iam group get group-id="$GRP" -o json
# OUTSCALE: reread the group and its linked policies
octl iaas api ReadManagedPoliciesLinkedToUserGroup --UserGroupName developers
# Azure: reread the group's assignment
az role assignment list --assignee <GROUP_OBJECT_ID> --output table
# Google Cloud: see the project's bindings (already seen above)
gcloud projects get-iam-policy MY_PROJECT

Once the verification is done, delete the test identities: a forgotten account remains a way in. The order matters, you detach before deleting.

Terminal window
# Scaleway
scw iam policy delete policy-id="$POL"
scw iam group remove-member group-id="$GRP" application-id="$APP"
scw iam group delete group-id="$GRP"
scw iam application delete application-id="$APP"
# AWS
aws iam detach-group-policy --group-name developers \
--policy-arn arn:aws:iam::ACCOUNT_ID:policy/DevReadOnly
aws iam remove-user-from-group --user-name alice-dev --group-name developers
aws iam delete-policy --policy-arn arn:aws:iam::ACCOUNT_ID:policy/DevReadOnly
aws iam delete-group --group-name developers
aws iam delete-user --user-name alice-dev
# OUTSCALE
octl iaas api UnlinkManagedPolicyFromUserGroup --UserGroupName developers \
--PolicyOrn orn:ows:idauth::ACCOUNT_ID:policy/DevReadOnly
octl iaas api RemoveUserFromUserGroup --UserGroupName developers --UserName alice-dev
octl iaas api DeletePolicy --PolicyOrn orn:ows:idauth::ACCOUNT_ID:policy/DevReadOnly
octl iaas api DeleteUserGroup --UserGroupName developers
octl iaas api DeleteUser --UserName alice-dev
# Azure
az role assignment delete --assignee <GROUP_OBJECT_ID> --role "Reader" \
--scope /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>
az ad group delete --group developers
# Google Cloud
gcloud projects remove-iam-policy-binding MY_PROJECT \
--member="group:developers@example.com" --role="roles/compute.viewer"

The creation of access keys, the moment the secret key is displayed and the alternatives to the long-lived key are the subject of the lesson Temporary credentials and command-line access (in French). Applying these mechanisms with minimal rights is the subject of the lesson Least privilege in practice (in French), which also covers the concrete policy examples and the evaluation logic of permissions.

The next three sections leave configuration for design: these are the rules an architect sets and an engineer then implements at a provider. They require no hands-on work and no account, and they are also worth reading to understand what a security audit will ask you.

Identity federation means creating no human account in the cloud for daily work: the company directory authenticates the person, and the cloud trusts the proof it issues. This directory plays the role of identity provider (IdP) and remains the source of truth for people: an arrival, a team change or a departure is recorded there only once. Single sign-on (SSO) avoids one more password and lets you enforce the second factor and the session duration in one place.

Two standardised protocols, which describe how the directory passes this proof to the cloud, dominate: SAML 2.0, widespread in enterprises, and OpenID Connect (OIDC), more recent. Their operation is detailed in the guides SAML 2.0 and OpenID Connect (in French); this section keeps only the design decisions.

Federation has a net gain and a cost. The gain: a departure is handled in one place, federated accounts have no cloud password to steal, and sessions are short. The cost: the directory becomes a critical dependency, because if it goes down, no human can log in any more.

DecisionDesign choiceReason
Source of truthA single directory, fed by the human resources processA departure is handled once, in the right place
From group to rightA directory group gives a cloud role; a person never gives a permissionA review rereads groups, not hundreds of individual rights
Session durationShort (a few hours), second factor required at the IdPA stolen session expires on its own
Account creationAutomatic, through the SCIM protocol (System for Cross-domain Identity Management) when the provider supports itAvoids orphan accounts; see the SCIM guide
Local accountsForbidden, except break-glass accounts, the accounts that administer the whole environment and service identitiesNo bypass of SSO day to day
Break-glass accountTwo local accounts, long password kept under seal, hardware second factor, alert on every use, annual testAccess survives a directory outage

A break-glass account is a local account created outside federation for the day the directory no longer answers. Each account is named (one named person answers for it), under a second factor, never used in routine. It is powerful and dangerous: you store it the way you store a fire extinguisher. Each use triggers an alert, and the annual test proves it still works, because a break-glass account that is never tested fails on the day you need it.

A second exception concerns the accounts that administer the whole environment. Recommendation R11 of CERT-FR, in report CERTFR-2025-CTI-001 (cert.cyber.gouv.fr), asks that the most privileged accounts, those able to administer the entire cloud environment, be not hybrid, that is, not tied to the company directory. They are native to the provider's identity base, and used from dedicated administration workstations. The reason is simple: a hybrid account inherits the directory's weaknesses, and compromising the directory would then give control over the whole cloud. This does not contradict the federated identity used for daily work: that one carries the rights of a precise scope, whereas these accounts hold the whole environment and remain few.

Federation has a limit you need to know. Disabling an account in the directory does not cancel what already exists on the cloud side: an open session stays valid until it expires (unless explicitly revoked, when the provider allows it), and an access key created by hand outlives the account that created it. Hence short sessions, limiting personal access keys to cases where nothing else fits (pitfall 3) and the review described in the next section. Finally, support for SAML, OIDC and SCIM varies from one provider to another: check it before building the model on it. For the command line, the lesson Temporary credentials and command-line access (in French) says what is documented at each provider.

How do you manage access rights at joining, role change and leaving?

The lifecycle of access rights follows three moments, which the trade calls joiner, mover and leaver (arrival, change of role, departure), then a periodic review, called recertification, checks that the result is still right. The departure is the moment everyone thinks of, as pitfall 4 below reminds us. The mover case is the one people forget: a person who changes team keeps their old rights and receives new ones, which produces privilege creep, invisible as long as nobody rereads.

MomentWhat the architect requiresObservable evidence
JoinerRights come from membership in a role group; any right outside the role is requested, approved by the resource owner and carries an expiry dateA traced request with the approver and the end date
MoverThe rights of the old role are removed on the day of the change, not just supplementedThe person's groups before and after the change
LeaverDeactivation in the directory within the delay the requirement sets (a few hours, not days), then revocation of everything that lives outside the directory (access keys, personal tokens, third-party access) and takeover of the resources createdNo login after the departure date
ContractorAccount limited by an expiry date equal to the end of the contractThe end date present on the account

Separation of duties cuts dangerous chains across several people. The person who approves a change in production is not the one who deploys it: two distinct people are required. The same team, with the same role, can carry both approval and deployment, provided two distinct people perform them on a given change. Developers have neither the right to approve nor the right to deploy in production, and all access to production is temporary, granted for a limited duration then removed. The section How do you separate sensitive responsibilities across several identities? (in French) details other chains to cut.

Recertification is a review in which the person responsible for an access confirms or removes, line by line, each right of their teams. The reviewer is the line manager or the resource owner, not the technical administrator: the latter sees the rights but does not know whether the person still needs them. Each lifecycle event (joiner, mover, leaver, recertification) has a named owner and a quantified deadline, written into the requirements: without them, nobody acts. An access that nobody confirms is removed, not kept by default. Plan at least one annual review for all accesses, and a more frequent one for privileged accounts; this page's checklist suggests a quarterly rhythm. The trace of the review (date, reviewer, decisions) is the evidence an auditor asks for.

Governance rests on three design rules. Each group and each service identity has a named owner, who answers for its rights. The indicators are measured: number of accounts with no login for a duration you set (for example 90 days), delay between a departure and the complete removal of access, share of rights never used. Finally, account creation automated by SCIM reduces the gap between the directory and the cloud, without removing it: accounts created outside the directory still have to be checked. The SCIM guide covers clean departure on the protocol side, and the reference IAM and cloud access (in French) lists the access review requirements.

What should the architect require from the audit log?

The audit log must make it possible to answer, months after the fact, one question: who did what, on which resource, from where, when and with what result. The provider produces one, but its default settings rarely meet a traceability requirement. The architect does not choose a product: they set five requirements that the implementation must respect, each of which can be checked.

RequirementWhat the architect setsVerification question
What to logActions on the control plane, that is, the calls that manage resources (creation, modification, deletion, permission changes, logins, failures, authorisation denials); data access only where sensitivity justifies it, because it is voluminous and costlyCan you find out who deleted this resource?
How longThe longer of two delays: the applicable legal obligation, and the time your organisation needs to detect an intrusionDoes the provider's default retention cover that delay?
WhereStorage separate from what is logged, in another account or project, write-only for the sourceCan a production administrator erase their own trace?
Who readsThe security team and audit, read-only; production administrators do not administer the log vaultWho can change the retention or delete a log?
Which alertsA small number of events that wake a humanIs someone notified when the log stops?

Alerts should target the events nobody should miss: use of the break-glass account or the root account, modification of a permission policy, creation of an access key, and above all the stopping or modification of logging itself. A competent attacker cuts the log first; the alert on that stop turns their attempt into a signal.

The Foundations Benchmarks of the Center for Internet Security (CIS) ask for an alert on several of these events. The CIS AWS Foundations Benchmark v3.0.0, section 4 "Monitoring", targets use of the root account, modification of permission policies, modification of the logging configuration and console authentication failures; check the version and numbering for your provider. An alert on the creation of an access key and on the use of the break-glass account is a good-practice addition, not a requirement of that benchmark. Add repeated authentication failures and any login from outside the expected perimeter.

Three properties make the log usable. Each entry carries a named identity: with a shared account, the log says "the admin account" and teaches nothing. Clocks are synchronised, otherwise you cannot rebuild a timeline across systems. Finally, coverage differs from one provider to another: some calls are not logged by the main audit log, as the lesson Operate: logs, alerts, incidents and changes (in French) details. For the duration, the site's reference Logging and audit (in French) requires at least six months, subject to legal obligations. It is not a universal rule: set your delay according to your legal obligations and the time needed to detect an intrusion. The separation between who acts and who checks is covered in the section on separation of responsibilities in the lesson Least privilege in practice (in French).

Common pitfalls and how to avoid them

These five mistakes are classics of badly kept cloud accounts. None is technical in nature: they are shortcuts taken under deadline pressure, whose cost only shows up on the day of the incident or when a colleague leaves.

Pitfall 1: "Full Access for everyone, we'll tighten it later"

"Later" almost never comes: as long as rights stay broad, a mistake or a compromised account can destroy everything. So start with minimal permissions and add more as needed, because it is easier to add a right than to remove one (and to convince a team to lose one).

Pitfall 2: "I use the root credentials for my scripts"

If a script that carries the root credentials is compromised (accidental Git commit, exposed log), the attacker gets total access. Give the script a dedicated identity with minimal permissions instead. Prefer temporary credentials obtained through a role, or workload identity (OpenID Connect, OIDC) for a continuous integration pipeline; a long-lived user key is only the last resort.

Pitfall 3: "All the developers share the same access keys"

When several developers share the same keys, nobody can tell who did what, and revoking a key penalises everyone. Give each person an identity: a console login or an assumed role (temporary credentials) for a human. If an access key is really needed, it is named and never shared.

Pitfall 4: "I never revoke the access of people who leave"

A former employee or a contractor whose access is not revoked keeps control over the infrastructure. Build the revocation of cloud access into the departure process (offboarding) and disable access keys without delay.

Pitfall 5: "I don't document my policies"

In six months, nobody will know why a given policy exists or what it does if it is not documented. Use the Sid field to name each statement clearly, and keep external documentation if needed (wiki, Git repository).

Troubleshooting

Almost all IAM errors show up as a single message, Access Denied. Depending on the provider and the service, it names the cause more or less well: at AWS, most messages cite the denied action and the type of policy involved, but some services do not use this format. The table therefore matches the observable symptom to the most likely cause and to the check to do first.

SymptomProbable causeSolution
Access Denied on an actionMissing policy or explicit DenyCheck the policies attached to the user and their groups
The user does not see their own resourcesThe Read* / Describe* action is missingAdd the read permissions
Unable to create access keysThe user lacks the right to create keys (iam:CreateAccessKey at AWS)Only an admin can create keys for others
Policy attached but with no effectThe policy is not attached to the right group/userCheck the attachment with the CLI
Privilege escalation detectedA user has iam:* or can create other usersRemove these dangerous permissions
At Scaleway, a list command returns an empty table without errorlist commands filter silently: a project outside your scope looks empty, but it is not necessarily emptyDo a get on the identifier of a known resource: the answer says unambiguously whether access is denied (see Open your practice environment (in French))

To find out who did what and when once the right at fault is identified, consult the provider's audit log; at Scaleway, it is presented in Audit Trail (in French). What to require from this log is detailed in the section What should the architect require from the audit log?.

Checklist: set up IAM properly

Three lists, depending on the moment: the initial setup of the account, the arrival of a user, and the periodic review. The third is the one that gets abandoned most often, yet it is the only one that detects access that has become unnecessary.

To get started

These five actions are done only once, as soon as the account is opened, and condition everything else. The two lines on the root concern the clouds that have one (AWS, OUTSCALE); elsewhere, apply the same logic to the administration role.

  • Use a named federated identity (SSO) with the administration rights of its scope (account, project) for daily work, instead of the root and with no shared local user
  • Enable MFA on the root account, or on the organisation's administration account where no root exists
  • Secure the root credentials in a safe place (vault, secrets manager)
  • Create groups matching the roles in your organisation
  • Define policies based on least privilege

For each new user

To run through at each arrival. The explicit name is a point often overlooked, yet it is what makes the audit logs readable six months later.

  • Create the identity with an explicit name (firstname-role or service-function): a local IAM user only if federation is not in place
  • Add it to the appropriate group(s)
  • Create access keys only as a last resort (and pass them on securely)
  • Document the role and the expected rights

For the regular audit (quarterly)

A quarterly review is enough in most organisations. It looks for gaps: accounts not revoked after a departure, policies that have become too broad over successive requests, and access keys that are too old.

  • List all users and their groups
  • Check that people who have left no longer have access
  • Review the policies: are they still suited to current needs?
  • Check the age of access keys and renew them if needed (90 days at most, for example)
  • Identify unused credentials and delete them

Put it into practice

The lab has you write the access model of a company preparing its first cloud environment, with no cloud account and no provider chosen. You start from a constraints file (directory, protocol, roles, deadlines, audit requirements) and produce a JSON file that describes the federation and the session, the break-glass accounts, the role groups, the separation of duties, the lifecycle and the audit log. The validation, which checks no real IAM, controls five points: the source, the protocol, single sign-on (SSO) and the bounded session duration; at least two named break-glass accounts, under a second factor, outside everyday use and with an alert; the tasks of each role, with approval and production deployment entrusted to two people and temporary access; an owner and a deadline for each lifecycle event; an audit log that holds the required events, the retention, the immutable destination with its owner, the readers and the alerts.

Key takeaways

  • IAM controls who can do what on your cloud infrastructure. Without IAM, everyone uses the all-powerful root user: reserve it for exceptional operations, enable MFA on it and give people named identities, preferably federated with the company directory, for daily work.

  • Each person or service has their own identity, never shared. Prefer temporary credentials (assumed role, OIDC for CI) to long-lived access keys; if a key is unavoidable, it is named.

  • Groups simplify management: a policy attached to a group applies to all its members. Organise by role (dev, ops, readonly, billing).

  • Policies define permissions: a JSON document at AWS and OUTSCALE, rules that link permission sets to a project or to the organisation at Scaleway, a role assigned on a scope at Azure, a binding held by the resource at Google Cloud. This is not a difference of vocabulary, it is where the permission lives.

  • The principle of least privilege is the foundation: grant only the strictly necessary permissions, everything else being forbidden by default (deny by default). It is applied and checked in the dedicated lesson.

  • The company directory remains the source of truth for people: federation (SAML, OIDC) avoids local human accounts for daily work, enforces the second factor and short sessions. Two exceptions are justified: two tested break-glass accounts for the day the directory goes down, and the accounts that administer the whole environment, native to the provider (CERT-FR recommendation R11).

  • Rights follow the person's life: arrival by role group, removal of old rights on a role change, complete revocation on departure, then recertification by the access owner, with a retained trace.

  • The audit log is specified: events covered, retention set, separate storage out of reach of administrators, and an alert when logging stops.

Knowledge check

Check that you have grasped the essentials of this guide. The questions cover only what has just been explained here.

Knowledge check

Check what you have learned with this interactive quiz

8 questions
8 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer