Enable Amazon GuardDuty:
GuardDuty is a threat detection service that natively supports detecting cryptocurrency mining activity on Amazon EC2 instances.
Enable GuardDuty for the account and all AWS Regions to ensure comprehensive coverage.
Monitor GuardDuty Findings:
GuardDuty generates findings for activities associated with cryptocurrency mining (e.g., unauthorized mining, DNS queries to known mining domains).
Create an EventBridge Rule:
Define an EventBridge rule that triggers on specific GuardDuty findings related to cryptocurrency activity.
Configure the rule to send notifications to an Amazon SNS topic.
Example Rule:
{
"Source": ["aws.guardduty"],
"DetailType": ["GuardDuty Finding"],
"Detail": {
"type": ["CryptoCurrency:EC2/BitcoinTool.B"]
}
}
Advantages of GuardDuty:
Automated Threat Detection: Requires no additional setup or custom rules.
Near-Real-Time Alerts: Delivers findings and notifications with minimal delay.
Amazon GuardDuty Documentation
Creating EventBridge Rules for GuardDuty Findings