-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Rule] First Occurrence of User Identity Retrieving Credentials from EC2 Instance with an Assumed Role #3586
[New Rule] First Occurrence of User Identity Retrieving Credentials from EC2 Instance with an Assumed Role #3586
Conversation
First Occurrence of User Identity Sending Requests to EC2 Instance
Change description to focus on Administrator password for EC2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice rule!
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
…c2_instance.toml Co-authored-by: Isai <[email protected]>
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
type = "new_terms" | ||
|
||
query = ''' | ||
event.dataset: aws.cloudtrail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetPasswordData
with aws.cloudtrail.error_code:"Client.UnauthorizedOperation"
looks more suspicious but may fit in a different rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point. The tricky part with only signaling on unauthorized activity is the nature of adversaries leveraging valid accounts to conduct their TTPs. Always have to find a balance. I think in this case, with the Assumed Role we may catch an opportunist attempting to survey EC2 instances for credential access. Added to the logic!
…c2_instance.toml Co-authored-by: Samirbous <[email protected]>
…c2_instance.toml Co-authored-by: Samirbous <[email protected]>
…c2_instance.toml Co-authored-by: Samirbous <[email protected]>
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml
Outdated
Show resolved
Hide resolved
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
…rom EC2 Instance with an Assumed Role (#3586) * new rule 'First Occurrence of User Identity Sending Requests to EC2 Instance' * updated description and name * added investigation guide; adjusted description * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Isai <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml Co-authored-by: Samirbous <[email protected]> * updated query logic * fixed spacing issue * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml * Update rules/integrations/aws/credential_access_aws_getpassword_for_ec2_instance.toml --------- Co-authored-by: Isai <[email protected]> Co-authored-by: Samirbous <[email protected]> (cherry picked from commit 38e0f13)
Issues
Summary
Identifies the first occurrence of a user identity in AWS using
GetPassword
for the administrator password of an EC2 instance with an assumed role. Adversaries may use this API call to escalate privileges or move laterally within EC2 instances.This is a New Terms rule, which means it will only trigger once for each unique value of the
aws.cloudtrail.user_identity.session_context.session_issuer.arn
field that has not beein seen making this API request within the last 7 days. This field contains the Amazon Resource Name (ARN) of the assumed role that triggered the API call.API Reference: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html
Example Data