Distribuée
Cloud & AI Security
← All insights

Cloud posture

AWS break-glass and root account: the minimal runbook for 5 to 50 accounts

Remove root credentials from member accounts, deny root with an SCP, keep a tested emergency path and alert via CloudTrail: a minimal break-glass runbook for SMB AWS orgs.

· 7 min · #root#break-glass#scp#aws-organizations#cloudtrail#iam#assumeroot

In most AWS organizations with 5 to 50 accounts, the root user of every member account still exists: a password somewhere, sometimes an MFA on a former employee’s phone, sometimes nothing at all. Nobody uses it, so nobody thinks about it, until an SSO outage or a bad S3 policy forces someone to use it, or until someone else does. This article proposes a minimal four-part runbook: remove root from member accounts, block what remains, keep a tested emergency path, and alert on any use.

The threat: an all-powerful account outside your governance

The root user has full rights on its account. It bypasses identity-based IAM policies and, until you set an SCP, any organization-level restriction. Three scenarios keep coming back:

  1. Email-based recovery. Root is reset through the mailbox attached to the account. A personal address of a former employee, or a poorly protected mail alias, becomes a takeover path.
  2. Forgotten root access key. A key created in the “we’ll fix it later” days stays valid forever, and is not subject to MFA.
  3. Accidental lockout. A bucket or queue policy with a Deny on all principals makes the resource unreachable, even for administrators. Historically only root could fix it.

AWS documentation is explicit: root access should be secured centrally in an organization, and accounts created through Organizations have no root credentials by default.

Control 1: remove root credentials from member accounts

Since late 2024, AWS offers centralized root access management (AWS announcement). Two capabilities, enabled from the management account:

  • Root credentials management: the management account (or the IAM delegated administrator) can delete the password, access keys, signing certificates and deactivate MFA of a member account’s root.
  • Privileged root actions: short sts:AssumeRoot sessions, scoped to one task, replace signing in as root.

The tasks covered by managed policies (root-task/...) are: auditing root credentials (IAMAuditRootUserCredentials), recreating a password (IAMCreateRootUserPassword), deleting credentials (IAMDeleteRootUserCredentials), unlocking an S3 bucket policy (S3UnlockBucketPolicy) and an SQS queue policy (SQSUnlockQueuePolicy). Source: IAM docs, privileged tasks.

# From the management account (or the IAM delegated admin)
aws organizations enable-aws-service-access --service-principal iam.amazonaws.com
aws iam enable-organizations-root-credentials-management
aws iam enable-organizations-root-sessions

# Inventory: which accounts still have root credentials?
for acct in $(aws organizations list-accounts --query 'Accounts[?Status==`ACTIVE`].Id' --output text); do
  [ "$acct" = "$(aws sts get-caller-identity --query Account --output text)" ] && continue
  creds=$(aws sts assume-root --region eu-west-3 \
    --target-principal "$acct" \
    --task-policy-arn arn=arn:aws:iam::aws:policy/root-task/IAMAuditRootUserCredentials \
    --duration-seconds 900 --query Credentials --output json)
  echo "== $acct"
  AWS_ACCESS_KEY_ID=$(jq -r .AccessKeyId <<<"$creds") \
  AWS_SECRET_ACCESS_KEY=$(jq -r .SecretAccessKey <<<"$creds") \
  AWS_SESSION_TOKEN=$(jq -r .SessionToken <<<"$creds") \
    aws iam get-account-summary \
      --query 'SummaryMap.{RootAccessKeys:AccountAccessKeysPresent,RootMFA:AccountMFAEnabled}'
done

Requirements, all from the docs: AssumeRoot calls need a regional STS endpoint (the global endpoint is not supported), root itself cannot call it, and --task-policy-arn is mandatory. To delete, rerun the same loop with IAMDeleteRootUserCredentials, then delete-login-profile, delete-access-key, delete-signing-certificate and deactivate-mfa-device with the session credentials.

To restrict who can do what, the sts:TaskPolicyArn condition key lets you allow, for instance, only the audit task to the review role and deletion only to the admin role:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AssumeRootAuditOnly",
    "Effect": "Allow",
    "Action": "sts:AssumeRoot",
    "Resource": "*",
    "Condition": {
      "StringEquals": {
        "sts:TaskPolicyArn": "arn:aws:iam::aws:policy/root-task/IAMAuditRootUserCredentials"
      }
    }
  }]
}

Important limit: this mechanism only covers member accounts. The management account root is a separate case, handled below.

Control 2: an SCP that blocks what remains

Even after cleanup, a legacy account or one not yet processed keeps an exploitable root. The “DenyRoot” SCP is the example documented by AWS: it denies every action to principals whose ARN is the root.

resource "aws_organizations_policy" "deny_root" {
  name    = "deny-root-user"
  type    = "SERVICE_CONTROL_POLICY"
  content = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Sid      = "DenyRootUser"
      Effect   = "Deny"
      Action   = "*"
      Resource = "*"
      Condition = {
        StringLike = { "aws:PrincipalArn" = ["arn:aws:iam::*:root"] }
      }
    }]
  })
}

resource "aws_organizations_policy_attachment" "deny_root_workloads" {
  policy_id = aws_organizations_policy.deny_root.id
  target_id = var.workloads_ou_id # ou la racine, après test
}

