Detect EC2 Instances Communicating with Known Command-and-Control Infrastructure in AWS GuardDuty Findings
Published
Sigma Rule
title: EC2 Instance Communicating with Known Command-and-Control Infrastructure
id: 2d1bdbfb-0e0b-427c-856f-00ad5a33d723
status: experimental
description: >
Detects AWS GuardDuty findings of type Backdoor:EC2/C&CActivity where the
EC2 instance is recorded as the ACTOR resource, meaning the instance itself
made an outbound connection to an IP address on GuardDuty's threat
intelligence list of known command-and-control servers. GuardDuty rates
this finding type High severity because it means the instance is already
compromised and is actively talking to attacker infrastructure, not merely
being scanned or probed.
references:
- https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-ec2.html
- https://attack.mitre.org/techniques/T1071/
author: LogTriage
date: 2026/11/16
modified: 2026/11/16
logsource:
product: aws
service: guardduty
detection:
selection_type:
type|contains: 'Backdoor:EC2/C&CActivity'
selection_role:
resourceRole: 'ACTOR'
condition: selection_type and selection_role
falsepositives:
- Security research or honeypot instance intentionally reaching known-bad infrastructure
- Recently repurposed IP still present in the threat intelligence feed
level: high
tags:
- attack.command_and_control
- attack.t1071
1 · Each event is compared with 2 selections. Every field in a selection must match; listed values are alternatives.
- type contains
Backdoor:EC2/C&CActivity
- resourceRole is
ACTOR
2 · An event counts when
selection_typeandselection_role
guardduty_findings.json, silent on guardduty_normal.json — both in the public sample dataset ↗︎ What this rule detects
GuardDuty’s Backdoor:EC2/C&CActivity finding type fires when an EC2 instance makes an outbound
connection to an IP address on GuardDuty’s own threat intelligence list of known
command-and-control servers. Unlike a port scan or brute-force attempt, which describe someone
trying to get in, this finding describes an instance that is already compromised and is talking
back out to attacker infrastructure. This rule flags that finding type whenever the EC2 instance
is recorded as the resource that performed the action (resourceRole: ACTOR), not the one being
targeted.
Detection logic
Two selections, both required:
selection_typematchestypecontainingBackdoor:EC2/C&CActivity, GuardDuty’s namespace/resource/threat-family identifier for this exact behavior.selection_rolematchesresourceRole: ACTOR, confirming the EC2 instance initiated the connection rather than merely being named as a target elsewhere in the finding.
Both must hold because GuardDuty reuses the same type prefix across related findings, and the
resourceRole field is what distinguishes “this instance called out to a C2 server” from “this
instance was the subject of someone else’s lookup.” Requiring ACTOR keeps the rule narrow to
actual outbound beaconing.
Validated against a real sample
Validated against guardduty_findings.json (shipped with LogTriage). The second finding,
finding002, has type: Backdoor:EC2/C&CActivity.B, severity: 8.9, and
service.resourceRole: ACTOR for i-0abc123def456, which made an outbound TCP connection from
local port 49200 to 45.142.212.100:4444 in Amsterdam, with eventFirstSeen and eventLastSeen
four minutes apart and service.count: 34 recorded connections. Both selections match this
object, so the rule fires.
The same file also contains an SSH brute force finding (severity 2.0) and a malicious-IP
reconnaissance finding (severity 6.0), neither of which has type containing
Backdoor:EC2/C&CActivity, so they do not match this rule. The benign file contains a blocked
port probe and an S3 public-access-block change, both with resourceRole: TARGET and neither
with a Backdoor: type, so the rule stays silent on it.
False positives
A security research instance or honeypot deliberately configured to beacon to known-bad infrastructure will trip this finding legitimately; check the instance’s purpose before treating it as a live compromise. The other recurring case is a threat-intel feed entry that lags reality — an IP recently repurposed by its owner for something benign before the feed rotates it out. Both are uncommon enough that they should be confirmed per-finding rather than suppressed by default.
Frequently Asked Questions
- What does the GuardDuty type field Backdoor:EC2/C&CActivity.B actually mean?
- GuardDuty finding types follow a fixed taxonomy: Namespace:ResourceType/ThreatPurpose.ThreatFamilyName. Backdoor is the namespace, EC2 is the affected resource type, and C&CActivity.B identifies the specific threat family — the instance connected to an IP on GuardDuty's own curated list of command-and-control servers. This is a threat-intel match, not a behavioral heuristic, so false positives are rare.
- Why require resourceRole: ACTOR instead of just matching on the type?
- GuardDuty tags every finding's resource with a resourceRole of ACTOR or TARGET. ACTOR means this resource performed the suspicious action; TARGET means it was on the receiving end. For a C&C finding, ACTOR on the EC2 instance confirms the instance itself dialed out to the C2 server, which is what makes this a compromise finding rather than, say, the instance being scanned from outside.
- Why is this high severity instead of critical?
- GuardDuty itself scores Backdoor:EC2/C&CActivity.B in the High band (the sample carries 8.9), one tier below its Critical reservations such as active data exfiltration or credential exfiltration findings. Treat it as high: the instance needs isolation and the C2 IP needs blocking, but confirm scope before declaring a full incident.
- Why doesn't this rule also cover the SSH brute force and recon findings in the same sample?
- Those are separate GuardDuty finding types (UnauthorizedAccess:EC2/SSHBruteForce, Recon:IAMUser/MaliciousIPCaller) describing different behaviors at different severities — brute force attempts and reconnaissance, not confirmed outbound C2 traffic. Mixing them into one rule would blur three distinct response actions into a single alert. Each finding type should be triaged on its own terms.
Related Resources
Reference
- AWS GuardDuty Finding Format: field reference → every field explained, with real sample records
- Paste one record and see what each field means → free, runs in your browser
See this detection run on a real report
Try the live demo with a pre-loaded malicious log set — no signup required — or upload your own log file and get a full AI-reviewed threat report in minutes.