Malicious Usage Of IMDS Credentials Outside Of AWS Infrastructure
Detects when an instance identity has taken an action that isn't inside SSM. This can indicate that a compromised EC2 instance is being used as a pivot point.
Sigma rule (View on GitHub)
1title: Malicious Usage Of IMDS Credentials Outside Of AWS Infrastructure
2id: 352a918a-34d8-4882-8470-44830c507aa3
3status: test
4description: |
5 Detects when an instance identity has taken an action that isn't inside SSM.
6 This can indicate that a compromised EC2 instance is being used as a pivot point.
7references:
8 - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-identity-roles.html
9 - https://ermetic.com/blog/aws/aws-ec2-imds-what-you-need-to-know/
10 - https://www.packetmischief.ca/2023/07/31/amazon-ec2-credential-exfiltration-how-it-happens-and-how-to-mitigate-it/#lifting-credentials-from-imds-this-is-why-we-cant-have-nice-things
11author: jamesc-grafana
12date: 2024-07-11
13tags:
14 - attack.privilege-escalation
15 - attack.defense-evasion
16 - attack.initial-access
17 - attack.persistence
18 - attack.t1078
19 - attack.t1078.002
20logsource:
21 product: aws
22 service: cloudtrail
23detection:
24 selection:
25 userIdentity.arn|re: '.+:assumed-role/aws:.+'
26 filter_main_generic:
27 - eventSource: 'ssm.amazonaws.com'
28 - eventName: 'RegisterManagedInstance'
29 - sourceIPAddress: 'AWS Internal'
30 condition: selection and not 1 of filter_main_*
31falsepositives:
32 - A team has configured an EC2 instance to use instance profiles that grant the option for the EC2 instance to talk to other AWS Services
33level: high
References
Related rules
- AWS Key Pair Import Activity
- AWS Suspicious SAML Activity
- Account Created And Deleted Within A Close Time Frame
- Admin User Remote Logon
- Authentications To Important Apps Using Single Factor Authentication