You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Tuning] First Occurrence of STS GetFederationToken Request by User (#5007)
Rule is executing as expected, however it is alerting on failed requests. Low alert telemetry.
This tuning:
- removed markdown and edited description to be more specific
- reduced execution window for 1 min lookback
- name change to add `AWS` consistent with all other rules
- added references that reflect in the wild threats and persistence usage
- increased risk_score and severity to medium accounting for usage as persistence mechanism in the wild
- added Persistence tag and Mitre tactic, technique, subtechnique
- added `event.outcome: success` criteria to query
- edited investigation guide to be more accurate reflection of steps required for investigating alert, including appropriate response action
- added highlighted fields
** Note: only IAMUser and Root user identities can call this actions so we can use `aws.cloudtrail.user_identity.arn` as the new terms field without worrying about Role vs Role + Session issue seen with other new_terms rules
(cherry picked from commit 590cc9c)
Copy file name to clipboardExpand all lines: rules/integrations/aws/defense_evasion_sts_get_federation_token.toml
+55-22Lines changed: 55 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -2,60 +2,62 @@
2
2
creation_date = "2024/08/19"
3
3
integration = ["aws"]
4
4
maturity = "production"
5
-
updated_date = "2025/01/15"
5
+
updated_date = "2025/08/25"
6
6
7
7
[rule]
8
8
author = ["Elastic"]
9
9
description = """
10
-
Identifies the first occurrence of an AWS Security Token Service (STS) `GetFederationToken` request made by a user
11
-
within the last 10 days. The `GetFederationToken` API call allows users to request temporary security credentials to
12
-
access AWS resources. Adversaries may use this API to obtain temporary credentials to access resources they would not
13
-
normally have access to.
10
+
Identifies the first occurrence of an AWS Security Token Service (STS) GetFederationToken request made by a user. The GetFederationToken API call allows users to request temporary security credentials to
11
+
access AWS resources. The maximum expiration period for these tokens is 36 hours and they can be used to create a console signin token even for identities that don't already have one. Adversaries may use this API to obtain temporary credentials for persistence and to bypass IAM API call limitations by gaining console access.
14
12
"""
15
-
from = "now-9m"
13
+
from = "now-6m"
16
14
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
17
15
language = "kuery"
18
16
license = "Elastic License v2"
19
-
name = "First Occurrence of STS GetFederationToken Request by User"
17
+
name = "AWS First Occurrence of STS GetFederationToken Request by User"
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
47
49
48
-
### Investigating First Occurrence of STS GetFederationToken Request by User
50
+
### Investigating AWS First Occurrence of STS GetFederationToken Request by User
49
51
50
-
AWS Security Token Service (STS) enables users to request temporary credentials for accessing AWS resources. While beneficial for legitimate use, adversaries may exploit this to gain unauthorized access. The detection rule identifies unusual activity by flagging the first instance of a `GetFederationToken` request by a user within a 10-day window, helping to uncover potential misuse aimed at evading defenses.
52
+
AWS Security Token Service (STS) enables users to request temporary credentials for accessing AWS resources. While beneficial for legitimate use, adversaries may exploit this to gain unauthorized access. These credentials will remain active for the duration specified (maximum 36 hours), even if the initial compromised identity is deleted. They can also be used to request a console signin token which allows the adversary to make sensitive IAM API calls which would otherwise be denied with the federation token alone. The detection rule identifies unusual activity by flagging the first instance of a `GetFederationToken` request by a user helping to uncover potential misuse aimed at evading defenses and gaining persistence.
51
53
52
54
### Possible investigation steps
53
55
54
-
- Review the specific user account associated with the GetFederationToken request to determine if the activity aligns with their typical behavior and role within the organization.
55
-
- Examine the AWS CloudTrail logs for additional context around the time of the GetFederationToken request, looking for any other unusual or suspicious activities by the same user or related accounts.
56
-
- Check the source IP address and geolocation of the GetFederationToken request to identify if it originates from an expected or unexpected location.
57
-
- Investigate the resources accessed using the temporary credentials obtained from the GetFederationToken request to assess if there was any unauthorized or suspicious access.
58
-
- Consult with the user or their manager to verify if the GetFederationToken request was legitimate and necessary for their work tasks.
56
+
- Review the specific user account associated with the `GetFederationToken` request to determine if the activity aligns with their typical behavior and role within the organization.
57
+
- Examine the AWS CloudTrail logs for additional context around the time of the `GetFederationToken` request, looking for any other unusual or suspicious activities by the same user or related accounts.
58
+
- Check the `source.ip` and `source.geo` fields of the request to identify if it originates from an expected or unexpected location.
59
+
- View the `aws.cloudtrail.response_elements` to find the created `federatedUser.arn`. Investigate the resources accessed by this Federated User to assess if there was any suspicious activity.
60
+
- Consult with the requesting user `aws.cloudtrail.user_identity.arn` to verify if the `GetFederationToken` request was legitimate and necessary for their work tasks.
59
61
60
62
### False positive analysis
61
63
@@ -66,14 +68,29 @@ AWS Security Token Service (STS) enables users to request temporary credentials
66
68
67
69
### Response and remediation
68
70
69
-
- Immediately revoke the temporary credentials associated with the `GetFederationToken` request to prevent unauthorized access to AWS resources.
70
-
- Review CloudTrail logs to identify any suspicious activities performed using the temporary credentials and assess the potential impact on AWS resources.
71
-
- Isolate the affected user account by disabling it temporarily to prevent further unauthorized actions until a thorough investigation is completed.
71
+
- If compromise is verified, attach a policy that denies all actions, effectively preventing any further activity, even from temporary credentials. You can use the AWS-managed policy [AWSDenyAll](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSDenyAll.html). This ensures that any temporary credentials generated by the compromised user are also blocked, stopping the attacker’s activities.
72
72
- Notify the security team and relevant stakeholders about the incident for awareness and further investigation.
73
73
- Conduct a root cause analysis to determine how the `GetFederationToken` request was initiated and identify any potential security gaps or misconfigurations.
74
74
- Implement additional monitoring and alerting for `GetFederationToken` requests to detect and respond to similar activities promptly in the future.
75
75
- Review and update IAM policies and permissions to ensure that only authorized users have the ability to request temporary credentials, reducing the risk of misuse."""
0 commit comments