Last verified: 2026-11
Lab 1 answered who can act. Lab 2 built the place evidence lives. Lab 3 drew the boundary and wrote its own flow logs. Lab 4 is the first lab whose main output is the evidence.
The thesis is the AU family end to end. Collection is the trail. Protection is the CMK, Object Lock, and signed digests. Review is Athena. Alerting is EventBridge and metric-filter alarms.
I built it in the same brownfield study account as the first three labs, in us-east-1. This time I built it from CloudShell, not the console.
Why the CLI this time
Labs 1 to 3 were console-first. I built Lab 4 entirely from the CLI. I didn’t plan the switch. The pre-flight was CLI, and the build stayed there.
It turned out to be the better pattern. Engineers change infrastructure through the CLI and Terraform, and use the console to read. Each command here maps to about one Terraform resource, so the build was a dry run of the module. The CLI also does nothing for you silently. The console creates the CloudWatch Logs role, adds the EventBridge statement to the topic policy, and starts logging on a new trail. From the CLI I had to do all three by hand, and each one is in this post.
The cost is fewer screenshots. The evidence is text, which is what an assessor asks for anyway. From Lab 5 on, the build is CLI and the console is a read-only walkthrough.
Brownfield pre-flight
Lab 3 ended on an open decision. Lab 4’s CloudTrail would collide with the trail the Cantrill course left in this account, so separating the account came first.
The pre-flight removed the collision.
{
"trailList": []
}
describe-trails in us-east-1 also lists shadows of multi-region trails, so an empty list means no trail homed here and no multi-region trail anywhere. It would not show a single-Region trail homed in another Region. I didn’t check the other 16. Animals4lifeORG was in the June inventory. It’s gone now, and nothing I kept says when or by whom. The organization has one account, ACTIVE. The course’s member accounts are gone too.
So as far as us-east-1 shows, the account had been running on Event History alone. That’s 90 days of management events, no integrity validation, no retention past 90 days. Lab 4 doesn’t replace a trail. It closes an AU-12 gap nobody had noticed.
The pre-flight turned up one more thing.
[
{
"name": "acme-health-intake-root-usage-cb45156c",
"namespace": "CGEP/Security",
"metric": "RootAccountUsage",
"state": "OK",
"missingData": "notBreaching",
"updated": "2026-08-10T01:01:59.064000+00:00"
},
{
"name": "acme-health-intake-unauthorized-api-cb45156c",
"namespace": "CGEP/Security",
"metric": "UnauthorizedAPICalls",
"state": "OK",
"missingData": "notBreaching",
"updated": "2026-08-13T21:55:56.926000+00:00"
}
]
A root-usage alarm and an unauthorized-API alarm, both green. No trail fed them. No log group existed. Their SNS topic was deleted. They had reported OK for three months.
I traced them to my CGE-P capstone’s detection layer. Its teardown left these two behind, and its state bucket is gone, so no Terraform state tracked them. Hand deletion was the only way they would ever leave. I deleted both. The new trail recorded the DeleteAlarms call. That’s the CM-8 evidence.
An OK alarm says the threshold was not crossed. It does not say anything was watching. I come back to this below, because my own alarms have the same weakness.
| Finding | Control | After |
|---|---|---|
No trail in us-east-1 and no multi-region trail. Event History only | AU-12, AU-11 | grc-lab4-trail, multi-region, validation on |
| One account in the org, no members | CM-8 | Single-account trail, not an org trail |
Two orphaned alarms at OK with no source and no topic | SI-4, CM-8 | Inspected, saved, deleted |
| No log groups, topics, or rules left from the course | CM-8 | Nothing to delete |
The account-separation call
Three options. Keep a second trail beside the old one. Build in this account. Or stand up a dedicated log-archive account that owns the bucket and the key.
The first option disappeared with the old trail. I chose the second.
The third is the production answer. AU-9(2) wants audit records on a separate system, out of reach of the admins whose actions they record. In this lab the logs sit in the management account, next to an admin who can bypass GOVERNANCE retention. AU-9(2) is not met, and the control table says so.
Policies before the trail
The trail name shows up in three places: the trail, the key policy’s aws:SourceArn, and the bucket policy’s aws:SourceArn. If they disagree, CloudTrail accepts the configuration and delivers nothing. I fixed the name as grc-lab4-trail before writing any policy.
The key policy on alias/s3-compliant got four statements. The account-root kms:* statement does not cover a service principal.
| Sid | Principal | Why |
|---|---|---|
AllowCloudTrailEncryptLogs | cloudtrail.amazonaws.com | kms:GenerateDataKey*, pinned to the trail by aws:SourceArn |
AllowCloudTrailDescribeKey | cloudtrail.amazonaws.com | kms:DescribeKey, same pin |
AllowCloudTrailDecryptTrail | cloudtrail.amazonaws.com | kms:Decrypt. Needed because Bucket Key is on |
AllowCloudWatchLogsUsage | logs.us-east-1.amazonaws.com | Encrypt and decrypt for the log group |
The CloudWatch Logs statement conditions on the encryption context, kms:EncryptionContext:aws:logs:arn, not aws:SourceAccount. CloudWatch Logs does not send aws:SourceAccount.
The bucket policy got AWSCloudTrailAclCheck and AWSCloudTrailWrite. The write is scoped to AWSLogs/<ACCOUNT_ID>/*, the same prefix Lab 3’s flow logs use. CloudTrail writes under CloudTrail/ and CloudTrail-Digest/. One bucket, separate prefixes, one Object Lock default over all of it.
I built both merged policies with jq from the before-files, applied them, then read them back and diffed them sorted. DenyInsecureTransport was still the first statement.
The build, from CloudShell
The log group came first. create-log-group with the CMK succeeded, which proved AllowCloudWatchLogsUsage. Retention is a separate call. create-log-group has no retention option and defaults to Never expire.
aws logs create-log-group --log-group-name /aws/cloudtrail/grc-lab4-trail --kms-key-id <CMK_ARN>
aws logs put-retention-policy --log-group-name /aws/cloudtrail/grc-lab4-trail --retention-in-days 365
The trail needs a role to write to CloudWatch Logs. The console makes one for you. I made CloudTrailRole-grc-lab4 with its trust policy pinned to the trail by aws:SourceArn. Its inline policy allows CreateLogStream and PutLogEvents on this one group’s streams and nothing else. create-trail accepted the role on the first try, so CloudTrail does satisfy that trust condition at create time.
{
"Name": "grc-lab4-trail",
"S3BucketName": "grc-lab2-evidence-08132026",
"IncludeGlobalServiceEvents": true,
"IsMultiRegionTrail": true,
"LogFileValidationEnabled": true,
"CloudWatchLogsLogGroupArn": "arn:aws:logs:us-east-1:<ACCOUNT_ID>:log-group:/aws/cloudtrail/grc-lab4-trail:*",
"KmsKeyId": "<CMK_ARN>",
"IsOrganizationTrail": false
}
Event selectors are management events, ReadWriteType: All, no data resources. Data events are off by default and billed per event, and the three review questions in this lab are all management-event questions. That’s the scope line.
A trail created from the CLI does not log until you call start-logging. The console does it for you. I ran it at 06:01:16Z on 2026-11-22.
{
"logging": true,
"started": "2026-11-22T06:01:16.664000+00:00",
"lastS3": "2026-11-22T06:27:25.114000+00:00",
"s3Err": null,
"lastCWL": "2026-11-22T06:25:55.460000+00:00",
"cwlErr": null
}
The first log file landed about five minutes after logging started. Both delivery-error fields are empty. That one result proves the trail name agrees in all three places.
It also closes the question Lab 3 left open. Object Lock does not block CloudTrail delivery. The newest object carried GOVERNANCE retention until 2027-11-22, applied by the bucket default.
Two alert paths for the same three events
SNS topic grc-lab4-critical-events, one email subscription. Three events go to it: root activity, console login without MFA, and IAM policy changes. Each event has two paths.
The first path is a metric filter on the log group, an alarm on the metric, and the alarm publishing to the topic. The patterns are the CIS AWS Foundations ones. Namespace GRC/Lab4. Sum ≥ 1 over five minutes.
The second path is an EventBridge rule on the default bus, targeting the topic.
The reason for both is Regions. An EventBridge rule in us-east-1 only sees events delivered in us-east-1. IAM and root sign-in events land there, so the rules cover all three events. But a console sign-in through a regional endpoint can land somewhere else. The alarm path sees every Region, because the multi-region trail feeds one log group. EventBridge is seconds. The alarm is minutes. Each one covers the other’s gap.
The CLI does not add the topic permission the console adds. Without an events.amazonaws.com statement, the rule matches and the publish fails silently. Only the rule’s FailedInvocations metric would show it. I merged AllowGrcLab4EventBridgePublish into the topic policy by hand, with aws:SourceArn limited to rule/grc-lab4-*. The alarms publish through the topic’s default statement.
I left the topic unencrypted. Encrypting it with the CMK takes two more key-policy statements, and the AWS-managed aws/sns key can’t admit EventBridge at all. The alert body is event metadata, not CJI. The trail is the record.
Missing data is notBreaching. A metric filter only publishes on a match, so treating missing data as missing would leave every alarm gray almost all the time. That’s the same setting the orphaned alarms had, and it has the same weakness. The alarm can’t tell no events from no pipeline. Pipeline health comes from get-trail-status, not from the alarm.
Athena for the review
AU-6 is review. A trail nobody queries is collection, not review.
Athena writes a results file and a metadata file for every query. In the Lab 2 bucket each of those would be locked for a year, and they aren’t evidence. They can be regenerated from the logs. So results go to a separate bucket, grc-lab4-athena-results-11212026. It’s SSE-KMS with the CMK, because results contain log content. It has Block Public Access, a TLS-only policy, a 30-day expiry, and no Object Lock.
The workgroup audit-queries runs engine v3, writes results SSE-KMS to that bucket, and enforces its configuration so a client can’t override either.
The table uses partition projection. Athena computes the S3 paths from the region and day values in the WHERE clause, so there’s no partition catalog to maintain and no MSCK REPAIR.
PARTITIONED BY (region STRING, day STRING)
...
TBLPROPERTIES (
'projection.enabled' = 'true',
'projection.region.type' = 'enum',
'projection.day.type' = 'date',
'projection.day.format' = 'yyyy/MM/dd',
'storage.location.template' = 's3://grc-lab2-evidence-08132026/AWSLogs/<ACCOUNT_ID>/CloudTrail/${region}/${day}'
);
I named the date partition day, not timestamp like AWS’s example. timestamp is a reserved word and needs quoting in every query. I also trimmed the column list to what a reviewer reads. The JSON SerDe ignores keys the table doesn’t declare.
Three saved queries, each tied to a review question.
| Query | Question | Control |
|---|---|---|
au6-root-activity-90d | Every root action in the last 90 days | AU-6 |
ac2-iam-changes-by-actor | IAM changes, grouped by who made them | AC-2, AC-6 |
si4-calls-per-region-per-day | API calls per Region per day. A Region I never deploy to with a nonzero count is the finding | SI-4 |
I also wrote the three as Logs Insights queries against the log group. I didn’t save their output, so the evidence here is Athena. Insights is faster for the last few days. Over long ranges, Athena over S3 is cheaper.
A new trail starts empty. On day one, “the last 90 days” means a few hours. Event History covers the 90 days before the trail existed, which is the before-state in one line.
Verify like an assessor
Integrity (AU-9). Digests are hourly. The first one covered only the minute before logging started, so it validated zero log files. I waited and ran validate-logs over the first night.
Results requested for 2026-11-22T06:00:00Z to 2026-11-22T12:55:56Z
Results found for 2026-11-22T06:00:00Z to 2026-11-22T12:01:16Z:
7/7 digest files valid
197/197 log files valid
Every delivered file matches the signed digest chain. That proves no file in the range was altered and none went missing from the chain. It does not prove the trail captured events it was never configured to select. Data events were off, so they were never in the record to begin with.
WORM (AU-9, AU-11). I tried to delete the first log file by version ID.
An error occurred (AccessDenied) when calling the DeleteObject operation: Access Denied because object protected by object lock.
Then I deleted it without a version ID. That one returned success.
{
"DeleteMarker": true,
"VersionId": "4AUzp2NzEtpRG2Iuqp.tcmgurjWIgCbv"
}
That’s not a failure of the lock. A delete without a version ID only adds a delete marker. The locked version was still there, no longer the latest. I removed the marker and the original version came back as current.
GOVERNANCE mode has a limit I have to state. A principal with s3:BypassGovernanceRetention and the bypass header can delete a locked version. My admin user has that permission. GOVERNANCE stops accidents and anyone without the bypass. COMPLIANCE mode, or the log-archive account, is what stops an admin.
Alerting (SI-4). I created and deleted a throwaway customer managed policy, grc-lab4-alert-test. Event History has CreatePolicy at 06:52:55Z and DeletePolicy at 06:53:00Z, both by my admin user.
EventBridge sent two emails within a minute, one per event, with the raw event as the body. That also proved the topic policy’s aws:SourceArn condition matches what EventBridge sends. The grc-lab4-iam-policy-change alarm went from OK to ALARM at 06:56:34Z on a datapoint of 2.0, both events in one five-minute bucket. That’s about three and a half minutes after the events. It went back to OK at 07:11:34Z through notBreaching. Seconds against minutes, as designed.
That test fired only the IAM-policy path. The root-activity and console-login-without-MFA paths are configured, but I didn’t trigger either one. They use the same topic and the same wiring, so they should deliver the same way. That’s an inference, not a test.
Review (AU-6). The IAM-changes query in the workgroup, run the next morning.

Two rows. The alert test, by actor. 669.63 KB scanned in 2.3 seconds, which is one Region partition out of 17 and one day of files. Athena bills a 10 MB minimum per query, so this one cost the minimum.
Control mappings
| Configuration | NIST 800-53 Rev 5 | FedRAMP High | CJIS v6.1 |
|---|---|---|---|
| Multi-region trail, management events Read + Write, global service events | AU-2, AU-3, AU-12 | AU-2, AU-3, AU-12 | AU-2, AU-3, AU-12 |
| Log file validation (hourly signed digests) | AU-9 | AU-9 | AU-9 |
| SSE-KMS with the customer-managed CMK | AU-9, SC-28 | AU-9, SC-28 | AU-9, SC-28 |
| Object Lock on the log bucket, 1-year GOVERNANCE default | AU-9, AU-11 | AU-9, AU-11 | AU-11 (1-year retention) |
| CloudWatch Logs copy, 365-day retention | AU-11 | AU-11 | AU-11 |
| Metric-filter alarms and EventBridge rules on three critical events | SI-4 | SI-4 | SI-4 |
| Athena workgroup, projected table, saved queries | AU-6, AU-7 | AU-6, AU-7 | AU-6 |
| Trail created where none existed. Orphaned alarms removed | AU-12, CM-8 | AU-12, CM-8 | AU-12 |
| Not met: logs on a separate system | AU-9(2) | AU-9(2) | Not mapped |
CJIS v6.1 asks for at least a year of audit retention. Event History’s 90 days fails that on its own, which is why the old before-state was a finding and not just a missing feature. The AU-6 row makes review runnable. It doesn’t prove anyone ran one. CJIS expects that review weekly, and the proof is the query history, not the workgroup.
The module
I then coded the same build as cloudtrail-multi-region in aws-grc-terraform-modules (v1.4.0). It shipped in three PRs: collection, alerting, review.
The module has no is_multi_region_trail input and no enable_log_file_validation input. Both are literal true. A caller can’t turn either off, because there’s no variable to set. Same move as Lab 2’s missing Block Public Access toggle and Lab 3’s missing flow-logs switch. kms_key_arn is required and rejects an alias ARN, so there is no SSE-S3 fallback. A log retention under 365 days fails at plan time.
The module does not write the key policy, the bucket policy, or the topic policy. Those belong to the Lab 2 stack and the caller. Its README lists the same statements this post adds.
I didn’t build it fresh. I imported the CLI-built resources into each PR’s plan and read the diff. The final plan was 18 to import, 4 to add, 14 to change, 0 to destroy. The changes were required tags and provider defaults. The adds were the four saved queries: the table DDL and the three review queries. The ones I saved from the CLI were not in the account at plan time, so the module recreates them. Filter patterns, alarm settings, and event patterns matched with no diff. I ran the module’s rendered DDL as a scratch table and its IAM-changes query against it. Same two rows as the console run. I dropped the scratch table.
Two limits are in the module README. The Athena table is created by running a saved query once, so it lives outside Terraform state, and a deleted table won’t show in a plan. And the bucket-policy statements are hand-added to a bucket another module owns. The next apply of that stack reverts them, and delivery stops. get-trail-status would show it. The alarms would not.
GovCloud and CJIS
I ran this in commercial us-east-1. In GovCloud the ARNs move to the aws-us-gov partition. The module builds the trail ARN from data.aws_partition, and its KMS ARN check accepts arn:aws-us-gov:kms:.
IAM events land in us-gov-west-1 in GovCloud, not us-east-1. The module’s IAM-changes query filters on eventsource and has no Region filter, so it works in both. The cost is that it scans every Region prefix.
Athena and partition projection work the same in both GovCloud Regions. CJIS contexts want FIPS endpoints for reading logs. That’s a provider endpoint choice for the caller. I noted it and didn’t build it.
The trail is the agency’s audit record for everything in the account. That’s the CJIS framing, and it’s why the separate log-archive account matters more there than here.
What stays running
Nothing here was torn down. The trail, the log group, the role, the topic, the alarms, the rules, the workgroup, and the results bucket all stay up. That’s the point of an audit trail, and Lab 5 builds on them.
The ongoing cost is small. The first copy of management events is free. The rest is CloudWatch Logs ingestion and storage, three alarms, and Athena per query. The Lab 2 CMK was already billing.
What lands here next
Lab 5’s Config delivery channel writes to the same bucket. Its alerts go to this topic.
The module is cloudtrail-multi-region v1.4.0.