AWS EC2 ImportKeyPair Activity Monitoring (CloudTrail)
Flags CloudTrail EC2 ImportKeyPair events that may indicate newly imported SSH key access setup.
- Product
- aws
- Service
- cloudtrail
- Author
- Ivan Saakov (SigmaHQ), DRL 1.1
- Published
- 2024-12-19
- Updated
- 2026-07-31
ATT&CK techniques
Initial Access → Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags CloudTrail events where AWS EC2 ImportKeyPair is called to import an SSH key pair. Importing keys can enable attackers to establish or expand access to EC2 instances, potentially supporting initial access, persistence, or privilege escalation. The detection relies on CloudTrail telemetry fields matching eventSource ec2.amazonaws.com and eventName ImportKeyPair.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: AWS EC2 ImportKeyPair Activity Monitoring (CloudTrail)
id: 041b85cd-0706-460d-ba25-4a42ab39fcae
status: experimental
description: This rule flags CloudTrail events where AWS EC2 ImportKeyPair is called to import an SSH key pair. Importing keys can enable attackers to establish or expand access to EC2 instances, potentially supporting initial access, persistence, or privilege escalation. The detection relies on CloudTrail telemetry fields matching eventSource ec2.amazonaws.com and eventName ImportKeyPair.
references:
- https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html
- https://github.com/SigmaHQ/sigma/blob/master/rules/cloud/aws/cloudtrail/aws_ec2_import_key_pair_activity.yml
author: Ivan Saakov, Huntrule Team
date: 2024-12-19
tags:
- attack.initial-access
- attack.stealth
- attack.t1078
- attack.persistence
- attack.privilege-escalation
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: ec2.amazonaws.com
eventName: ImportKeyPair
condition: selection
falsepositives:
- Legitimate administrative actions by authorized users importing keys for valid purposes.
- Automated processes for infrastructure setup may trigger this alert.
- Verify the user identity, user agent, and source IP address to ensure they are expected.
level: medium
license: DRL-1.1
related:
- id: 92f84194-8d9a-4ee0-8699-c30bfac59780
type: derived