AWS SNS Email Subscription by Rare User
Identifies when an SNS topic is subscribed to by an email address of a user who does not typically perform this action. Adversaries may subscribe to an SNS topic to collect sensitive information or exfiltrate data via an external email address.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/11/01"
3integration = ["aws"]
4maturity = "production"
5updated_date = "2024/11/07"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies when an SNS topic is subscribed to by an email address of a user who does not typically perform this action.
11Adversaries may subscribe to an SNS topic to collect sensitive information or exfiltrate data via an external email
12address.
13"""
14false_positives = [
15 """
16 Legitimate users may subscribe to SNS topics for legitimate purposes. Ensure that the subscription is authorized and
17 the subscription email address is known before taking action.
18 """,
19]
20from = "now-9m"
21index = ["filebeat-*", "logs-aws.cloudtrail-*"]
22language = "kuery"
23license = "Elastic License v2"
24name = "AWS SNS Email Subscription by Rare User"
25note = """## Triage and Analysis
26
27### Investigating AWS SNS Email Subscription by Rare User
28
29This rule identifies when an SNS topic is subscribed to by an email address of a user who does not typically perform this action. While subscribing to SNS topics is a common practice, adversaries may exploit this feature to collect sensitive information or exfiltrate data via an external email address.
30
31#### Possible Investigation Steps
32
33- **Identify the Actor**: Review the `aws.cloudtrail.user_identity.arn` field to identify the user who requested the subscription. Verify if this actor typically performs such actions and has the necessary permissions. It may be unusual for this activity to originate from certain user types, such as an assumed role or federated user.
34- **Review the SNS Subscription Event**: Analyze the specifics of the `Subscribe` action in CloudTrail logs:
35 - **Topic**: Look at the `aws.cloudtrail.request_parameters.topicArn` field to identify the SNS topic involved in the subscription.
36 - **Protocol and Endpoint**: Review the `aws.cloudtrail.request_parameters.protocol` and `aws.cloudtrail.request_parameters.endpoint` fields to confirm the subscription's protocol and email address. Confirm if this endpoint is associated with a known or trusted entity.
37 - **Subscription Status**: Check the `aws.cloudtrail.response_elements.subscriptionArn` field for the subscription's current status, noting if it requires confirmation.
38- **Verify Authorization**: Evaluate whether the user typically engages in SNS subscription actions and if they are authorized to do so for the specified topic.
39- **Contextualize with Related Events**: Review related CloudTrail logs around the event time for other actions by the same user or IP address. Look for activities involving other AWS services, such as S3 or IAM, that may indicate further suspicious behavior.
40- **Evaluate the Subscription Endpoint**: Determine whether the email endpoint is legitimate or associated with any known entity. This may require checking internal documentation or reaching out to relevant AWS account administrators.
41- **Check for Publish Actions**: Investigate for any subsequent `Publish` actions on the same SNS topic that may indicate exfiltration attempts or data leakage. If Publish actions are detected, further investigate the contents of the messages.
42- **Review IAM Policies**: Examine the user or role's IAM policies to ensure that the subscription action is within the scope of their permissions or should be.
43
44### False Positive Analysis
45
46- **Historical User Actions**: Verify if the user has a history of performing similar actions on SNS topics. Consistent, repetitive actions may suggest legitimate usage.
47- **Scheduled or Automated Tasks**: Confirm if the subscription action aligns with scheduled tasks or automated notifications authorized by your organization.
48
49### Response and Remediation
50
51- **Immediate Review and Reversal**: If the subscription was unauthorized, take appropriate action to cancel it and adjust SNS permissions as necessary.
52- **Strengthen Monitoring and Alerts**: Configure monitoring systems to flag similar actions involving sensitive topics or unapproved endpoints.
53- **Policy Review**: Review and update policies related to SNS subscriptions and access, tightening control as needed to prevent unauthorized subscriptions.
54- **Incident Response**: If there is evidence of malicious intent, treat the event as a potential data exfiltration incident and follow incident response protocols, including further investigation, containment, and recovery.
55
56### Additional Information
57
58For further guidance on managing and securing SNS topics in AWS environments, refer to the [AWS SNS documentation](https://docs.aws.amazon.com/sns/latest/dg/welcome.html) and AWS best practices for security.
59
60"""
61references = ["https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html"]
62risk_score = 21
63rule_id = "3df49ff6-985d-11ef-88a1-f661ea17fbcd"
64severity = "low"
65tags = [
66 "Domain: Cloud",
67 "Data Source: AWS",
68 "Data Source: Amazon Web Services",
69 "Data Source: AWS SNS",
70 "Resources: Investigation Guide",
71 "Use Case: Threat Detection",
72 "Tactic: Exfiltration",
73]
74timestamp_override = "event.ingested"
75type = "new_terms"
76
77query = '''
78event.dataset: "aws.cloudtrail"
79 and event.provider: "sns.amazonaws.com"
80 and event.action: "Subscribe"
81 and aws.cloudtrail.request_parameters: *protocol=email*
82'''
83
84[rule.investigation_fields]
85field_names = [
86 "@timestamp",
87 "user.name",
88 "source.address",
89 "aws.cloudtrail.user_identity.arn",
90 "aws.cloudtrail.user_identity.type",
91 "user_agent.original",
92 "event.action",
93 "event.outcome",
94 "cloud.region",
95 "aws.cloudtrail.flattened.request_parameters.protocol",
96 "aws.cloudtrail.flattened.request_parameters.topicArn",
97 "aws.cloudtrail.flattened.response_elements.subscriptionArn",
98 "aws.cloudtrail.request_parameters"
99]
100
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103[[rule.threat.technique]]
104id = "T1567"
105name = "Exfiltration Over Web Service"
106reference = "https://attack.mitre.org/techniques/T1567/"
107
108
109[rule.threat.tactic]
110id = "TA0010"
111name = "Exfiltration"
112reference = "https://attack.mitre.org/tactics/TA0010/"
113
114[rule.new_terms]
115field = "new_terms_fields"
116value = ["aws.cloudtrail.user_identity.arn"]
117[[rule.new_terms.history_window_start]]
118field = "history_window_start"
119value = "now-14d"
Triage and Analysis
Investigating AWS SNS Email Subscription by Rare User
This rule identifies when an SNS topic is subscribed to by an email address of a user who does not typically perform this action. While subscribing to SNS topics is a common practice, adversaries may exploit this feature to collect sensitive information or exfiltrate data via an external email address.
Possible Investigation Steps
- Identify the Actor: Review the
aws.cloudtrail.user_identity.arn
field to identify the user who requested the subscription. Verify if this actor typically performs such actions and has the necessary permissions. It may be unusual for this activity to originate from certain user types, such as an assumed role or federated user. - Review the SNS Subscription Event: Analyze the specifics of the
Subscribe
action in CloudTrail logs:- Topic: Look at the
aws.cloudtrail.request_parameters.topicArn
field to identify the SNS topic involved in the subscription. - Protocol and Endpoint: Review the
aws.cloudtrail.request_parameters.protocol
andaws.cloudtrail.request_parameters.endpoint
fields to confirm the subscription's protocol and email address. Confirm if this endpoint is associated with a known or trusted entity. - Subscription Status: Check the
aws.cloudtrail.response_elements.subscriptionArn
field for the subscription's current status, noting if it requires confirmation.
- Topic: Look at the
- Verify Authorization: Evaluate whether the user typically engages in SNS subscription actions and if they are authorized to do so for the specified topic.
- Contextualize with Related Events: Review related CloudTrail logs around the event time for other actions by the same user or IP address. Look for activities involving other AWS services, such as S3 or IAM, that may indicate further suspicious behavior.
- Evaluate the Subscription Endpoint: Determine whether the email endpoint is legitimate or associated with any known entity. This may require checking internal documentation or reaching out to relevant AWS account administrators.
- Check for Publish Actions: Investigate for any subsequent
Publish
actions on the same SNS topic that may indicate exfiltration attempts or data leakage. If Publish actions are detected, further investigate the contents of the messages. - Review IAM Policies: Examine the user or role's IAM policies to ensure that the subscription action is within the scope of their permissions or should be.
False Positive Analysis
- Historical User Actions: Verify if the user has a history of performing similar actions on SNS topics. Consistent, repetitive actions may suggest legitimate usage.
- Scheduled or Automated Tasks: Confirm if the subscription action aligns with scheduled tasks or automated notifications authorized by your organization.
Response and Remediation
- Immediate Review and Reversal: If the subscription was unauthorized, take appropriate action to cancel it and adjust SNS permissions as necessary.
- Strengthen Monitoring and Alerts: Configure monitoring systems to flag similar actions involving sensitive topics or unapproved endpoints.
- Policy Review: Review and update policies related to SNS subscriptions and access, tightening control as needed to prevent unauthorized subscriptions.
- Incident Response: If there is evidence of malicious intent, treat the event as a potential data exfiltration incident and follow incident response protocols, including further investigation, containment, and recovery.
Additional Information
For further guidance on managing and securing SNS topics in AWS environments, refer to the AWS SNS documentation and AWS best practices for security.
References
Related rules
- AWS SSM Command Document Created by Rare User
- AWS S3 Bucket Replicated to Another Account
- AWS RDS DB Snapshot Shared with Another Account
- AWS SSM `SendCommand` Execution by Rare User
- AWS EC2 EBS Snapshot Shared with Another Account