-
Notifications
You must be signed in to change notification settings - Fork 529
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] AWS STS AssumeRole with New MFA Device [Rule Tuning] AWS IAM Deactivation of MFA Device #4210
Conversation
…IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device"
Rule: New - GuidelinesThese 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
|
1 similar comment
Rule: New - GuidelinesThese 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
|
query = ''' | ||
event.dataset:aws.cloudtrail | ||
and event.provider:sts.amazonaws.com | ||
and event.action:AssumeRole* |
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.
Why do we use a wildcard in an event.action
statement?
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.
@Aegrah to capture AssumeRole
, AssumeRoleWithSAML
and AssumeRoleWithWebIdentity
. I could just explicitly call these out and change to an OR statement if that would be better
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.
Then I would suggest adding event.action:(AssumeRole or AssumeRoleWithSAML or AssumeRoleWithWebIdentity)
to enhance rule performance.
rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml
Outdated
Show resolved
Hide resolved
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
…AM Deactivation of MFA Device (#4210) * [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
Pull Request
Issue link(s):
Summary - What I changed
This PR creates a new rule to identify when a user has assumed a role using a new MFA device. Users can assume a role to obtain temporary credentials and access AWS resources using the AssumeRole API of AWS Security Token Service (STS).
While a new MFA device is not always indicative of malicious behavior it should be verified as adversaries can use this technique for persistence and privilege escalation.
This PR also adds the proper MITRE technique to existing rule "AWS IAM Deactivation of MFA Device"
How To Test
Screenshot of working query
You can use the Cloudgoat Scenario: iam_privesc_by_key_rotation to test this rule. Part of the attack chain is for a user to add a new MFA device to a compromised user before assuming a role for privilege escalation.
Checklist
bug
,enhancement
,schema
,Rule: New
,Rule: Deprecation
,Rule: Tuning
,Hunt: New
, orHunt: Tuning
so guidelines can be generated