Governance and loggingService 01 of 1310 controls
AWS Organizations security hardening
Lock down the root user, centralize root access, and enforce SCP, RCP and declarative policy guardrails with a baseline for every account.
On this page
- Baseline controls
- Root user of the management account
- Centralized root access for member accounts
- OU layout
- How SCPs and RCPs are evaluated
- Service control policies
- Resource control policies
- Declarative policies for EC2
- Roll out guardrails safely
- Account baseline
- Logging and detection
- Common mistakes
- References
AWS Organizations is the control plane above all your accounts: it owns the root user of the management account, the account structure, and the organization policies (SCPs, RCPs and declarative policies) that cap what anyone inside a member account can do. At defaults, a new account has a root user with a password and no hardware MFA, no guardrails beyond FullAWSAccess, every default Region open, and nothing that stops an administrator, or an attacker holding administrator credentials, from stopping CloudTrail, disabling GuardDuty or leaving the organization. The real incident patterns are familiar: phished root passwords, leaked long-lived keys used to spin up cryptomining fleets in Regions nobody watches, and logging switched off before data is taken. This page covers the root user, centralized root access, the guardrail policies and the account baseline that should exist before any workload lands.
Baseline controls
- 0101Phishing-resistant MFA on the management root user
Root cannot be restricted by IAM, so a phished root password is full account takeover.
How to check:aws iam get-account-summary --query SummaryMap.AccountMFAEnabledMapping: IAM.9, IAM.6, CIS 2.5, CIS 2.6 - 0202No root access keys
A root key is a long-lived credential with unlimited power and no way to scope it.
How to check:aws iam get-account-summary --query SummaryMap.AccountAccessKeysPresentMapping: IAM.4, CIS 2.4 - 0303Security alternate contact set on every account
AWS sends abuse reports and security notices there; a missing contact means missed warnings.
How to check:aws account get-alternate-contact --alternate-contact-type SECURITYMapping: Account.1, CIS 2.3 - 0404Member account root credentials removed centrally
Without credentials, a member root user cannot be phished or recovered by an attacker.
How to check:aws iam list-organizations-featuresMapping: CIS 2.1.1 - 0505SCP protects logging and detection services
Stops an attacker with admin in a member account from blinding CloudTrail or GuardDuty.
How to check:aws organizations list-policies-for-target --target-id r-examplerootid111 --filter SERVICE_CONTROL_POLICYMapping: CIS 2.1.2 - 0606SCP denies the root user in member accounts
Defense in depth if a member root user is ever recovered through the email reset flow.
How to check:Console: AWS Organizations > Policies > Service control policiesMapping: CIS 2.1.2 - 0707Regions restricted to the ones you use
Attackers launch resources in Regions nobody watches; a Region deny closes that gap.
How to check:aws account list-regions --region-opt-status-contains ENABLEDMapping: CIS 2.1.2 - 0808RCP enforces an identity perimeter and TLS
Blocks principals outside your organization from your data, even if a resource policy allows them.
How to check:aws organizations list-policies-for-target --target-id r-examplerootid111 --filter RESOURCE_CONTROL_POLICYMapping: CIS 2.1.2 - 0909EC2 declarative policy sets the account baseline
Keeps IMDSv2, snapshot and AMI public sharing blocks in place even for new accounts and APIs.
How to check:aws organizations list-policies --filter DECLARATIVE_POLICY_EC2 - 1010IAM password policy of 14 characters with reuse prevention
Any IAM user that still exists needs a password that resists guessing and reuse.
How to check:aws iam get-account-password-policyMapping: IAM.15, IAM.16, CIS 2.8, CIS 2.9
Root user of the management account
The root user is the one identity in an account that no IAM policy can restrict. AWS keeps a short list of tasks that require root; the ones you will meet are changing the account name, email or password, closing the account, changing the support plan, restoring IAM permissions after the only administrator is locked out, and deleting an S3 bucket policy or SQS queue policy that denies every principal. Everything else belongs to IAM roles, ideally assumed through IAM Identity Center. The goal is a root user that is protected, monitored and almost never used.
Enable phishing-resistant MFA
CIS AWS Foundations Benchmark v7.1.0 recommendation 2.5 requires root MFA and 2.6 asks for hardware MFA. Security Hub CSPM checks them as IAM.9 and IAM.6. AWS now enforces MFA for root users, but enforcement does not choose the kind of MFA. Prefer a FIDO2 security key or passkey: FIDO credentials are bound to the sign-in origin, so a fake login page cannot relay them, while a TOTP code typed into a phishing page works for the attacker as well as for you.
You can register up to eight MFA devices on root. Register at least two security keys and store them in separate physical locations, so losing one does not start the slow account recovery process. Console: sign in as root, open Security credentials, choose Assign MFA device, then Passkey or security key.
Confirm from an administrator role:
aws iam get-account-summary \
--query 'SummaryMap.{RootMFA:AccountMFAEnabled,RootKeys:AccountAccessKeysPresent}'
You want RootMFA to be 1 and RootKeys to be 0.
Delete root access keys
Root keys cannot be scoped down. CIS 2.4 says they must not exist, and Security Hub CSPM reports them as IAM.4. If AccountAccessKeysPresent returned 1, find what uses the key before deleting it: check its Last used value on the Security credentials page, search CloudTrail for the key ID to get the source IP and user agent, move the workload to an IAM role, then deactivate the key, wait a few days, and delete it. Stolen cloud credentials are MITRE ATT&CK T1078.004; a root key is the worst version of that.
Protect the root mailbox and alternate contacts
The root email address is the password reset channel. If an attacker controls the inbox, account recovery can fall back to email and phone verification, so MFA alone will not save you. Use a company-owned distribution list delivered to two or three security owners, protect that mailbox with phishing-resistant MFA, keep the root phone number current and company-owned, and store the root password in a vault with access logging.
AWS sends security notices and abuse reports to alternate contacts. CIS 2.3 asks for a security contact, checked as Account.1. Set all three types:
for TYPE in SECURITY OPERATIONS BILLING; do
aws account put-alternate-contact \
--alternate-contact-type "$TYPE" \
--name "Cloud Security" --title "$TYPE contact" \
--email-address aws-$(echo "$TYPE" | tr 'A-Z' 'a-z')@yourcompany.tld \
--phone-number "+33100000000"
done
From the management account, add --account-id 111122223333 to set contacts on any member account once trusted access for AWS Account Management is enabled, and loop over aws organizations list-accounts instead of signing in to each account.
Centralized root access for member accounts
Every member account still has its own root user. Centralized root access management lets the management account, or a delegated administrator for IAM, delete root credentials from member accounts and perform the few root-only tasks through short, scoped sessions. Enable it once from the management account:
aws organizations enable-aws-service-access \
--service-principal iam.amazonaws.com
aws iam enable-organizations-root-credentials-management
aws iam enable-organizations-root-sessions
# Optional: delegate to the security tooling account
aws organizations register-delegated-administrator \
--service-principal iam.amazonaws.com \
--account-id 444455556666
New accounts then have no root credentials at all. For existing accounts, start a privileged session scoped by an AWS managed task policy:
aws sts assume-root \
--region eu-west-1 \
--target-principal 111122223333 \
--task-policy-arn arn=arn:aws:iam::aws:policy/root-task/IAMDeleteRootUserCredentials \
--duration-seconds 900
AssumeRoot only works on Regional STS endpoints, so always pass a Region. With the returned credentials, call aws iam delete-login-profile, aws iam list-access-keys, aws iam delete-access-key and aws iam deactivate-mfa-device without a user name, which targets the member root user. The available task policies are IAMAuditRootUserCredentials, IAMCreateRootUserPassword, IAMDeleteRootUserCredentials, S3UnlockBucketPolicy and SQSUnlockQueuePolicy.
Restrict who can call sts:AssumeRoot with an IAM policy, and use the sts:TaskPolicyArn condition key to allow only specific task policies. The management account root user is not covered by this feature and still needs everything in the previous section.
OU layout
Guardrails are easier to reason about with a simple OU tree, close to the AWS Security Reference Architecture:
- Root: the few policies that apply everywhere (deny leaving the organization, protect security tooling).
- Security OU: the log archive account and the security tooling account, which is delegated administrator for CloudTrail, GuardDuty, Security Hub CSPM, Config and IAM.
- Workloads OU with Prod and NonProd children: Region restrictions and the data perimeter.
- Sandbox OU: looser rules, strict budget.
- Suspended OU: deny everything, for accounts being closed.
Keep the management account empty of workloads. SCPs and RCPs do not apply to it, so anything running there is outside every guardrail on this page.
How SCPs and RCPs are evaluated
Service control policies (SCPs) limit what principals in your accounts can do. Resource control policies (RCPs) limit what anyone, including external principals, can do to resources in your accounts. Neither grants permissions: a request succeeds only if an identity or resource policy allows it and no SCP or RCP blocks it.
- Neither applies to the management account or to service-linked roles.
- SCPs apply to IAM users and roles in member accounts, including the member root user.
- A policy attached to the root applies to every OU and account below. An action must be allowed by an SCP at every level from the root to the account, and one explicit
Denyanywhere wins. - Enabling SCPs attaches
FullAWSAccesseverywhere; enabling RCPs attachesRCPFullAWSAccess, which you cannot detach. Keep both and write guardrails as deny lists on top.
| SCP | RCP | |
|---|---|---|
| Max document size | 10,240 characters | 5,120 characters |
| Max attached per root, OU or account | 10 | 5 (including RCPFullAWSAccess) |
Custom Allow statements | Yes | No, Deny only |
Principal element | Not used | Must be "*" |
NotAction | Supported | Not supported |
Whitespace counts against the size limit, so minify documents with jq -c before calling create-policy.
Service control policies
Protect logging and detection services
This SCP makes sure the logging and detection you set up cannot be switched off from inside a member account. It denies leaving the organization and tampering with CloudTrail, GuardDuty, AWS Config and Security Hub CSPM and IAM Access Analyzer, with a break-glass exemption.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyLeaveOrganization",
"Effect": "Deny",
"Action": "organizations:LeaveOrganization",
"Resource": "*"
},
{
"Sid": "ProtectSecurityServices",
"Effect": "Deny",
"Action": [
"cloudtrail:StopLogging",
"cloudtrail:DeleteTrail",
"cloudtrail:UpdateTrail",
"cloudtrail:PutEventSelectors",
"guardduty:DeleteDetector",
"guardduty:DisassociateFromMasterAccount",
"guardduty:DisassociateFromAdministratorAccount",
"guardduty:UpdateDetector",
"guardduty:CreateFilter",
"guardduty:DeletePublishingDestination",
"config:DeleteConfigurationRecorder",
"config:DeleteDeliveryChannel",
"config:StopConfigurationRecorder",
"securityhub:DisableSecurityHub",
"securityhub:DisassociateFromAdministratorAccount",
"securityhub:DeleteMembers",
"access-analyzer:DeleteAnalyzer"
],
"Resource": "*",
"Condition": {
"ArnNotLike": {
"aws:PrincipalArn": [
"arn:aws:iam::*:role/BreakGlassAdmin",
"arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*AWSReservedSSO_PlatformAdmin_*"
]
}
}
}
]
}
Member accounts already cannot modify an organization trail, so the CloudTrail statements matter for any account-level trails you keep. Stopping a trail is ATT&CK T1562.008. Blocking guardduty:CreateFilter closes a quieter variant: an auto-archive filter that hides an attacker's findings.
Deny the root user in member accounts
After you centralize root access, member root users have no credentials. This SCP makes sure that a recovered one still cannot act:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyRootUser",
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"StringLike": { "aws:PrincipalArn": "arn:aws:iam::*:root" }
}
}
]
}
Privileged sessions from sts:AssumeRoot exist for the few root-only tasks. Test them (unlocking a bucket policy, for example) with this SCP attached, and exempt the relevant OU while you perform them if needed.
Restrict Regions
Global services are served from us-east-1 and must be exempted, which is why this policy uses NotAction:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": [
"a4b:*", "account:*", "acm:*",
"aws-marketplace:*", "aws-portal:*", "budgets:*", "ce:*",
"chime:*", "cloudfront:*", "config:*", "cur:*",
"directconnect:*", "ec2:DescribeRegions",
"ec2:DescribeTransitGateways", "ec2:DescribeVpnGateways",
"fms:*", "globalaccelerator:*", "health:*", "iam:*",
"importexport:*", "kms:*", "networkmanager:*",
"organizations:*", "pricing:*", "route53:*",
"route53domains:*", "s3:GetAccountPublic*",
"s3:ListAllMyBuckets", "s3:PutAccountPublic*",
"shield:*", "sso:*", "sts:*", "support:*",
"trustedadvisor:*", "waf:*", "waf-regional:*",
"wafv2:*", "wellarchitected:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["eu-west-1", "eu-central-1"]
},
"ArnNotLike": {
"aws:PrincipalArn": "arn:aws:iam::*:role/BreakGlassAdmin"
}
}
}
]
}
Start from the current version of the AWS published example, because the global service list changes, then remove services you do not use. After rollout, look for AccessDenied events with an unexpected Region in CloudTrail; they usually point to a missing global action. Opt-in Regions (launched after March 2019) stay disabled until enabled, so leave unused ones off; default Regions cannot be disabled, which is why the SCP exists.
Prevent long-lived IAM credentials
If humans sign in through IAM Identity Center, IAM users and access keys should be exceptional. Deny their creation outside an approved automation role:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyIamUsersAndKeys",
"Effect": "Deny",
"Action": ["iam:CreateUser", "iam:CreateAccessKey", "iam:CreateLoginProfile"],
"Resource": "*",
"Condition": {
"ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/IdentityAutomation" }
}
}
]
}
Inventory and rotation of the keys that already exist are covered on the IAM page.
Resource control policies
Enable the policy type first:
aws organizations enable-policy-type \
--root-id r-examplerootid111 --policy-type RESOURCE_CONTROL_POLICY
Enforce TLS on data services
The simplest useful RCP denies any request that does not use TLS, and replaces the aws:SecureTransport statement you would otherwise copy into every bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceSecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": ["s3:*", "sqs:*", "kms:*", "secretsmanager:*", "sts:*"],
"Resource": "*",
"Condition": { "BoolIfExists": { "aws:SecureTransport": "false" } }
}
]
}
Identity perimeter for your resources
A data perimeter ensures that only trusted identities reach your resources. This RCP, which follows the AWS data perimeter examples, denies principals outside your organization while allowing AWS services acting on your behalf:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceOrgIdentities",
"Effect": "Deny",
"Principal": "*",
"Action": [
"s3:*", "sqs:*", "kms:*", "secretsmanager:*",
"sts:AssumeRole", "sts:DecodeAuthorizationMessage",
"sts:GetAccessKeyInfo", "sts:GetFederationToken",
"sts:GetServiceBearerToken", "sts:GetSessionToken",
"sts:SetContext"
],
"Resource": "*",
"Condition": {
"StringNotEqualsIfExists": {
"aws:PrincipalOrgID": "o-exampleorgid",
"aws:ResourceTag/dp:exclude:identity": "true"
},
"BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
}
}
]
}
sts:AssumeRoleWithWebIdentityandsts:AssumeRoleWithSAMLare left out because federated identities carry no organization ID. Protect those trust policies directly.- The
dp:exclude:identitytag opts a resource out (a bucket shared with a vendor). Protect the tag with an SCP so only the security team can set it. - Services writing with their own service principal, such as CloudTrail delivering to a log bucket, pass through
aws:PrincipalIsAWSService. - RCPs apply to customer managed KMS keys, not AWS managed keys.
Declarative policies for EC2
SCPs and RCPs regulate API calls. Declarative policies instead set a service configuration in its control plane, so the setting holds when the service adds new APIs, when new accounts join, and even for service-linked roles. Account administrators cannot change an attribute the policy sets. EC2 policies are the declarative type that matters most for a baseline: they cover VPC Block Public Access, serial console access, AMI block public access, Allowed AMIs, instance metadata defaults, EBS snapshot block public access and VPC encryption controls.
{
"ec2_attributes": {
"exception_message": {
"@@assign": "Blocked by organization baseline. See the platform wiki."
},
"instance_metadata_defaults": {
"http_tokens": { "@@assign": "required" },
"http_put_response_hop_limit": { "@@assign": "2" }
},
"snapshot_block_public_access": {
"state": { "@@assign": "block_all_sharing" }
},
"image_block_public_access": {
"state": { "@@assign": "block_new_sharing" }
},
"serial_console_access": {
"status": { "@@assign": "disabled" }
}
}
}
Enable the policy type and trusted access for EC2 (two separate calls in the CLI), run the account status report to see where accounts currently diverge, then attach to a test OU:
aws organizations enable-policy-type \
--root-id r-examplerootid111 --policy-type DECLARATIVE_POLICY_EC2
aws organizations enable-aws-service-access \
--service-principal ec2.amazonaws.com
Before setting http_tokens to required, confirm nothing still calls IMDSv1 (the EC2 page shows how). Detaching the policy rolls each attribute back to its previous state. Other declarative types exist (for example S3, GuardDuty and Security Hub CSPM policies); treat them case by case on the matching service page.
Roll out guardrails safely
Guardrails that block the wrong thing cause outages. Validate, attach to a test OU, then widen one level at a time:
aws accessanalyzer validate-policy \
--policy-type SERVICE_CONTROL_POLICY \
--policy-document file://protect-security.json
POLICY_ID=$(aws organizations create-policy \
--name ProtectSecurityServices \
--type SERVICE_CONTROL_POLICY \
--description "Deny disabling logging and detection" \
--content "$(jq -c . protect-security.json)" \
--query 'Policy.PolicySummary.Id' --output text)
aws organizations attach-policy \
--policy-id "$POLICY_ID" --target-id ou-exam-11111111
Run normal deployments and integration tests in that OU and query CloudTrail for denials; the error message names the policy type, for example "with an explicit deny in a service control policy". Before tightening a Region or service list, use IAM service last accessed data for organizations to see which services each OU uses. Keep policies in version control and deploy them through a pipeline.
To verify, list what applies to an account, then repeat for each parent OU and the root, because inherited policies are not returned for the account itself:
aws organizations list-policies-for-target \
--target-id 111122223333 --filter SERVICE_CONTROL_POLICY
aws organizations list-policies-for-target \
--target-id 111122223333 --filter RESOURCE_CONTROL_POLICY
Account baseline
Apply these in every account, ideally from your account vending pipeline.
IAM password policy
Even with Identity Center, remaining IAM users need a strong policy. CIS 2.8 (IAM.15) checks a minimum length of 14 and CIS 2.9 (IAM.16) reuse prevention:
aws iam update-account-password-policy \
--minimum-password-length 14 \
--password-reuse-prevention 24 \
--require-uppercase-characters --require-lowercase-characters \
--require-numbers --require-symbols \
--allow-users-to-change-password
NIST SP 800-63B favors length and breach screening over forced rotation, so skip --max-password-age unless a regulation demands it.
Billing alarms
A spend spike is often the first visible sign of a stolen key mining cryptocurrency. Create an AWS Budgets alert on actual and forecasted cost for every account, sent to the security mailbox.
Default encryption and public access blocks
Turn on EBS encryption by default in every Region you use, and block S3 public access at the account level:
aws ec2 enable-ebs-encryption-by-default --region eu-west-1
aws s3control put-public-access-block \
--account-id 111122223333 \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
The S3 page and EC2 page cover the details.
Logging and detection
Organizations API calls are management events recorded by the organization trail in the management account. Root activity should be rare enough that every event gets a human look. An EventBridge rule catches it:
{
"detail-type": ["AWS Console Sign In via CloudTrail", "AWS API Call via CloudTrail"],
"detail": {
"userIdentity": { "type": ["Root"] }
}
}
Root console sign-ins are recorded in us-east-1, us-east-2 or us-west-2, so deploy the rule in all three Regions as well as in your home Region.
Also alert on these event names from organizations.amazonaws.com: DetachPolicy, DeletePolicy, UpdatePolicy, DisablePolicyType, LeaveOrganization, RemoveAccountFromOrganization and DeregisterDelegatedAdministrator, plus AssumeRoot from sts.amazonaws.com. GuardDuty raises Policy:IAMUser/RootCredentialUsage for root use. In Security Hub CSPM, watch IAM.4, IAM.6, IAM.9, IAM.15, IAM.16 and Account.1, or run the CIS checks on demand with Prowler.
Common mistakes
- Running workloads in the management account. SCPs and RCPs do not apply there, so every guardrail is bypassed by design.
- Only TOTP on root. A code typed into a phishing page is as good as yours; use FIDO security keys and register two.
- A personal email as the root address. When that person leaves, the reset channel leaves with them, or stays with them.
- Forgetting member account root users. Without centralized root access, each one is a password reset away from takeover.
- Attaching a new SCP to the root first. A missing global action in a Region deny can break IAM, billing or support across every account at once.
- Allow-list SCPs without inheritance planning. An action must be allowed at every level; one OU missing an allow silently denies it below.
- Putting federated STS actions in the perimeter. Adding
sts:AssumeRoleWithWebIdentityto an identity perimeter RCP breaks CI/CD that federates from GitHub or Kubernetes. - Enforcing IMDSv2 by declarative policy without an audit. Instances that still call IMDSv1 fail to get credentials; check usage first.
References
- AWS account root user (IAM User Guide)
- Centralize root access for member accounts
- Perform a privileged task on a member account
- Service control policies (SCPs)
- Resource control policies (RCPs)
- Declarative policies in AWS Organizations
- EC2 policy syntax and examples
- Security Hub CSPM controls for IAM
- aws-samples/service-control-policy-examples
- aws-samples/data-perimeter-policy-examples
- CIS Amazon Web Services Benchmarks
- MITRE ATT&CK T1562.008: Disable or Modify Cloud Logs
- NIST SP 800-63B Digital Identity Guidelines
- Prowler documentation
Written by
Florian AmetteSecurity engineer writing practical, benchmark-aligned hardening baselines for AWS services, from the organization and identities to data, networks and workloads.