Detection of Rare AWS SNS Protocol Subscriptions
Adversaries may exploit AWS SNS by subscribing to topics using rare or unauthorized protocols to exfiltrate sensitive data or establish command-and-control communication channels.
Adversaries may abuse the AWS Simple Notification Service (SNS) subscription mechanism to exfiltrate information or collect sensitive data. By subscribing an external, attacker-controlled endpoint - such as an email address, mobile number, or cross-account Lambda function - to an existing SNS topic, an attacker can gain unauthorized access to notification streams. This activity often involves creating a new subscription with an uncommon protocol that deviates from established operational norms within an AWS environment.
Because SNS is a legitimate service used for inter-service communication and alerting, this technique allows attackers to mask data exfiltration as benign message routing. Detection is challenging due to the inherent flexibility of SNS, but monitoring for "new terms" (previously unseen protocol/user combinations) within CloudTrail logs can provide visibility into deviations from standard administrative behavior. This is particularly relevant when such actions originate from non-human identities or roles that do not typically manage notification infrastructure.
Impact
Successful exploitation allows for the unauthorized exfiltration of sensitive data contained within SNS notification messages, the collection of system alerts by external third parties, or the potential for resource hijacking via cross-account service execution. Organizations may suffer data leakage or the integration of malicious infrastructure into their internal notification chains, leading to potential operational disruption or compliance violations.
Recommendation
- Deploy the detection logic focusing on
aws.cloudtrailevents withevent.action: Subscribeto identify new protocol usage by specific users. - Audit existing SNS subscriptions periodically to ensure endpoints match known and authorized external or internal resources.
- Restrict IAM permissions for the
sns:Subscribeaction to only those identities and roles that require them for legitimate operational workflows. - Investigate any detected subscriptions that utilize non-standard protocols (e.g., protocols rarely used in the environment) in conjunction with other suspicious CloudTrail activity like unauthorized S3 access.
Immediate actions
Review CloudTrail logs for unexpected sns:Subscribe events targeting sensitive topics.
Threat Hunt
Identify new SNS protocols used by non-human IAM roles.
Data: AWS CloudTrail logs
Mitigations
Implement IAM least-privilege for SNS subscription actions.
T1496.004