elastic / detection-rules

https://www.elastic.co/guide/en/security/current/detection-engine-overview.html
Other
1.92k stars 492 forks source link

[New Rule] AWS EC2 Instance Interaction with IAM Service #3920

Closed imays11 closed 2 months ago

imays11 commented 2 months ago

Issue link(s):

Summary - What I changed

Identifies when an EC2 instance interacts with the AWS IAM service via an assumed role. This is uncommon behavior and could indicate an attacker using compromised creadentials to further exploit an environment. For example, an assumed role could be used to create new users for persistence or add permissions for privilege escalation. An EC2 instance assumes a role using their EC2 id as the session name. This rule looks for the pattern "i-" which is the beginning pattern for assumed role sessions started by an EC2 instance.

--

I chose to use the user.id field over the aws.cloudtrail.user_identity.arn because this field is able to be ingested via telemtry as PII has been stripped but the session name necessary to identify the identity as an EC2 instance is still included

Screenshot 2024-07-24 at 5 29 28 AM
protectionsmachine commented 2 months ago

Rule: New - Guidelines

These guidelines serve as a reminder set of considerations when proposing a new rule.

Documentation and Context

Rule Metadata Checks

New BBR Rules

Testing and Validation