1. Resources
  2. Detection rules
  3. Access Key Created for Another IAM User

Access Key Created for Another IAM User detection rules

An attacker with iam:CreateAccessKey creates a long-lived access key for a different, often more privileged, IAM user and uses it as a backdoor that survives password resets.

Platform
AWS
Severity
High
Log source
AWS CloudTrail
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
Credentials for a principal allowed to call iam:CreateAccessKey on the target user, and a target IAM user with fewer than two existing access keys.
Impact
Long-term programmatic access with the target user's permissions, which is full account compromise if the target is an administrator.
Response
Set the new access key to inactive, deny the sessions that were opened with it, and contain the principal that created the key.
Mitigation
Restrict iam:CreateAccessKey to the caller's own user and to break-glass roles, and prefer roles with temporary credentials over IAM users with access keys.
CloudTrail events
UpdateAccessKeyCreateAccessKey
Threat groups
Storm-0501

How the attack works

IAM users can have up to two access keys. A principal allowed to call iam:CreateAccessKey on other users (directly, through iam:*, or through a broad managed policy) can mint a new key for any of them and act as that user from anywhere, with no MFA and no console sign-in.

Attackers use this to escalate (creating a key for an administrator) or to persist (adding a second key to a user that already has one, so the legitimate key keeps working and nothing breaks). In CloudTrail the call shows who made it (userIdentity) and whose key was created (requestParameters.userName). A quieter variant needs no new key at all, because UpdateAccessKey can set an inactive key of the user back to active, and a credential that everyone believed retired works again.

What an attacker needs

  • Credentials for a principal allowed to call iam:CreateAccessKey on the target user.
  • A target IAM user with fewer than two existing access keys.

Impact

Long-term programmatic access with the target user's permissions. If the target is an administrator, the result is full account compromise; even unprivileged keys give a durable foothold that is easy to miss among existing keys.

Detection rules

IAM Access Key Status Changed for a Named User

Detects UpdateAccessKey calls that name a target user. UpdateAccessKey changes the status of an existing access key, and the IAM API reference gives Active and Inactive as the values: a call that sets an inactive key back to Active revives a credential that was believed retired, without a new key appearing in the account. The Threat Technique Catalog for AWS lists UpdateAccessKey next to CreateAccessKey under additional cloud credentials. The rule does not read the new status, because AWS publishes no example record that shows where the event carries it: read the request parameters, and compare the caller (userIdentity.arn) with requestParameters.userName. A call without a user name in the request is not matched. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: IAM Access Key Status Changed for a Named User
id: 47fa0075-124f-4ba7-b9f7-c62ca40f502b
status: experimental
description: >-
  Detects UpdateAccessKey calls that name a target user. UpdateAccessKey
  changes the status of an existing access key, and the IAM API reference
  gives Active and Inactive as the values: a call that sets an inactive key
  back to Active revives a credential that was believed retired, without a
  new key appearing in the account. The Threat Technique Catalog for AWS
  lists UpdateAccessKey next to CreateAccessKey under additional cloud
  credentials. The rule does not read the new status, because AWS publishes
  no example record that shows where the event carries it: read the request
  parameters, and compare the caller (userIdentity.arn) with
  requestParameters.userName. A call without a user name in the request is
  not matched.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAccessKey.html
  - https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1098.001.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: UpdateAccessKey
    requestParameters.userName|exists: true
  condition: selection
falsepositives:
  - Key rotation by administrators and rotation automation, which sets the old key to inactive before deleting it. Add the rotation roles to a filter_* selection on userIdentity.arn.
  - Containment of an exposed key by the response team, and reactivation of a key that was switched off by mistake.
level: low

False positives

  • Key rotation by administrators and rotation automation, which sets the old key to inactive before deleting it. Add the rotation roles to a filter_* selection on userIdentity.arn.
  • Containment of an exposed key by the response team, and reactivation of a key that was switched off by mistake.

IAM Access Key Created for a Named User

Detects CreateAccessKey calls that name a target user. Triage by comparing the caller (userIdentity.arn) with requestParameters.userName: keys created for someone else are the escalation and persistence pattern. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM Access Key Created for a Named User
id: ded59287-4409-456b-8283-0598877d99fb
status: experimental
description: >-
  Detects CreateAccessKey calls that name a target user. Triage by comparing
  the caller (userIdentity.arn) with requestParameters.userName: keys created
  for someone else are the escalation and persistence pattern.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-10
tags:
  - attack.persistence
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: CreateAccessKey
    requestParameters.userName|exists: true
  condition: selection
falsepositives:
  - Administrators provisioning keys for service users, and identity automation; allow-list the automation roles.
level: medium

