How the attack works
AWS STS GetFederationToken returns temporary security credentials for a federated user session. It was built for identity brokers, which is why it can only be called with the long-term credentials of an IAM user (or of the root user, which AWS advises against). The session lasts up to 36 hours, and its permissions are the intersection of the calling user's policies and the session policies passed in the call.
For an attacker who holds a stolen access key, the call is a way to keep access after the key is gone. Temporary credentials stay valid until they expire, and rotating or deleting the access key that requested them does not end the session. A federated user session cannot call the IAM API from the command line or an SDK, but AWS documents that this limit does not apply to console sessions.
That is where the second step comes in. The AWS federation endpoint accepts temporary credentials and returns a sign-in token, and a URL built with that token opens the AWS Management Console as the session, with no console password and no MFA device of the IAM user involved. The same exchange works with the credentials of an assumed role, so an API foothold on a workload can become an interactive console session too.
CloudTrail records each step. GetFederationToken appears under sts.amazonaws.com with the calling IAM user in userIdentity. The token exchange appears as GetSigninToken under signin.amazonaws.com, and the sign-in as ConsoleLogin. Requests made with federation token credentials carry userIdentity.type FederatedUser, and sessionContext.sessionIssuer names the IAM user behind the session.
What an attacker needs
- The access key of an IAM user (or of the root user) that is allowed sts:GetFederationToken, usually through a wildcard such as sts:* or an administrator policy.
- For the console step alone, any temporary credentials that the federation endpoint accepts, for example those of an assumed role.
Impact
Access that survives the first containment step. Deactivating or deleting the stolen access key leaves the federated session working until it expires, up to 36 hours later. Through the console the session can use IAM, which federation token credentials cannot do over the API, so the attacker can go on to create users, keys or roles with whatever the IAM user is allowed to do. A session started with root user credentials lasts one hour at most, but its permissions cannot be changed during that time.
Detection rules
AWS Console Sign-in by a Federated User Session
Detects ConsoleLogin events whose identity type is FederatedUser. CloudTrail uses that type for requests made with temporary credentials from GetFederationToken, so the event means that a federation token of an IAM user (or of the root user) was turned into a console session. Sign-ins that federate through a role (SAML, OIDC, IAM Identity Center, a broker that calls AssumeRole) are recorded with the type AssumedRole and do not match. Check userIdentity.sessionContext.sessionIssuer for the IAM user behind the session. The rule also matches sign-ins that failed: the outcome is in responseElements.ConsoleLogin.
title: AWS Console Sign-in by a Federated User Session
id: f605fff9-6d30-452b-9e64-92a23f8d88ed
status: experimental
description: >-
Detects ConsoleLogin events whose identity type is FederatedUser. CloudTrail
uses that type for requests made with temporary credentials from
GetFederationToken, so the event means that a federation token of an IAM
user (or of the root user) was turned into a console session. Sign-ins that
federate through a role (SAML, OIDC, IAM Identity Center, a broker that
calls AssumeRole) are recorded with the type AssumedRole and do not match.
Check userIdentity.sessionContext.sessionIssuer for the IAM user behind the
session. The rule also matches sign-ins that failed: the outcome is in
responseElements.ConsoleLogin.
references:
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-aws-console-sign-in-events.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
- https://attack.mitre.org/techniques/T1550/001/
author: Forestall
date: 2026-11-14
tags:
- attack.lateral-movement
- attack.t1550.001
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: signin.amazonaws.com
eventName: ConsoleLogin
userIdentity.type: FederatedUser
condition: selection
falsepositives:
- A custom identity broker that still obtains console credentials with GetFederationToken (AWS recommends AssumeRole for this). Its sessions come from one known IAM user; add a filter_* selection on userIdentity.sessionContext.sessionIssuer.arn for that user.
level: medium
False positives
- A custom identity broker that still obtains console credentials with GetFederationToken (AWS recommends AssumeRole for this). Its sessions come from one known IAM user; add a filter_* selection on userIdentity.sessionContext.sessionIssuer.arn for that user.
AWS Console Sign-in Token Requested With Temporary Credentials
Detects GetSigninToken events from AWS Sign-In. CloudTrail records the event when temporary security credentials are sent to the AWS federation endpoint in exchange for a sign-in token, the step that turns API credentials into a console session. Every console sign-in that goes through the federation endpoint produces the event, so on its own it is a low-level signal that needs a baseline. Review requests for roles and users that do not normally reach the console this way (userIdentity.arn, and userIdentity.sessionContext.sessionIssuer for the role or IAM user behind the session), for workload roles, and from unfamiliar source IP addresses or user agents. The outcome is in responseElements.GetSigninToken.
title: AWS Console Sign-in Token Requested With Temporary Credentials
id: d932ae95-d1de-4c1a-a24b-d7b96ef7f323
status: experimental
description: >-
Detects GetSigninToken events from AWS Sign-In. CloudTrail records the event
when temporary security credentials are sent to the AWS federation endpoint
in exchange for a sign-in token, the step that turns API credentials into a
console session. Every console sign-in that goes through the federation
endpoint produces the event, so on its own it is a low-level signal that
needs a baseline. Review requests for roles and users that do not normally
reach the console this way (userIdentity.arn, and
userIdentity.sessionContext.sessionIssuer for the role or IAM user behind
the session), for workload roles, and from unfamiliar source IP addresses or
user agents. The outcome is in responseElements.GetSigninToken.
references:
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-aws-console-sign-in-events.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
- https://attack.mitre.org/techniques/T1550/001/
author: Forestall
date: 2026-11-14
tags:
- attack.lateral-movement
- attack.t1550.001
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: signin.amazonaws.com
eventName: GetSigninToken
condition: selection
falsepositives:
- Identity brokers, sign-in portals and command-line tools that open the console from temporary credentials. Baseline the roles, source networks and user agents that do this in your accounts and add them to filter_* selections on userIdentity.arn, sourceIPAddress or userAgent.
level: low
False positives
- Identity brokers, sign-in portals and command-line tools that open the console from temporary credentials. Baseline the roles, source networks and user agents that do this in your accounts and add them to filter_* selections on userIdentity.arn, sourceIPAddress or userAgent.
AWS STS Federation Token Requested
Detects GetFederationToken calls to AWS STS. The call can only be made with the long-term credentials of an IAM user or of the root user, and it returns temporary credentials for a federated user session of up to 36 hours. The session stays valid when the access key that requested it is deactivated or deleted. Only identity brokers have a routine reason to make the call: triage by the caller (userIdentity.arn and userIdentity.accessKeyId), the source IP address, and the session name, duration and policies in requestParameters. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: AWS STS Federation Token Requested
id: 8401d037-4e3d-4716-b590-ae9bc00f2218
status: experimental
description: >-
Detects GetFederationToken calls to AWS STS. The call can only be made with
the long-term credentials of an IAM user or of the root user, and it returns
temporary credentials for a federated user session of up to 36 hours. The
session stays valid when the access key that requested it is deactivated or
deleted. Only identity brokers have a routine reason to make the call:
triage by the caller (userIdentity.arn and userIdentity.accessKeyId), the
source IP address, and the session name, duration and policies in
requestParameters.
It also matches attempts that failed (errorCode present): check errorCode,
because an unauthorized attempt is worth seeing.
references:
- https://docs.aws.amazon.com/STS/latest/APIReference/API_GetFederationToken.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
- https://attack.mitre.org/techniques/T1550/001/
author: Forestall
date: 2026-11-14
tags:
- attack.lateral-movement
- attack.t1550.001
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: sts.amazonaws.com
eventName: GetFederationToken
condition: selection
falsepositives:
- A custom identity broker or proxy application that federates its users with GetFederationToken. It calls from one known IAM user and network; add that user to a filter_* selection on userIdentity.arn and keep alerting on every other caller.
level: medium
False positives
- A custom identity broker or proxy application that federates its users with GetFederationToken. It calls from one known IAM user and network; add that user to a filter_* selection on userIdentity.arn and keep alerting on every other caller.
Triage
- For GetFederationToken, identify the caller (userIdentity.arn and userIdentity.accessKeyId) and check whether that IAM user is a known identity broker. An access key of a person or a workload requesting a federation token is the key signal.
- Read the request parameters for the session name, the duration and the session policies. A long duration with an administrator policy is not what a broker asks for.
- Compare the source IP address and user agent with the history of the IAM user, and check whether its access key was reported as exposed or was deactivated shortly before or after.
- Follow the session. Search for events whose userIdentity.type is FederatedUser and whose sessionContext.sessionIssuer names the calling user, then for GetSigninToken and ConsoleLogin events from the same session.
- For GetSigninToken and ConsoleLogin, decide whether the role or user normally reaches the console through a broker. A console session for a workload role, or for an IAM user that has no console password, needs an explanation.
- If the session is not explained, deny it on the IAM user with an aws:TokenIssueTime condition or a deny-all policy, deactivate the access key and review everything the session did.
Response
Once the attack is confirmed:
- Stop the session before the key. Put a policy on the IAM user behind the session that denies all actions for credentials issued before now, and keep it for 36 hours, the longest a federated user session can last.
- Then deactivate the access key that requested the token, give the workload that owns it a new key, and delete the old key after the review.
- If the token was requested with root user credentials, its permissions cannot be changed. Delete the root access key and follow everything the session does until it ends, which is after one hour at most.
- Review what the session did in the console, where it could use IAM, and remove the users, access keys, roles and policies it created.
- If the console session came from the credentials of an assumed role and not from a federation token, revoke the active sessions of that role and find out how its credentials left the workload.
Mitigation
- Do not grant sts:GetFederationToken to IAM users. Where no identity broker needs it, deny the action with a service control policy.
- Replace IAM user access keys with roles and IAM Identity Center, so that few long-term keys are left to steal, and rotate or remove the ones that remain.
- Delete root user access keys, so that nobody can request a federation token as root.
- Treat a stolen access key as a stolen session too. After deactivating the key, attach a policy to the IAM user that denies all actions for credentials issued before the current time (condition key aws:TokenIssueTime), or a deny-all policy for 36 hours. Session permissions are evaluated on every request, so the denial applies to sessions that already exist.
- Collect CloudTrail management events from every Region. AWS STS and sign-in events are recorded in the Region of the endpoint that served the request.
Frequently asked questions
Does deleting the stolen access key end a federated user session?
No. Temporary credentials stay valid until they expire, and rotating or deleting the access key that requested them does not end the session, which can last up to 36 hours. Session permissions are evaluated on every request, so a policy on the IAM user that denies credentials issued before the current time is what stops the session.
Why does a normal SAML or IAM Identity Center sign-in not trigger the ConsoleLogin rule?
Those sign-ins federate through a role, and CloudTrail records them with the identity type AssumedRole. The rule matches only the type FederatedUser, which CloudTrail uses for credentials from `GetFederationToken`. Sign-ins through a role can still produce `GetSigninToken` events when they go through the federation endpoint, which is why that rule is a low-level signal that needs a baseline.
Which of the three rules is the strongest signal?
The `GetFederationToken` rule. Only identity brokers have a routine reason to make the call, and the caller is always an IAM user or the root user. A console sign-in by a federated user session shows that such a token was turned into an interactive session. `GetSigninToken` fires for every sign-in through the federation endpoint and is useful mainly with a baseline of the roles that normally do it.
Can a federated user session change IAM?
Not from the command line or an SDK. AWS documents that this limit does not apply to console sessions, so once the session has been exchanged for a console sign-in it can use IAM with whatever the IAM user behind it is allowed to do. That is why the console step matters when you review what the session did.
References
- MITRE ATT&CK T1550.001: Use Alternate Authentication Material: Application Access Token
- AWS STS API Reference: GetFederationToken
- Permissions for GetFederationToken
- Enable custom identity broker access to the AWS console
- AWS Management Console sign-in events
- CloudTrail userIdentity element
- Logging IAM and AWS STS API calls with AWS CloudTrail
- Disabling permissions for temporary security credentials
- What to do if you inadvertently expose an AWS access key (AWS Security Blog)