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 Rule] AWS GetCallerIdentity API Called for the First Time #3711

Conversation

imays11
Copy link
Contributor

@imays11 imays11 commented May 25, 2024

Issues

Summary

Identifies the use of sts:GetCallerIdentity API function. This is equivalent to whoami in linux and provides the caller with the user identity information for the set of credentials being used. A legitimate user would likely not need to make this call as they know who they are, and this is especially suspicious behavior coming from a service like Lambda or an EC2 instance role. GetCallerIdentity does not require any permissions as it returns the same information even when explicit deny policies are in place that deny access to the API. For this reason I've decided not to include event.outcome: success as part of the query.

This is a new_terms rule as some operations may need to call the GetCallerIdentity function as part of their authorization process. For example, an AWS EKS token, the authentication token used when communicating with the Kubernetes API server, includes a pre-signed AWS API request for sts:GetCallerIdentity which allows the aws-iam-authenticator to determine the AWS Identity and attached permissions for each request.

Screenshot GetCallerIdentity

Contributor checklist

@imays11 imays11 added Integration: AWS AWS related rules Domain: Cloud Rule: New Proposal for new rule labels May 25, 2024
@imays11 imays11 self-assigned this May 25, 2024
@imays11 imays11 requested a review from w0rk3r May 29, 2024 03:52
Copy link
Contributor

@terrancedejesus terrancedejesus left a comment

Choose a reason for hiding this comment

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

Added some suggestions for this rule. Once fixed, LGTM!

imays11 and others added 2 commits May 30, 2024 13:27
name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
@imays11 imays11 merged commit 23ce41d into main May 31, 2024
9 checks passed
@imays11 imays11 deleted the new-rule-AWS-GetCallerIdentity-API-Called-By-User-for-the-First-Time branch May 31, 2024 21:55
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

(cherry picked from commit 23ce41d)
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

(cherry picked from commit 23ce41d)
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

(cherry picked from commit 23ce41d)
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

(cherry picked from commit 23ce41d)
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

(cherry picked from commit 23ce41d)
protectionsmachine pushed a commit that referenced this pull request May 31, 2024
* [New Rule] AWS GetCallerIdentity API Called for the First Time

issue

* Apply suggestions from code review

name change, false positive additions, remove Setup, change new_terms window from 15d to 10d

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

* Update rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

fixed missing closing quotes

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>

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

Successfully merging this pull request may close these issues.

3 participants