Skip to main content

Least privilege

Least privilege means every identity, human or machine, holds only the permissions its role needs, for only as long as it needs them. Every edition of the BuiltForProd Baseline gives people access only through groups, narrows that access toward production, signs pipelines in without a stored key, and decides who can decrypt each stage's secrets with a per-stage key.

Why it matters in production​

Access that grew one exception at a time is how a former contractor still has admin, how a leaked key stays valid for six months, and how a session meant for development deletes something in production. Least privilege limits what a mistaken or compromised identity can do, and short-lived credentials limit for how long. It is also the control every security questionnaire asks about first.

How each edition implements it​

Every edition has the same role groups: Platform Leads and Engineers, DevOps Leads and Engineers, App, ETL and AI leads and members, Security Auditors and their lead, and a break-glass group on Azure and GCP. Write access narrows toward prod: engineers change the lower stages, prod is read-only for everyone except the two lead groups, and auditors read configuration without reading the data it protects. Pipelines federate from GitHub, and secrets are encrypted with one key per stage whose access policy, not GitHub, decides who can decrypt.

AspectAWS Enterprise BaselineAzure Enterprise BaselineGCP Enterprise Baseline
PeopleIAM Identity Center permission sets for ACME_* groupsAzure RBAC for 13 ACME_* Entra groups plus ACME_BreakGlassIAM bindings for 14 Google groups at organization, folder and project
Admin accessPlatformAdmin and DevOpsAdmin permission setsOwner and Security Admin, eligible through PIM when enable_pim is onOwner through Privileged Access Manager, at most 12 hours, on by default
AuditorsSecurityAuditor with an explicit deny on data readsSecurity Reader and the custom role acme-security-auditorOrganization-level reviewer roles and IAM deny policies on data and workload logs
PipelinesGitHub OIDC, a role per blueprint repository and stage, a read-only role for Baseline plans and drift, a role chainOne federated managed identity per blueprint repository and stage, exact subjectsWorkload Identity Federation, a CI service account per blueprint repository and stage, a read-only drift account, impersonation
WorkloadsEKS Pod IdentityMicrosoft Entra Workload IDWorkload Identity Federation for GKE
Secrets keysKMS key per stage, acme-sops-<stage>Key Vault key per stage, sops-<stage>Cloud KMS key per stage, sops-<stage>

AWS Enterprise Baseline​

Human access is IAM Identity Center only, administered from core-identity, with twelve-hour sessions and no IAM users.

GroupCore accountssandbox, dev, stagingprod
ACME_PlatformLeadsPlatformAdminPlatformAdminPlatformAdmin
ACME_PlatformEngineersPlatformEngineerPlatformEngineerReadOnly
ACME_DevOpsLeadsReadOnlyDevOpsAdminDevOpsAdmin
ACME_DevOpsEngineersReadOnlyDevOpsEngineerReadOnly
ACME_AppDevelopers, ACME_ETLEngineers, ACME_AIEngineersnonesandbox and dev (leads also staging)ReadOnly
ACME_SecurityAuditorsSecurityAuditorSecurityAuditorSecurityAuditor

Each blueprint repository has one role per stage, such as acme-aws-blueprint-webapp-infra-dev-deployer, that trusts only its repository's jobs in that stage's GitHub Environment and may assume only acme-terraform-deployer in that stage's account; its state goes through acme-terraform-state-<stage>, which reaches only that stage's state keys. A code repository adds a build role that can only push to its own ECR repository. The Baseline's acme-aws-platform-baseline-deployer accepts only the prod Environment, so only the reviewed apply job can write; its pull request plans and drift checks run as acme-aws-platform-baseline-reader, which reaches only the read-only acme-terraform-reader in each account. Cross-account roles express one relationship each (state access, DNS records, SSM reads). SOPS keys acme-sops-<stage> let every engineer group use sandbox and dev and only the two lead groups use staging and prod. Workloads use EKS Pod Identity, and the acme-security-guardrails service control policy denies IAM users and access keys and requires MFA for anything but SSO sessions and acme-* platform roles.

Azure Enterprise Baseline​

People get access only through 13 ACME_* Microsoft Entra groups plus ACME_BreakGlass, which your IT creates and the code looks up by display name, or which the code creates with create_groups. Every role assignment is at management-group or subscription scope, and a custom policy at mg-acme denies role assignments to individual users. Engineers hold Contributor on the lower stages (developers on sandbox and dev, their leads also on staging) and read prod through ACME_AllEngineers, with the AKS data-plane roles following the same line: RBAC Writer or Cluster Admin below prod, RBAC Reader with the Cluster User Role on prod.

Owner at mg-acme (Platform Leads) and on the plat subscriptions (DevOps Leads), and Security Admin for the Platform Leads, are standing until enable_pim turns them into Privileged Identity Management eligible assignments, activated for at most 12 hours with MFA and a justification. PIM needs Microsoft Entra ID P2 for every eligible user. Five Conditional Access policies require MFA, block legacy authentication and require phishing-resistant MFA for privileged roles; they start report-only (enabledForReportingButNotEnforced). Auditors hold Security Reader and the custom role acme-security-auditor, without data-plane access.

