Advanced Event Selectors
Advanced Event Selectors को समझना
AWS CloudTrail में Advanced event selectors equals, not equals, starts with, और ends with जैसे operators के साथ field-आधारित conditions का उपयोग करके विशिष्ट selection criteria परिभाषित करके कौन से data events रिकॉर्ड किए जाते हैं इस पर बारीक नियंत्रण प्रदान करते हैं। यह बारीक दृष्टिकोण ऑर् गनाइज़ेशन्स को अत्यधिक event logging से जुड़ी लागतों को कम करते हुए केवल उन data events को कैप्चर करने में सक्षम बनाता है जो उनकी सुरक्षा, अनुपालन और परिचालन आवश्यकताओं के लिए महत्वपूर्ण हैं।
Advanced event selectors field selectors, operators, और values से मिलकर बनते हैं। प्रत्येक selector में field selectors का एक array होता है जो selection criteria को परिभाषित करता है, प्रत्येक field selector एक field name (जैसे eventCategory, eventName, या resources.type), एक operator (Equals, NotEquals, StartsWith, EndsWith), और मिलान करने के लिए एक या अधिक values निर्दिष्ट करता है। एक single advanced event selector के भीतर कई field selectors के बीच का संबंध logical AND है, जिसका अर्थ है कि event रिकॉर्ड होने के लिए सभी conditions पूरी होनी चाहिए।

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-"]
}
]
}
]
DynamoDB Table Operations
Write Operations and Sensitive Table Selector
DynamoDB generates high volumes of events, making selective event selection essential for cost control and security focus. These selectors capture data modification events that could indicate unauthorized access or data tampering while excluding routine read operations. The combination approach in the following example allows the recording of specific write operations for specific tables and all operations on sensitive tables that are defined, providing comprehensive coverage without excessive costs.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::DynamoDB::Table"]
},
{
"Field": "eventName",
"Equals": ["PutItem", "UpdateItem", "DeleteItem", "BatchWriteItem"]
},
{
"Field": "resources.ARN",
"Equals": ["arn:aws:dynamodb:us-east-1:123456789012:table/UserData"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::DynamoDB::Table"]
},
{
"Field": "resources.ARN",
"StartsWith": ["arn:aws:dynamodb:us-east-1:123456789012:table/Financial"]
}
]
}
]
Amazon SQS Queue Monitoring
Administrative Operations Selector
SQS administrative operations can represent certain security risk as they can disrupt message flow and modify queue permissions. This selector example focuses on queue management activities that could indicate privilege escalation or service disruption attempts. By excluding high-volume message operations, this approach reduces logging costs while maintaining visibility into security-relevant administrative changes.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::SQS::Queue"]
},
{
"Field": "eventName",
"Equals": ["CreateQueue", "DeleteQueue", "SetQueueAttributes", "AddPermission", "RemovePermission"]
}
]
}
]
Amazon SNS Topic Operations
Topic Management and Critical Topic Selector
SNS monitoring requires balancing administrative oversight with message flow visibility for critical topics. These selectors capture topic management operations that could affect notification delivery and monitor all activities on security-sensitive topics. The multi-selector approach allows comprehensive monitoring of critical communication channels while reducing overall log volume through selective topic selection.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::SNS::Topic"]
},
{
"Field": "eventName",
"Equals": ["CreateTopic", "DeleteTopic", "Subscribe", "Unsubscribe", "SetTopicAttributes"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::SNS::Topic"]
},
{
"Field": "resources.ARN",
"Equals": ["arn:aws:sns:us-east-1:123456789012:security-alerts"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::SNS::Topic"]
},
{
"Field": "resources.ARN",
"StartsWith": ["arn:aws:sns:us-east-1:123456789012:compliance-"]
}
]
}
]
User Identity-Based Selectors
Privileged User Monitoring Selector
User identity selection allows you to include or exclude events for actions taken by specific IAM identities. The following example demonstrates two approaches: excluding specific service roles from S3 object logging to reduce noise from automated processes, and recording only privileged roles for DynamoDB table operations to focus on high-risk activities.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Object"]
},
{
"Field": "userIdentity.arn",
"NotStartsWith": ["arn:aws:sts::123456789012:assumed-role/service-role/backup-automation-role", "arn:aws:sts::123456789012:assumed-role/service-role/monitoring-role"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::DynamoDB::Table"]
},
{
"Field": "userIdentity.arn",
"StartsWith": ["arn:aws:sts::123456789012:assumed-role/AdminRole/", "arn:aws:sts::123456789012:assumed-role/SecurityRole/"]
}
]
}
]
Organization Trail and Event Data Store (EDS) Selectors
Account-Level Exclusion Selector
For organization trails or Event Data Store (EDS) configurations, you can exclude entire accounts from S3 data event logging to reduce costs and focus on critical accounts. This selector excludes all S3 data events from a specific account by using the userIdentity.arn field to match any identity from that account. This approach is particularly useful for excluding development or testing accounts from comprehensive logging while maintaining coverage for production accounts.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Object"]
},
{
"Field": "userIdentity.arn",
"NotStartsWith": ["arn:aws:sts::111122223333:", "arn:aws:iam::111122223333:"]
}
]
}
]
Please be aware that userIdentity ARN types may extend beyond the STS and IAM examples shown above. It is recommended to verify all userIdentity ARN types currently used within your organization.
Multiple S3 Bucket Exclusion Selector
When managing organization-wide logging, you may need to exclude multiple S3 buckets that generate high-volume, low-value events such as backup buckets, temporary storage, or automated processing buckets. This selector demonstrates how to exclude multiple specific buckets while maintaining logging for all other S3 resources. The approach uses multiple NotStartsWith conditions to exclude different bucket ARN patterns efficiently.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Object"]
},
{
"Field": "resources.ARN",
"NotStartsWith": [
"arn:aws:s3:::backup-bucket-",
"arn:aws:s3:::temp-processing-",
"arn:aws:s3:::automated-logs-",
"arn:aws:s3:::dev-sandbox-"
]
}
]
}
]
Additional Supported Field Examples
Write Operations Selector
The readOnly field selector is crucial for focusing on events that represent actual changes to your environment. By selecting write operations only, organizations can reduce log volume while maintaining visibility into all actions that could impact security or compliance. This selector is particularly effective when combined with specific resource types or event sources.
Service-Specific Event Source Selector
Event source selection allows targeted monitoring of specific AWS services without the complexity of resource-type selection. This approach is ideal for compliance scenarios where certain services require comprehensive logging regardless of the specific resources involved. The selector significantly reduces cross-service noise while ensuring complete coverage of designated services.
Specific API Operation Monitoring
Event name selection provides the most granular control over CloudTrail logging, allowing organizations to monitor specific API operations across all services. This approach is valuable for detecting specific attack patterns, monitoring critical operations, or meeting precise compliance requirements. The selector dramatically reduces log volume while providing surgical visibility into high-risk operations.
Resource Type Combination Selection
Combining resource type selection with operation type selection creates powerful, targeted monitoring capabilities. The following example demonstrates three different approaches: recording write operations on S3 objects, capturing specific DynamoDB write operations, and logging write operations on S3 buckets. This combination allows organizations to record specific types of resources for specific types of operations, providing precise security coverage while minimizing unnecessary logging.
[
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Object"]
},
{
"Field": "readOnly",
"Equals": ["false"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::DynamoDB::Table"]
},
{
"Field": "eventName",
"Equals": ["PutItem", "UpdateItem", "DeleteItem"]
}
]
},
{
"FieldSelectors": [
{
"Field": "eventCategory",
"Equals": ["Data"]
},
{
"Field": "resources.type",
"Equals": ["AWS::S3::Bucket"]
},
{
"Field": "readOnly",
"Equals": ["false"]
}
]
}
]