Sub topic 11
Trusted access and delegated administrators
This chapter covers how AWS services work across every account in an organization, and how to keep day-to-day administration out of the management account. It assumes you can read IAM policy JSON, use the AWS CLI, and know what the management account, OUs and SCPs are from earlier chapters.
The problem: services that need to see the whole organization
Many AWS services are more useful when they can act on all accounts at once. CloudTrail can record events for every account. AWS Config can check every account against the same rules. IAM Identity Center can assign access across the fleet. To do this, a service must be allowed to read your organization's structure and to act inside member accounts.
AWS Organizations controls this with two separate mechanisms:
- Trusted access lets a specific AWS service work with Organizations and act in member accounts on behalf of the organization.
- Delegated administrator is a member account that you register so it can manage a service for the organization. This replaces the management account in that role.
You normally use both together. Trusted access enables the integration. Delegation chooses who runs it.
Trusted access
Trusted access is a per-service switch, set once for the whole organization. When you enable it, the service gets permission to call Organizations APIs such as ListAccounts and DescribeOrganization. It can also create a service-linked role in each member account. A service-linked role is an IAM role that only that service can assume, with permissions AWS defines for it.
The result is that you do not have to create roles and trust policies in every account by hand. The service creates what it needs.
You can enable trusted access in two ways:
- In the service's own console, which usually enables it for you when you turn on the organization-wide feature.
- With the CLI or API, which is better for automation.
Only the management account can enable or disable trusted access. Some services also require the organization to have all features enabled, not just consolidated billing. The first chapter's create-organization --feature-set ALL command already satisfies this.
The Terraform from the Organizations basics chapter set this up with aws_service_access_principals. Each entry is the service principal name of a service you trust. Here is the same idea in the CLI:
aws organizations enable-aws-service-access \
--service-principal cloudtrail.amazonaws.com
aws organizations list-aws-service-access-for-organizationThe second command lists every service that currently has trusted access. Review this list from time to time. Each entry is a service that can act inside all your accounts.
Delegated administrators
Without delegation, the management account is the only place to run organization-wide features. That is a problem. The management account is the most sensitive account you own. SCPs do not apply to it, and it holds billing and organization control. You want as few people and workloads there as possible.
A delegated administrator is a member account that Organizations registers for one service. That account can then use the service's organization-wide features, such as viewing findings from all accounts or managing rules for them. It does this without any access to the management account.
Delegation is per service. You can register one account for GuardDuty, another for AWS Config, and a third for IAM Identity Center. Most teams use dedicated accounts, such as a Security Tooling account and a Log Archive account, rather than spreading roles around.
Register a delegated administrator from the management account:
aws organizations register-delegated-administrator \
--account-id 111122223333 \
--service-principal guardduty.amazonaws.com
aws organizations list-delegated-administrators
aws organizations list-delegated-services-for-account \
--account-id 111122223333Some services have their own registration call. For example, GuardDuty and Security Hub have enable-organization-admin-account operations. Others use the Organizations call shown above. Check which one your service uses, because the wrong call can succeed without changing what you meant to change.
To remove delegation, use deregister-delegated-administrator. That call fails if the service still needs the account, so clean up the service's own configuration first.
What a delegated administrator can and cannot do
The delegated account gets the service's organization-wide management features. It does not get general control of the organization. It cannot create accounts, attach SCPs, or change the OU structure. Some services allow delegation only for a subset of features.
Three rules to remember:
- Only the management account can register or deregister delegated administrators.
- The management account itself cannot be a delegated administrator.
- Many services allow one delegated administrator. A few allow several. The limit is set by each service.
| Aspect | Trusted access | Delegated administrator |
|---|---|---|
| What it grants | A service may work across the organization | A member account may manage that service |
| Scope | Whole organization, per service | One account, per service |
| Who sets it | Management account | Management account |
| Required for delegation | Usually yes | Not applicable |
| Failure if missing | Organization features are unavailable | Management account is the only admin |
How the pieces fit together
Controlling the delegation with policy
Delegation is controlled by the management account, but you can also restrict who may change it. Two controls are common.
First, limit the principals in the management account that may call delegation APIs. Few people should be able to run register-delegated-administrator. Give that permission to a small break-glass or platform role.
Second, some services let you scope delegation with IAM policy. Organizations supports resource-based delegation policies. This lets a member account call certain Organizations read APIs, such as ListAccounts and ListPolicies, without being a full delegated administrator. Here is an example policy attached to the organization's delegation policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowReadFromPlatformAccount",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:root"
},
"Action": [
"organizations:DescribeOrganization",
"organizations:ListAccounts",
"organizations:ListOrganizationalUnitsForParent"
],
"Resource": "*"
}
]
}Apply it from the management account:
aws organizations put-resource-policy \
--content file://delegation-policy.jsonThis is useful for inventory tools and automation that only need to read the organization, since they do not need the full delegation for a service.
Common errors
ConstraintViolationExceptionwhen registering. The service lacks trusted access, or the account does not meet a service rule. Enable trusted access first.AccountNotRegisteredException. You tried to deregister an account that is not a delegated administrator for that service. Runlist-delegated-administratorsto check the actual state.AWSOrganizationsNotInUseException. The account is not in an organization, or you ran the call in the wrong account.- Service shows no member accounts. Trusted access is on, but the service has not yet been enabled for the organization. Most services need a separate step in the delegated account.
- Registering the management account. This is blocked. Create a dedicated member account instead.
- Region confusion. Organizations is global, but the services you delegate are often regional. Enable and verify the service in each Region you use.
Design guidance
- Create the dedicated accounts first, before you delegate. Common choices are Security Tooling, Log Archive and a shared Network or Platform account.
- Enable trusted access only for services you will use. Each one widens what can act across your accounts.
- Delegate each service to the account that matches its purpose. Security services go to the security account. Network tooling goes to the network account.
- Record delegations in infrastructure as code where the provider supports it, so changes are reviewed.
- Audit the lists of trusted services and delegated administrators regularly.
Exercise
Your team wants to run GuardDuty for all accounts from a member account called security-tooling, and keep the management account free of day-to-day security work. Which two things must the management account do, and which account must perform them? Name one thing the delegated account still cannot do.
Show answer
The management account must enable trusted access for GuardDuty (guardduty.amazonaws.com) and then register security-tooling as the delegated administrator, using either the Organizations call or GuardDuty's own enable-organization-admin-account operation. Only the management account can do both. The delegated account still cannot create accounts, attach SCPs, or change the OU structure.
Exercise
A colleague runs deregister-delegated-administrator for an account and it fails. What is the most likely cause, and what should be done first?
Show answer
The service still depends on that account as its administrator. First clean up or move the service's own organization configuration, such as removing member accounts or disabling the organization setup in the service. Then run list-delegated-services-for-account to confirm which services remain, and retry the deregistration.