The wildcard sits in production for years before anyone notices. A service account was created in the first sprint to "get things moving" — full read/write on the storage bucket, full read on the database, the permissions copied verbatim from a Stack Overflow snippet. The original engineer left, the bucket grew, the database accumulated customer PII, and the account quietly retained every permission it ever needed plus a long tail of permissions it never needed. Then someone exfiltrates a CI/CD token from a contributor's laptop, the token loads the service account credentials, and the company discovers what its broadest IAM scope actually permits the day it permits an attacker to walk through it.
This is the failure pattern IAM least privilege addresses. Not the dramatic zero-day, not the sophisticated nation-state. The mundane, inevitable moment when one credential is compromised and the blast radius is whatever the team left in place when they were busy shipping. Every breach post-mortem from the past decade — public ones included — contains the same sentence in some form: the compromised account had permissions far beyond what it needed to do its job. The architecture that prevents the next instance of that sentence is what this article is about.
Least privilege is the most universally agreed-upon and most routinely violated principle in cloud security. Every CISO will tell you they believe in it. Every audit report will recommend it. Almost no team implements it cleanly because doing so means writing IAM policies that are tighter than the convenience of *, maintaining them as the system changes, and resisting the small daily temptation to widen a scope to unblock a deploy. The discipline is not glamorous. It is the difference between an incident contained in hours and an incident that runs for weeks.
What follows is the structure that makes least privilege the path of least resistance rather than the path of most diligence — what an IAM least-privilege architecture actually looks like, how to put one in place from environment one, and where it sits inside Built to Last™ 2.0 as a P05 Right Code discipline.
Why broad IAM is the most expensive cheap shortcut
The cost of broad IAM is invisible until it isn't. A wildcard policy that lets a service account read every bucket in a project saves a few minutes when the policy is written. It saves nothing thereafter. It accumulates cost in three quiet places.
The first is blast radius. Every compromised credential — and credentials do get compromised, through leaked tokens, phished developers, supply-chain attacks on dependencies, exposed environment variables in CI logs — gives the attacker the union of every permission the credential held. Broad permissions turn a contained intrusion into a multi-system breach. The same incident, against a least-privileged credential, lets the attacker touch a single resource and trips a monitoring alert when they try to reach anything else.
The second is audit drag. Every annual ISO 27001 review, SOC 2 examination, and PCI-DSS assessment includes an access-review section. A team running broad IAM spends the weeks before audit grinding through every role, mapping every permission to a justification, and tightening what should never have been loose. A team running least privilege from sprint one spends those weeks demonstrating evidence the controls are already in place. The audit cost is real and recurring; least privilege turns it from a project into a check.
The third is governance. Australian Privacy Principles, GDPR, the EU AI Act, NIST AI Risk Management Framework — every modern regime expects the operator to demonstrate that access to data is scoped to need-to-know. "Least privilege as a principle we aspire to" is not a control. "Least privilege enforced by code, reviewed in every pull request, and auditable from the IaC history" is. The gap between those two postures is what regulators are asking about, and it is what insurers price into cyber policies.
The Stack Overflow Developer Survey has reported, across multiple years, that security and DevOps disciplines rank among the most-cited friction points in modern engineering work — the practices teams know they should do, defer, and then pay for. Least privilege is the canonical example. It is universally endorsed and routinely deferred until the day deferral becomes expensive.
What an IAM least-privilege architecture actually is
IAM least-privilege architecture is the discipline of granting every identity — human, service, workload, or pipeline — exactly the permissions it needs to perform its function, and nothing else. The Built to Last 2.0 framework treats it as a P05 Right Code concern because the policies live in code, are reviewed in pull requests, and are deployed through the same pipeline that ships application changes. The architecture is what passes a security review rather than what triggers one.
It has six concrete components.
Role boundaries scoped to function.
Permissions specified, not inherited.
MFA enforced for every human identity.
No long-lived credentials.
Policies as code, in version control.
Continuous access review.
The architecture produces a single decision on every change: does this new role, or this new permission on an existing role, represent the minimum scope this function requires? The output is a policy document tight enough that an audit can read it and a small enough surface that an incident can be contained.
Failure modes exist even when the architecture is in place. The first is policy decay: roles accumulate permissions through emergency tickets that are never reverted. The second is shadow IAM: a developer creates a role through the console outside the IaC because the IaC change felt slow; the role exists, drifts, and is forgotten. The third is wildcard creep: s3:Get* is added because three actions were needed and somebody preferred convenience to precision; the wildcard then covers actions added by the provider months later. Each failure mode has a fix — IaC enforcement, drift detection, automated linting — and none is solved by writing the policies once and walking away.
A concrete walkthrough. The payments service in a fintech build needs to read a configuration object, write to an outbox queue, and call a third-party processor through a secrets-managed token. The least-privilege policy is roughly: s3:GetObject on the specific config/ prefix in one bucket; sqs:SendMessage on the specific outbox queue ARN; secretsmanager:GetSecretValue on the specific processor-token ARN; and nothing else. No iam:*, no s3:*, no broad SQS. If the service is later asked to read a new bucket, the change is a one-line addition to the policy, reviewed in a pull request, and visible in the audit trail. The team that wrote the original policy three months ago did not need to predict every future permission. They needed to make widening the policy a documented, reviewable act.
How to put it in place
The architecture is straightforward to define and hard to maintain. The discipline is in the maintenance, which is why the implementation order matters.
Week one is policy authorship in IaC. Pick the highest-sensitivity workload first — usually anything that touches production data or production payments — and write its IAM in Terraform or your equivalent. Use the cloud provider's policy simulator to confirm the policy permits what the workload needs and denies what it does not. Disable any human-console route to creating IAM in that account; enforce IaC as the only path through cloud-side guardrails such as service control policies or organisation policies.
Week two is MFA enforcement and the identity provider. Every human identity is federated through the company SSO. MFA is required for the SSO. Direct console logins as IAM users are disabled. Break-glass accounts are documented, MFA'd with hardware keys, and stored in a sealed envelope with an opening procedure that triggers a notification to security leadership.
Week three is removing long-lived credentials. Audit every static access key in every account. For each, identify the workload that uses it. Replace with workload identity federation, IAM roles for service accounts, or OIDC-based short-lived credentials from your CI provider. Rotate any keys that cannot be eliminated immediately, and add a calendar entry to revisit them within the quarter.
Week four is continuous review. Enable the cloud-native access analyser. Schedule a monthly automated report of permissions granted versus permissions exercised. Route the report to the engineer who owns the relevant service. Tie the report into the existing engineering rituals so it is read, not ignored. For teams running this alongside the rest of their DevOps practice, the access review fits neatly into the cadence captured in EB Pearls' DevOps engagement model.
A few common mistakes are worth naming. Do not start with the lowest-sensitivity workload — the policies you write there will be copied into the high-sensitivity ones, and copies carry the original looseness. Do not skip the IaC enforcement step — every team that allows console-edited IAM ends up with shadow roles. Do not let an emergency permission widen a policy without a follow-up ticket to narrow it; emergencies are how policies decay.
Implementation depends on the Secrets Management Standard, the CI/CD Pipeline Implementation, and the IaC Code Standards & Module Library. A reader who wants the broader sequencing context can read EB Pearls' project delivery framework, which sets out how P05 Right Code disciplines sit alongside the rest of the build cadence. Teams running this on a custom software engagement or extending in-house capability through embedded engineers and staff augmentation tend to inherit the architecture from the outset rather than retrofit it.
A breach that cost weeks instead of hours
A mid-sized SaaS client we worked with — engineering team of around twenty, B2B platform handling customer integration data — discovered the cost of broad IAM the way most teams do. A contractor's laptop was compromised; the laptop had a long-lived access key with broad permissions across the staging account; staging and production shared more cross-account trust than the team realised.
The incident response took most of three weeks. The team had no clean inventory of what the key could touch, which meant every bucket, table, and queue in staging had to be assumed compromised and reviewed manually. Several of those resources held snapshots of production data taken for debugging. The notification obligations under Australian Privacy Principles applied. Legal review, customer communication, and the engineering work to rotate every static credential in both accounts consumed weeks of senior time.
The remediation became the company's first least-privilege rollout. Every IAM policy was rewritten in Terraform and scoped to function. Every long-lived access key was eliminated; CI authenticated through OIDC; service accounts used workload identity federation. MFA was enforced through SSO for all human access. Cross-account trust was tightened to the specific roles and resources that legitimately required it. The whole rollout took six weeks.
Twelve months later the same client had a similar incident — a leaked CI token from a forked pull request on a public-facing repo. This time the token's role permitted exactly one action on exactly one resource. The monitoring alert fired within minutes when the token attempted to enumerate resources it did not have access to. The incident was contained inside an afternoon. The lesson the team took away was not that breaches can be prevented — they cannot — but that the work between "incident detected" and "incident contained" is set by the architecture in place before the incident, not by the response capacity afterward.
When this discipline is critical, and when it can flex
IAM least privilege is critical from the first environment in any system that handles customer data, financial transactions, or regulated information. That covers most products. The cost of retrofitting it later — as the example above describes — is several times the cost of building it correctly from sprint one. There is no realistic engagement where the architecture is wrong from week one and right by week twelve at lower total cost than getting it right initially.
It is critical for anything subject to ISO 27001, SOC 2, PCI-DSS, HIPAA, GDPR, or the Australian Privacy Principles, where the burden of evidence sits with the operator and "we trust our developers" is not a control framework. It is critical for AI workloads under the EU AI Act and NIST AI Risk Management Framework where the data flowing through the model has scope obligations. It is critical for any team that intends to raise capital, sell upmarket, or be acquired — every due diligence checklist asks the question.
It can flex — slightly — for short-lived internal proofs of concept with synthetic data, where the entire environment is destroyed at the end of the experiment and no production data is involved. Even there, MFA on human access and IaC-defined IAM are worth keeping. The discipline that is hard to add later is the IaC and the workload identity federation. Skip those and the proof-of-concept that succeeds will graduate into production with the wrong architecture.
The honest answer for almost every team: this is not the discipline to defer.
What to do next
Pick one production workload this week and write its IAM policy out longhand in your IaC. Compare what the policy says to what the workload currently has. The gap is your starting work. From there, the rest of the architecture — MFA, no long-lived credentials, continuous access review — follows in the sequence above.
For the broader picture of how IAM least privilege sits inside an AI-native delivery practice, see how EB Pearls delivers custom software. The next BTL component most security-conscious teams pair with this one is the Secrets Management Standard — the architecture that prevents the credential leak in the first place.
Frequently Asked Questions
What permissions does each service actually need?
The honest first answer is that nobody knows precisely until the workload runs and gets observed. Start by enumerating the resources the service must reach — specific buckets, specific tables, specific queues — and the actions it must perform on each. Write the policy at that scope. Then run the cloud-native access analyser or its equivalent for the first week of operation; it surfaces both the permissions used and the permissions denied that the service tried to use. Tighten the policy against actual usage. The policy that emerges after one week of observed traffic is almost always tighter than the one written from imagination.
Can we enforce MFA across the team without breaking productivity?
Yes, when MFA is federated through SSO rather than bolted onto each cloud account individually. The engineer logs in once to the identity provider with MFA and federates from there to every cloud account through SSO roles. Direct IAM-user logins are disabled. Break-glass accounts are documented and rare. Productivity friction comes from MFA done badly — a separate token per account, a separate login flow per workload — not from MFA itself.
How do we audit IAM permissions on an ongoing basis?
Through continuous, automated access review rather than annual snapshots. Enable the cloud-native access analyser. Schedule a monthly job that compares granted permissions to permissions exercised in the last 90 days, generates a delta report per role, and assigns each delta to the role's owner. Track the closure rate. A team where every monthly report results in tightening or justification is a team where audit evidence is being built continuously. A team where the report is generated and ignored has the worst of both worlds: the visibility and none of the discipline.
Will this pass a compliance audit?
The architecture described meets the access-control requirements of ISO 27001, SOC 2, PCI-DSS, HIPAA, and the access principles of the Australian Privacy Principles and GDPR. Passing the audit depends on the evidence — the IaC repository, the pull request history, the access-review reports, the MFA enforcement records — being well-organised and available to the auditor. Teams that run least privilege from the start tend to pass first time. Teams that retrofit it usually pass on the second attempt after the auditor's first-round findings have been remediated.
How do we handle the emergency permission case?
Through a documented break-glass procedure rather than ad-hoc widening of production roles. The procedure typically: an engineer with seniority authorises a temporary elevated role for a specified duration; the elevation is logged and notifies security leadership; the elevation expires automatically; a post-incident review confirms whether the elevated access was used appropriately and whether the underlying need can be served by a permanent, scoped permission rather than a repeat elevation. Without this procedure, emergencies become the most common source of policy decay.
How do we manage IAM for AI and machine-learning workloads specifically?
The same principles, with two specific concerns. AI workloads often pull from broader data sources — embeddings, training data, retrieval corpora — than typical services, and the temptation is to grant wide read access for convenience. Resist it: scope to the specific data the workload requires, and route any new data sources through an explicit policy change. Second, AI inference endpoints frequently call other services or external APIs; those credentials should be short-lived and the called services should themselves be least-privileged. Under the EU AI Act and NIST AI Risk Management Framework, the access controls around the model and the data are part of the governance posture.
How does this relate to the Production Readiness Review?
Khusbu ensures top-quality project delivery while fostering growth. Her dedication to excellence drives her to be a best-in-class Project Manager.
Read more Articles by this Author