Ensure CloudTrail is enabled in all regions
Description
AWS CloudTrail is a web service that records AWS API calls for your account and delivers log files to you. The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service. CloudTrail provides a history of AWS API calls for an account, including API calls made via the Management Console, SDKs, command line tools, and higher-level AWS services (such as CloudFormation).
Rationale
The AWS API call history produced by CloudTrail enables security analysis, resource change tracking, and compliance auditing. Additionally,
- ensuring that a multi-region trail exists will help detect unexpected activity occurring in otherwise unused regions
- ensuring that a multi-region trail exists will ensure that Global Service Logging is enabled for a trail by default to capture recordings of events generated on AWS global services
- for a multi-region trail, ensuring that management events are configured for all types of Read/Writes ensures the recording of management operations that are performed on all resources in an AWS account
Impact
S3 lifecycle features can be used to manage the accumulation and management of logs over time. See the following AWS resource for more information on these features:
Audit Procedure
Using AWS Console
- Sign in to the AWS Management Console and open the CloudTrail console at https://console.aws.amazon.com/cloudtrail
- Click on
Trailsin the left navigation pane - You will be presented with a list of trails across all regions
- Ensure that at least one Trail has
Yesspecified in theMulti-region trailcolumn - Click on a trail via the link in the
Namecolumn - Ensure
Loggingis set toON - Ensure
Multi-region trailis set toYes - In the section
Management Events, ensure thatAPI activityset toALL
Using AWS CLI
- List all trails:
aws cloudtrail describe-trails
- Ensure
IsMultiRegionTrailis set totrue:
aws cloudtrail get-trail-status --name <trail-name>
- Ensure
IsLoggingis set totrue:
aws cloudtrail get-event-selectors --trail-name <trail-name>
- Ensure there is at least one
fieldSelectorfor a trail that equalsManagement:
- This should NOT output any results for Field: "readOnly". If either
trueorfalseis returned, one of the checkboxes (readorwrite) is not selected.
Example of correct output:
"TrailARN": "<your_trail_ARN>",
"AdvancedEventSelectors": [
{
"Name": "Management events selector",
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": [
"Management"
]
}
]
}
]
Expected Result
At least one multi-region trail exists with IsMultiRegionTrail set to true, IsLogging set to true, and management events configured for all read/write types.
Remediation
Using AWS Console
- Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/cloudtrail.
- Click on
Trailsin the left navigation pane. - Click
Get Started Nowif it is presented, then:- Click
Add new trail. - Enter a trail name in the
Trail namebox.- A trail created in the console is a multi-region trail by default.
- Specify an S3 bucket name in the
S3 bucketbox. - Specify the AWS KMS alias under the
Log file SSE-KMS encryptionsection, or create a new key. - Click
Next.
- Click
- Ensure the
Management eventscheck box is selected. - Ensure both
ReadandWriteare checked under API activity. - Click
Next. - Review your trail settings and click
Create trail.
Using AWS CLI
Create a multi-region trail:
aws cloudtrail create-trail --name <trail-name> --bucket-name <s3-bucket-for-cloudtrail> --is-multi-region-trail
Enable multi-region on an existing trail:
aws cloudtrail update-trail --name <trail-name> --is-multi-region-trail
Note: Creating a CloudTrail trail via the CLI without providing any overriding options configures all read and write Management Events to be logged by default.
Default Value
By default, CloudTrail is not enabled in any region.
References
- CCE-78913-1
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html?icmpid=docs_cloudtrail_console#logging-management-events
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-supported-services.html#cloud-trail-supported-services-data-events
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 8.5 Collect Detailed Audit Logs - Configure detailed audit logging for enterprise assets containing sensitive data. Include event source, date, username, timestamp, source addresses, destination addresses, and other useful elements that could assist in a forensic investigation. | x | x | |
| v7 | 6.2 Activate audit logging - Ensure that local logging has been enabled on all systems and networking devices. | x | x | x |
MITRE ATT&CK Mappings
| Techniques / Sub-techniques | Tactics | Mitigations |
|---|---|---|
| T1535 | TA0005 | M1047, M1054 |
Profile
Level 1 | Manual