Each blueprint repository has one user-assigned managed identity per stage in acme-core-auto, such as id-acme-azure-blueprint-webapp-infra-dev-deployer, whose only federated subject is environment:<stage>; each code repository adds a build identity, such as id-acme-azure-blueprint-webapp-code-build, that accepts only main and holds only Container Registry Repository Writer on its own image repository. The Baseline identity id-acme-azure-platform-baseline-deployer accepts only environment:prod, so its plans, applies and drift checks all wait for the prod reviewers. No client secret and no role chain exist. The Baseline identity is Owner at mg-acme; the blueprint infrastructure identities hold the custom role acme-blueprint-deployer on their own stage's plat subscription only and may assign only allow-listed roles, through a Role Based Access Control Administrator assignment with an attribute-based condition.

The SOPS vault kv-acme-eus2-sec-sops holds one RSA 4096 key per stage, sops-<stage>. The lead groups hold Key Vault Crypto User on every key; the engineer and developer groups on sops-sandbox and sops-dev only; each stage's syncer identity, id-acme-secrets-<stage>-syncer, on its own stage's key only. In the clusters, External Secrets, cert-manager and the application authenticate with Microsoft Entra Workload ID.

GCP Enterprise Baseline​

People get access only through 14 Google groups, 13 role groups plus acme-break-glass, named acme-<role>@company.com and bound through one data-driven matrix at the organization, the folders and the stage projects. Engineers hold an editor bundle on the lower stages and a viewer bundle on prod; the non-lead App, ETL and AI groups have no staging binding at all.

The lead groups reach Owner only through Privileged Access Manager entitlements of at most 12 hours: Platform Leads on the core and plat folders without approval, DevOps Leads on plat with a platform lead's approval, and organization administration with another platform lead's approval. Standing Owner exists only with enable_pam = false. Auditors hold reviewer roles at the organization, read audit logs only in acme-core-audit, and IAM deny policies keep data and workload logs closed to them.

Pipelines authenticate through Workload Identity Federation: each blueprint repository has one CI service account per stage in acme-core-auto, such as sa-acme-webapp-infra-dev-ci, bound only to its repository's jobs in that stage's GitHub Environment, and each code repository adds a build account such as sa-acme-webapp-code-build. The Baseline's sa-acme-baseline-ci runs plans and applies in the prod Environment, and its drift checks run as the read-only sa-acme-baseline-drift. The infrastructure repositories' accounts impersonate the deployer of their own stage's project only, the code repositories' accounts hold only direct, resource-scoped grants on what they release to and never impersonate a deployer, and organization-scoped units run as the Baseline's CI account. The organization policy iam.disableServiceAccountKeyCreation blocks service account keys everywhere.

Cloud KMS holds one key per stage, sops-<stage>. The lead groups can encrypt and decrypt with every key, the engineer groups with sops-sandbox and sops-dev, and each stage's secrets syncer, such as sa-acme-secrets-syncer-dev, can only decrypt with its own stage's key. In the cluster, the application's Kubernetes service account is an IAM principal directly through Workload Identity Federation for GKE, with no Google service account in between.

Worked example: a developer's day​

On the Azure edition, a member of ACME_AppDevelopers signs in with az login. The group holds Contributor and Azure Kubernetes Service RBAC Writer on acme-plat-dev, so the developer can build and debug there, and reads acme-plat-prod through ACME_AllEngineers (Reader, AKS RBAC Reader and the Cluster User Role), so a production incident can be inspected but not changed.

To change a dev secret, the developer edits dev/sample.yaml with SOPS: the group holds Key Vault Crypto User on sops-dev, so encryption works. The same edit in prod/ fails at decryption, because the group has no role on sops-prod. To ship, the developer merges code and lets the pipeline, signed in with its federated identity, do the rest, as described under GitOps.

Common mistakes​

  • Granting a group prod write access to save time. Prod is read-only for every role except the two lead groups by design; a change to prod goes through a pull request.
  • Treating repository access as the secrets boundary. Who can decrypt prod/ is decided by the KMS key policy, Key Vault RBAC or Cloud KMS IAM, not by repository access.
  • Storing a cloud key in GitHub secrets. No edition needs one: the pipelines federate, and a stored key is a long-lived credential the design set out to remove.
  • Creating an IAM user for a tool (AWS). The guardrail policy denies it. Use an Identity Center group for people or an OIDC-federated role for automation.
  • Naming a workload role outside acme-* without the mfa-exempt tag (AWS). The MFA statement of the guardrail policy denies it; the symptoms are AccessDenied or Client.InternalError on EBS and KMS.
  • Assigning a role to an individual user (Azure). The custom policy at mg-acme denies it; add the person to the group instead.
  • Creating a service account key (GCP). The organization policy denies it; use Workload Identity Federation or impersonation.