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 Console Login via Assumed Role #3922

Closed imays11 closed 2 months ago

imays11 commented 2 months ago

Issue link(s):

Summary - What I changed

Identifies a successful console login activity by an EC2 instance profile using an assumed role. This is uncommon behavior and could indicate an attacker using compromised credentials to further exploit an environment. 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 and a successful ConsoleLogin or GetSigninToken API call.

--

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 11 02 22 PM

Checklist

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