Two clarifications to avoid false comfort. First, SCPs do not apply to the management account: this SCP does not protect its root. Second, before attaching it at the organization root, test in a sandbox OU that your AssumeRoot sessions still work with the SCP in place, and attach it to a non-critical OU first. Never deploy it before validating the emergency procedure below.

Control 3: the management account and the emergency path

The management account root cannot be deleted. A reasonable minimum:

  • A dedicated email address on a distribution list held by at least two people, never a personal one.
  • Hardware MFA: two FIDO2 keys registered, stored in two separate physical locations. AWS allows up to eight MFA devices per user.
  • No root access key. Verifiable with aws iam get-account-summary (AccountAccessKeysPresent must be 0).

For day-to-day emergency access (SSO or IdP down), root is the wrong tool. Plan a break-glass IAM role or user in the management or security account, outside IAM Identity Center, with:

  • a minimal policy to restore access (manage Identity Center, assume an admin role in target accounts);
  • mandatory hardware MFA in the trust condition;
  • credentials stored offline (physical safe, or a secrets manager with two-person access).
data "aws_iam_policy_document" "breakglass_trust" {
  statement {
    actions = ["sts:AssumeRole"]
    principals {
      type        = "AWS"
      identifiers = [aws_iam_user.breakglass.arn]
    }
    condition {
      test     = "Bool"
      variable = "aws:MultiFactorAuthPresent"
      values   = ["true"]
    }
  }
}

resource "aws_iam_role" "breakglass_admin" {
  name                 = "BreakGlassAdmin"
  assume_role_policy   = data.aws_iam_policy_document.breakglass_trust.json
  max_session_duration = 3600
}

An emergency path that was never tested does not exist. Set a quarterly drill: one team member follows the runbook end to end, a second times it and checks the alert. Target: access restored in under 30 minutes, alert received in under 5.

Control 4: alert on any root use and any break-glass use

The CIS AWS Foundations controls require an alert on root usage. With an organization trail delivered to CloudWatch Logs in the log archive account:

resource "aws_cloudwatch_log_metric_filter" "root_usage" {
  name           = "RootUserUsage"
  log_group_name = var.org_trail_log_group
  pattern        = "{ $.userIdentity.type = \"Root\" && $.userIdentity.invokedBy NOT EXISTS && $.eventType != \"AwsServiceEvent\" }"

  metric_transformation {
    name      = "RootUserUsage"
    namespace = "Security"
    value     = "1"
  }
}

resource "aws_cloudwatch_metric_alarm" "root_usage" {
  alarm_name          = "root-user-usage"
  namespace           = "Security"
  metric_name         = "RootUserUsage"
  statistic           = "Sum"
  period              = 300
  evaluation_periods  = 1
  threshold           = 1
  comparison_operator = "GreaterThanOrEqualToThreshold"
  treat_missing_data  = "notBreaching"
  alarm_actions       = [var.security_sns_topic_arn]
}

resource "aws_cloudwatch_log_metric_filter" "breakglass_assume" {
  name           = "BreakGlassAssumed"
  log_group_name = var.org_trail_log_group
  pattern        = "{ $.eventName = \"AssumeRole\" && $.requestParameters.roleArn = \"*:role/BreakGlassAdmin\" }"

  metric_transformation {
    name      = "BreakGlassAssumed"
    namespace = "Security"
    value     = "1"
  }
}

Duplicate the alarm for BreakGlassAssumed. Add a filter on eventName = "AssumeRoot": every centralized root session must match a ticket or a planned drill. The alert recipient must be a channel watched outside business hours, not a shared mailbox.

The proof: what you show an auditor

RequirementEvidence
No root credentials on member accountsDated, archived IAMAuditRootUserCredentials output per account
Root unusabledeny-root-user SCP in Terraform, PR history, OU attachment
Management account root protectedget-account-summary: 0 access keys, MFA on; register of FIDO2 key holders
Working emergency accessQuarterly drill report: date, duration, participants, gaps
DetectionCloudWatch alarms in Terraform, plus a capture of a received test alert

These items map directly to ISO 27001 (privileged access management) and SOC 2 (logical access) requests, and feed customer questionnaires at no extra cost.

Common pitfalls

  • Deleting root before testing AssumeRoot. Use a pilot account, run the runbook, then roll out.
  • Forgetting the region. AssumeRoot only accepts regional STS endpoints; a procedure written with the global endpoint will fail at the worst time.
  • Break-glass depending on the IdP. If the emergency user is federated through the SSO that is down, it is not break-glass.
  • Alert with no owner. An alarm sent to a channel nobody reads is no alarm.

Summary

For an organization of 5 to 50 accounts, the whole thing fits in one working day: enable centralized root access, audit then delete member-account credentials, set the DenyRoot SCP, secure the management root with two FIDO2 keys, create an emergency path outside SSO, and wire three alarms. The most neglected part is the regular drill, which turns a document into a control. This baseline is part of our cloud security audit; to keep it healthy over time, see the security retainer.

Found this useful? Share it.

Go further

A topic, a project, a question?

Distribuée supports demanding SMBs on cloud security, CI/CD supply chain and AI security.

Book 15 min