Sub topic 7
Multi-Region trails and organization trails
A single-Region trail in a single account leaves gaps. An attacker can work in a Region you never look at, and a compromised member account can carry on unseen. This chapter covers the two trail settings that close those gaps: the multi-Region trail and the organization trail.
It assumes you know the following:
- IAM users, roles, and policies.
- S3 bucket policies.
- How to create a trail with the AWS CLI, as in the earlier chapters on trails and S3 delivery.
- The basics of AWS Organizations: a management account, member accounts, and organizational units (OUs).
Why Region scope matters
A trail is created in one Region, called its home Region. By default a trail records only the events that happen in that Region. AWS APIs are regional. If someone calls RunInstances in ap-southeast-2 and your trail lives in us-east-1, the call never reaches your trail.
Attackers rely on this. Cryptomining abuse, for example, often starts instances in Regions the victim never uses. If your audit trail covers only your usual Region, you can't see that activity.
Multi-Region trails
A multi-Region trail records events from every Region in the AWS partition and delivers them to one S3 bucket (and, optionally, one CloudWatch Logs log group). Nothing about the events changes. Each record still has its own awsRegion field, so you can tell where it happened.
Creating and converting
The console creates multi-Region trails by default. The CLI does not, so you must ask for it:
aws cloudtrail create-trail \
--name org-audit-trail \
--s3-bucket-name my-cloudtrail-logs-bucket \
--is-multi-region-trail \
--enable-log-file-validationYou can convert an existing single-Region trail in place. Run the command from the trail's home Region:
aws cloudtrail update-trail \
--name org-audit-trail \
--is-multi-region-trailTo check what you have, list the trails and pick out the fields that describe scope:
aws cloudtrail describe-trails \
--query 'trailList[].{Name:Name,Home:HomeRegion,MultiRegion:IsMultiRegionTrail,Org:IsOrganizationTrail,GlobalEvents:IncludeGlobalServiceEvents}' \
--output tableHow it works internally
When a trail is multi-Region, CloudTrail makes a copy of the trail's configuration in each Region. These copies are called replicated trails or shadow trails. In another Region you can see a replicated trail, but you can only change or delete it from the home Region. By default describe-trails includes shadow trails. Pass --no-include-shadow-trails to list only the trails owned by the Region you query.
Events are written by the Region where they occur. All of them are delivered to the one bucket, and the Region appears in the object key (see the S3 layout chapter).
Behavior to know
- New Regions are covered automatically. When AWS launches a Region, or you enable an opt-in Region, an existing multi-Region trail starts recording there. A single-Region trail never does.
- Global service events. Services such as IAM, and some STS and CloudFront calls, are not tied to one Region. They are recorded as
us-east-1events (IAM is the usual example). A multi-Region trail withIncludeGlobalServiceEventsset to true captures them once. - Limits. You can create up to five trails per Region, and a multi-Region trail counts toward the limit in every Region. Plan for this before you create several trails.
- Cost. The first copy of management events in each Region is delivered at no charge. Extra trails that record the same management events are billed. Data events are always billed.
Organization trails
A multi-Region trail covers all Regions of one account. An organization trail covers all accounts of an AWS Organization. It is a single trail that records events from the management account and every member account, and it can be multi-Region at the same time.
What it does for you
- Coverage is automatic. When an account joins the organization, its events begin flowing to the trail. You don't configure anything in that account.
- Members can't turn it off. A member account sees the organization trail in its trail list, but it can only read it. It cannot stop, change, or delete it. An account admin who is compromised therefore can't run
StopLoggingon it. - Logs are centralized. All accounts write to the same bucket, so one investigation can span accounts.
Member accounts can still create their own trails and use their own Event history. The organization trail adds a copy; it does not replace those.
Prerequisites
- The organization has all features enabled, not only consolidated billing.
- You work from the management account, or from a delegated administrator account registered for CloudTrail.
- Trusted access for CloudTrail is enabled in AWS Organizations. The console turns this on for you. From the CLI you do it yourself:
aws organizations enable-aws-service-access \
--service-principal cloudtrail.amazonaws.comTo avoid using the management account for daily work, register a delegated administrator. Run this from the management account:
aws cloudtrail register-organization-delegated-admin \
--member-account-id 222222222222Creating the trail
aws cloudtrail create-trail \
--name org-audit-trail \
--s3-bucket-name my-org-trail-bucket \
--is-organization-trail \
--is-multi-region-trail \
--enable-log-file-validation
aws cloudtrail start-logging --name org-audit-trailYou can also convert an existing trail of the management account with update-trail --is-organization-trail.
The bucket policy needs more than one path
An organization trail writes under two prefixes: one for the owner account and one for the organization ID. If the bucket policy allows only the account prefix, delivery for member accounts fails. This policy covers both. It assumes the management account is 111111111111 and the organization ID is o-exampleorgid:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AWSCloudTrailAclCheck",
"Effect": "Allow",
"Principal": { "Service": "cloudtrail.amazonaws.com" },
"Action": "s3:GetBucketAcl",
"Resource": "arn:aws:s3:::my-org-trail-bucket",
"Condition": {
"StringEquals": {
"aws:SourceArn": "arn:aws:cloudtrail:us-east-1:111111111111:trail/org-audit-trail"
}
}
},
{
"Sid": "AWSCloudTrailWriteOwnAccount",
"Effect": "Allow",
"Principal": { "Service": "cloudtrail.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-org-trail-bucket/AWSLogs/111111111111/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control",
"aws:SourceArn": "arn:aws:cloudtrail:us-east-1:111111111111:trail/org-audit-trail"
}
}
},
{
"Sid": "AWSCloudTrailWriteOrganization",
"Effect": "Allow",
"Principal": { "Service": "cloudtrail.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-org-trail-bucket/AWSLogs/o-exampleorgid/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control",
"aws:SourceArn": "arn:aws:cloudtrail:us-east-1:111111111111:trail/org-audit-trail"
}
}
}
]
}The aws:SourceArn condition limits the service principal to your trail. Without it, another AWS customer's trail could be pointed at your bucket (the confused deputy problem).
In the bucket, member-account logs follow the pattern AWSLogs/o-exampleorgid/<account-id>/CloudTrail/<region>/<yyyy>/<mm>/<dd>/.
Choosing a trail scope
| Scope | Records | Typical use | Main risk |
|---|---|---|---|
| Single-Region trail | One Region of one account | Narrow, temporary needs | Blind to every other Region |
| Multi-Region trail | All Regions of one account | Standard for any account | Duplicate trails raise cost |
| Organization trail | All Regions (if multi-Region) of all accounts | Multi-account audit | Bucket policy and trusted access mistakes |
For almost every account, a multi-Region trail is the right default. In an organization, use an organization trail that is also multi-Region.
Failure modes and gotchas
- Missing delivery for members. The usual cause is a bucket policy without the
AWSLogs/o-<org-id>/*path. Checkaws cloudtrail get-trail-status --name org-audit-trailand look atLatestDeliveryError. - Where to store logs. The management account is a poor home for a log bucket, because few people should have access to it. Put the bucket in a dedicated log archive account. The bucket policy then names the management account's trail ARN in its conditions.
- Leaving the organization. An account that leaves is no longer covered. Apply a service control policy (SCP) that blocks
cloudtrail:StopLogging,cloudtrail:DeleteTrail, andorganizations:LeaveOrganizationfor member accounts, and review who can use the management account. - Event selectors are shared. The selectors of an organization trail apply to every account. You can't enable S3 data events for one account only, except by narrowing with fields such as
resources.ARN. Broad data-event selectors across an organization can be costly. - Opt-in Regions. Coverage of an opt-in Region begins only after that Region is enabled in the account. Events from before then do not exist.
- Home Region dependence. To edit a multi-Region trail you must call the API in its home Region. If you point tooling at the wrong Region, the change fails or targets the replicated copy.
Exercise
A security engineer runs aws cloudtrail create-trail --name audit --s3-bucket-name logs-bucket in us-east-1 and starts logging. Later, an unexpected RunInstances call is made in eu-central-1. Will the trail contain it? What one change fixes this, and what must be true of the bucket policy if the trail should also cover member accounts?
Show answer
No. The CLI creates a single-Region trail unless --is-multi-region-trail is given, so only us-east-1 events are recorded. Fix it with aws cloudtrail update-trail --name audit --is-multi-region-trail, run in the home Region. To also cover member accounts, the trail must be an organization trail (--is-organization-trail, created from the management or delegated administrator account with trusted access enabled), and the bucket policy must allow s3:PutObject for cloudtrail.amazonaws.com on AWSLogs/o-<org-id>/* as well as the owner account prefix.
Exercise
Your organization already has a multi-Region trail in each of 12 member accounts. You now add an organization trail that is also multi-Region. What happens to cost and to query results, and what do you do about it?
Show answer
Each management event is now recorded by two trails: the account's own trail and the organization trail. The second copy is billed, and queries over both buckets return duplicate events. Keep the organization trail as the central record, then delete or convert the per-account trails that only recorded management events. Keep an account-level trail only if it has a separate purpose, such as data events for that account.