False positives

  • Administrators provisioning keys for service users, and identity automation; allow-list the automation roles.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Inactive access key set back to active and used again

Detection hypothesisCompares with an earlier valueSequence of events

Old keys are set to inactive during rotation and then forgotten. An attacker who holds such a key and can call UpdateAccessKey switches it back on and uses it, and no new credential appears in the account. The reactivation matters together with the use that follows it.

  1. An UpdateAccessKey event from iam.amazonaws.com whose request sets the Status parameter to Active. Note the AccessKeyId and UserName parameters of the request and the caller in userIdentity.arn.
  2. Look back for the earlier UpdateAccessKey call that set the same key to Inactive. The longer the key was inactive, the less likely the reactivation is routine.
  3. After the reactivation, collect the events whose userIdentity.accessKeyId is that key and compare sourceIPAddress and userAgent with the last use before the key was switched off.

EventsUpdateAccessKey

LimitsA rotation that is rolled back because an application still needed the old key looks the same, although its use continues from the known address. AWS publishes no example record of UpdateAccessKey, so check on one of your own events where the status and the key ID appear before you build the search.

New access key used from an address the user never used

Detection hypothesisSequence of eventsNeeds a baseline

A key that an administrator creates for a service user goes into the configuration of that service and is used from its hosts. A key that an attacker creates for someone else is used within minutes, from the address of the attacker, which the owner of the key has never called from.

  1. A CreateAccessKey event from iam.amazonaws.com with a user in requestParameters.userName. Note the AccessKeyId of the new key, which the call returns in its response.
  2. Within 60 minutes, collect the events whose userIdentity.accessKeyId is the new key, with sourceIPAddress and userAgent.
  3. Compare the source address with the addresses that the other keys and the console sessions of that user (userIdentity.userName) used in the weeks before, and alert when it is new.

EventsCreateAccessKey

LimitsA new service or a new host that receives its first key has no history either, so the comparison needs the context of who created the key. The 60 minutes are a starting point. AWS publishes no example record of CreateAccessKey, so check on one of your own events where the new key ID appears.

Triage

  • Compare the caller (userIdentity.arn) with the key owner (requestParameters.userName); a key created for someone else is the strongest signal.
  • Check the source IP address and user agent against normal automation.
  • Deactivate unexplained keys immediately and review CloudTrail for their use.

Response

Once the attack is confirmed:

  1. Set the new access key to inactive, together with any other key the same caller created in that period. Deactivation stops API calls signed with the key and can be undone; delete the keys once you have reviewed what they were used for.
  2. Deny the sessions that were opened with the key. Temporary credentials requested with it, for example through GetSessionToken or GetFederationToken, stay valid until they expire, so attach a policy to the target user that denies requests made with credentials issued before the time of containment (condition key aws:TokenIssueTime).
  3. Contain the caller. Deactivate the access keys of the principal that created the key, or revoke its sessions if it is a role, because it can create another key for as long as it keeps iam:CreateAccessKey on other users.
  4. Review what the target user did with the new key and undo it, with priority on new users, roles, access keys, login profiles and policy changes.
  5. Check the keys of the other privileged users in the account for keys that nobody owns, and confirm in CloudTrail that the deactivated key is no longer used.

Mitigation

  • Prefer IAM Identity Center and roles with temporary credentials; minimize IAM users with access keys.
  • Restrict iam:CreateAccessKey to self-service on the caller's own user (Resource arn:aws:iam::*:user/${aws:username}) and to break-glass roles.
  • Remove unused and duplicate keys, rotate the rest, and alert on key creation for privileged users.

Frequently asked questions

Does the rule fire only when the key is created for a different user?

No. It matches every `CreateAccessKey` call that names a user in `requestParameters.userName`, whoever made the call. The rule does not compare the caller with the key owner, so a provisioning role and an attacker produce the same alert. Make that comparison in triage or in a SIEM filter, and note that a call without a user name in the request is not matched.

Why does a password reset on the target user not remove a key created this way?

An access key is a separate long-term credential. Requests signed with it do not go through the console sign-in, so the password of the user and the MFA device used at sign-in play no part. The key keeps working until it is set to inactive or deleted, which is why attackers use it as a backdoor that survives password resets.

What does a harmless CreateAccessKey event look like?

Administrators provisioning a key for a service user and identity automation produce the same event, from roles and networks you know. Look closer when the key is for a privileged user, when it is a second key on a user that already has one, or when the caller has never managed keys before. A second key lets the legitimate key keep working, so nothing breaks and nobody notices.

Does the rule also show attempts that were denied?

Yes. It matches the call whether it succeeded or not, and a failed call carries an errorCode. A denied attempt to create a key for another user means that someone tested the permission. No key exists in that case, but the caller and its source address are worth reviewing.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.