Advanced Event Selectors
Understanding Advanced Event Selectors
Advanced event selectors in AWS CloudTrail provide granular control over which data events are recorded by defining specific selection criteria using field-based conditions with operators like equals, not equals, starts with, and ends with. This granular approach enables organizations to capture only the data events that matter for their security, compliance, and operational requirements while reducing costs associated with excessive event logging.
Advanced event selectors consist of field selectors, operators, and values. Each selector contains an array of field selectors that define the selection criteria, with each field selector specifying a field name (such as eventCategory, eventName, or resources.type), an operator (Equals, NotEquals, StartsWith, EndsWith), and one or more values to match against. The relationship between multiple field selectors within a single advanced event selector is logical AND, meaning all conditions must be met for an event to be recorded.

Supported Fields and Operators
CloudTrail advanced event selectors support a comprehensive set of fields that cover all aspects of AWS API calls for data events. The primary fields include eventName for specific API operations, resources.type for AWS resource types, resources.ARN for specific resource identifiers, and readOnly for distinguishing between read and write operations. Each field supports specific operators: Equals and NotEquals work with exact matches, while StartsWith and EndsWith enable pattern-based selection. Understanding these combinations is crucial for creating effective selection strategies.
The following will provide examples on how advanced event selectors can be used to select specific data events related to your AWS resources.
Amazon S3
Critical Write Operations Selector
This selector focuses on high-risk S3 operations that could indicate data exfiltration, unauthorized modifications, or compliance violations. By recording only write operations on sensitive buckets, organizations can detect malicious activity while reducing the log volume of S3 events. This approach is essential for maintaining security visibility without overwhelming security teams with routine read operations.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Object"]
},
{
"Field": "eventName",
"Equals": ["DeleteObject", "PutObject", "RestoreObject"]
},
{
"Field": "resources.ARN",
"StartsWith": ["arn:aws:s3:::sensitive-bucket/", "arn:aws:s3:::compliance-bucket/"]
}
]
}
]
AWS Lambda Function Monitoring
Production Function Invocation Selector
Lambda invocation monitoring is crucial for detecting unauthorized function execution and unusual access patterns. This selector targets lambda functions that start with the naming patterns for production and critical functions while excluding development naming pattern environments, reducing noise and focusing on business-critical activities. The pattern-based ARN selection automatically covers new functions that follow naming conventions, providing scalable security monitoring.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::Lambda::Function"]
},
{
"Field": "eventName",
"Equals": ["Invoke"]
},
{
"Field": "resources.ARN",
"StartsWith": ["arn:aws:lambda:us-east-1:123456789012:function:prod-", "arn:aws:lambda:us-east-1:123456789012:function:critical-"]
}
]
}
]