Skip to content
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 Hunt] Adding Hunting Query for AWS IAM Unusual AWS Access Key Usage for User #4280

Merged
merged 7 commits into from
Dec 12, 2024

Conversation

terrancedejesus
Copy link
Contributor

@terrancedejesus terrancedejesus commented Dec 3, 2024

Pull Request

Issue link(s):

Summary - What I changed

Adds new hunting query for unusual and infrequent occurrences for AWS access key usage for IAM users and roles. This hunting query can be used to identify potentially compromised credentials or temporary credential abuse in AWS.

We encourage users to filter additionally on aws.cloudtrail.user_identity.arn to whitelist known IAM roles and users. Additionally, we encourage users to add filters for event.action if they would like to ignore specific events or event types.

How To Test

Screenshot 2024-12-03 at 12 29 54 PM

Checklist

  • Added a label for the type of pr: bug, enhancement, schema, maintenance, Rule: New, Rule: Deprecation, Rule: Tuning, Hunt: New, or Hunt: Tuning so guidelines can be generated
  • Added the meta:rapid-merge label if planning to merge within 24 hours
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

Contributor checklist

@terrancedejesus terrancedejesus added Integration: AWS AWS related rules Domain: Cloud Hunt: New threat hunting Related to hunting/ library. labels Dec 3, 2024
@terrancedejesus terrancedejesus self-assigned this Dec 3, 2024
@protectionsmachine
Copy link
Collaborator

Hunt: New - Guidelines

Welcome to the hunting folder within the detection-rules repository! This directory houses a curated collection of threat hunting queries designed to enhance security monitoring and threat detection capabilities using the Elastic Stack.

Documentation and Context

  • Detailed description of the Hunt.
  • Link related issues or PRs.
  • Include references.
  • Field Usage: Ensure standardized fields for compatibility across different data environments and sources.

Hunt Metadata Checks

  • author: The name of the individual or organization authoring the rule.
  • uuid: Unique UUID.
  • name and description are descriptive and typo-free.
  • language: The query language(s) used in the rule, such as KQL, EQL, ES|QL, OsQuery, or YARA.
  • query is inclusive, not overly exclusive, considering performance for diverse environments.
  • integration aligns with the index. Ensure updates if the integration is newly introduced.
  • notes includes additional information regarding data collected from the hunting query.
  • mitre matches appropriate technique and sub-technique IDs that hunting query collect's data for.
  • references are valid URL links that include information relevenat to the hunt or threat.
  • license

Testing and Validation

  • Evidence of testing and valid query usage.
  • Markdown Generated: Run python -m hunting generate-markdown with specific parameters to ensure a markdown version of the hunting TOML files is created.
  • Index Refreshed: Run python -m hunting refresh-index to refresh indexes.
  • Run Unit Tests: Run pytest tests/test_hunt_data.py to run unit tests.

@botelastic botelastic bot added the Hunting label Dec 4, 2024
Copy link
Contributor

@eric-forte-elastic eric-forte-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Manual review, looks good to me! 👍

@terrancedejesus terrancedejesus merged commit 28ffebb into main Dec 12, 2024
12 checks passed
@terrancedejesus terrancedejesus deleted the new-hunt-aws-iam-unusual-access-key-usage branch December 12, 2024 19:56
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
protectionsmachine pushed a commit that referenced this pull request Dec 12, 2024
…sage for User` (#4280)

* new hunt 'AWS IAM Unusual AWS Access Key Usage for User'

* updated version

* updating markdown

* bumping version

---------

Co-authored-by: shashank-elastic <[email protected]>

(cherry picked from commit 28ffebb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants