AWS SNS Rare Protocol Subscription by User

Identifies when a use subscribes to an SNS topic using a new protocol type (ie. email, http, lambda, etc.). SNS allows users to subscribe to recieve topic messages across a broad range of protocols like email, sms, lambda functions, http endpoints, and applications. Adversaries may subscribe to an SNS topic to collect sensitive information or exfiltrate data via an external email address, cross-account AWS service or other means. This rule identifies a new protocol subscription method for a particular user.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/11/01"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2025/09/09"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies when a use subscribes to an SNS topic using a new protocol type (ie. email, http, lambda, etc.). SNS allows users to subscribe to recieve topic messages across a broad range of protocols like email, sms, lambda functions, http endpoints, and applications. Adversaries may subscribe to an SNS topic to collect sensitive information or exfiltrate data via an external email address, cross-account AWS service or other means. This rule identifies a new protocol subscription method for a particular user. 
 11"""
 12false_positives = [
 13    """
 14    Legitimate users may subscribe to SNS topics for legitimate purposes. Ensure that the subscription is authorized before taking action.
 15    """,
 16]
 17from = "now-6m"
 18index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 19language = "kuery"
 20license = "Elastic License v2"
 21name = "AWS SNS Rare Protocol Subscription by User"
 22note = """## Triage and analysis
 23
 24### Investigating AWS SNS Rare Protocol Subscription by User
 25
 26This rule identifies when an SNS topic is subscribed to by a rare protocol for a particular user. 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, mobile number, or cross-account AWS service like Lambda.
 27
 28This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule that only flags when this behavior is observed using a protocol for the first time.
 29
 30#### Possible Investigation Steps
 31
 32- **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.
 33- **Review the SNS Subscription Event**: Analyze the specifics of the `Subscribe` action in CloudTrail logs:
 34  - **Topic**: Look at the `aws.cloudtrail.request_parameters` or `target.entity.id` field to identify the SNS topic involved in the subscription.
 35  - **Protocol and Endpoint**: Review the `aws.cloudtrail.request_parameters` field to confirm the subscription's protocol and endpoint, if available. Confirm if this endpoint is associated with a known or trusted entity.
 36  - **Subscription Status**: Check the `aws.cloudtrail.response_elements` field for the subscription's current status, noting if it requires confirmation.
 37- **Verify Authorization**: Evaluate whether the user typically engages in SNS subscription actions and if they are authorized to do so for the specified topic.
 38- **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.
 39- **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.
 40- **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.
 41
 42### False Positive Analysis
 43
 44- **Historical User Actions**: Verify if the user has a history of performing similar actions on SNS topics. Consistent, repetitive actions may suggest legitimate usage.
 45- **Scheduled or Automated Tasks**: Confirm if the subscription action aligns with scheduled tasks or automated notifications authorized by your organization.
 46
 47### Response and Remediation
 48
 49- **Immediate Review and Reversal**: If the subscription was unauthorized, take appropriate action to cancel it and adjust SNS permissions as necessary.
 50- **Strengthen Monitoring and Alerts**: Configure monitoring systems to flag similar actions involving sensitive topics or unapproved endpoints.
 51- **Policy Review**: Review and update policies related to SNS subscriptions and access, tightening control as needed to prevent unauthorized subscriptions.
 52- **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.
 53
 54### Additional Information
 55
 56For 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.
 57
 58"""
 59references = [
 60        "https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html",
 61        "https://permiso.io/blog/s/smishing-attack-on-aws-sms-new-phone-who-dis/",
 62        "https://www.sentinelone.com/labs/sns-sender-active-campaigns-unleash-messaging-spam-through-the-cloud/",
 63]
 64risk_score = 21
 65rule_id = "3df49ff6-985d-11ef-88a1-f661ea17fbcd"
 66severity = "low"
 67tags = [
 68    "Domain: Cloud",
 69    "Data Source: AWS",
 70    "Data Source: Amazon Web Services",
 71    "Data Source: AWS SNS",
 72    "Resources: Investigation Guide",
 73    "Use Case: Threat Detection",
 74    "Tactic: Exfiltration",
 75    "Tactic: Collection",
 76    "Tactic: Impact",
 77]
 78timestamp_override = "event.ingested"
 79type = "new_terms"
 80
 81query = '''
 82event.dataset: "aws.cloudtrail"
 83    and event.provider: "sns.amazonaws.com"
 84    and event.action: "Subscribe"
 85    and event.outcome: "success"
 86'''
 87
 88
 89[[rule.threat]]
 90framework = "MITRE ATT&CK"
 91[[rule.threat.technique]]
 92id = "T1567"
 93name = "Exfiltration Over Web Service"
 94reference = "https://attack.mitre.org/techniques/T1567/"
 95
 96
 97[rule.threat.tactic]
 98id = "TA0010"
 99name = "Exfiltration"
100reference = "https://attack.mitre.org/tactics/TA0010/"
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103[[rule.threat.technique]]
104id = "T1530"
105name = "Data from Cloud Storage"
106reference = "https://attack.mitre.org/techniques/T1530/"
107
108
109[rule.threat.tactic]
110id = "TA0009"
111name = "Collection"
112reference = "https://attack.mitre.org/tactics/TA0009/"
113[[rule.threat]]
114framework = "MITRE ATT&CK"
115[[rule.threat.technique]]
116id = "T1496"
117name = "Resource Hijacking"
118reference = "https://attack.mitre.org/techniques/T1496/"
119[[rule.threat.technique.subtechnique]]
120id = "T1496.004"
121name = "Cloud Service Hijacking"
122reference = "https://attack.mitre.org/techniques/T1496/004/"
123
124
125
126[rule.threat.tactic]
127id = "TA0040"
128name = "Impact"
129reference = "https://attack.mitre.org/tactics/TA0040/"
130
131[rule.investigation_fields]
132field_names = [
133    "@timestamp",
134    "user.name",
135    "user_agent.original",
136    "source.ip",
137    "aws.cloudtrail.user_identity.arn",
138    "aws.cloudtrail.user_identity.type",
139    "aws.cloudtrail.user_identity.access_key_id",
140    "event.action",
141    "event.outcome",
142    "cloud.account.id",
143    "cloud.region",
144    "aws.cloudtrail.request_parameters",
145    "aws.cloudtrail.response_elements"
146]
147
148[rule.new_terms]
149field = "new_terms_fields"
150value = ["cloud.account.id", "user.name", "aws.cloudtrail.flattened.request_parameters.protocol"]
151[[rule.new_terms.history_window_start]]
152field = "history_window_start"
153value = "now-14d"

Triage and analysis

Investigating AWS SNS Rare Protocol Subscription by User

This rule identifies when an SNS topic is subscribed to by a rare protocol for a particular user. 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, mobile number, or cross-account AWS service like Lambda.

This is a New Terms rule that only flags when this behavior is observed using a protocol for the first time.

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 or target.entity.id field to identify the SNS topic involved in the subscription.
    • Protocol and Endpoint: Review the aws.cloudtrail.request_parameters field to confirm the subscription's protocol and endpoint, if available. Confirm if this endpoint is associated with a known or trusted entity.
    • Subscription Status: Check the aws.cloudtrail.response_elements field for the subscription's current status, noting if it requires confirmation.
  • 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.
  • 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

to-top