1. Resources
  2. Detection rules
  3. Service-Specific Credential, SSH Key or Signing Certificate Added to an IAM User

Service-Specific Credential, SSH Key or Signing Certificate Added to an IAM User detection rules

An attacker with IAM write access gives an IAM user a long-term credential that access key reviews miss, such as a service-specific credential or API key, an SSH public key or an X.509 signing certificate.

Platform
AWS
Severity
Medium
Log source
AWS CloudTrail
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Permission to create or reset service-specific credentials, upload SSH public keys or upload signing certificates for a target IAM user that has access to the service.
Impact
Long-term access to one service with the target user's permissions, such as source code in CodeCommit, that survives password resets and access key rotation.
Response
Set the credential, key or certificate to inactive, then contain the principal that added it and review what was reached with it.
Mitigation
Restrict these IAM actions to the caller's own user and identity administrators, and include all three credential types in credential reviews.
CloudTrail events
CreateServiceSpecificCredentialResetServiceSpecificCredentialUploadSigningCertificateUploadSSHPublicKey
Threat groups
Storm-0501

How the attack works

An IAM user can hold more long-term credentials than a password and access keys. CreateServiceSpecificCredential generates a user name and password that work only for the service named in the request, with the permissions of the user for that service. AWS uses this credential type for Git access to CodeCommit, for Amazon Keyspaces and for the long-term API keys that some services support, and a credential created without an expiry does not expire. ResetServiceSpecificCredential issues a new password for an existing credential and invalidates the old one at once. UploadSSHPublicKey associates an SSH public key with a user for authentication to CodeCommit repositories, and UploadSigningCertificate associates an X.509 signing certificate, which is active as soon as it is uploaded.

None of these is an access key. Rules on CreateAccessKey do not match them, a console password reset does not touch them, and the IAM credential report does not list service-specific credentials at all. An attacker adds one to keep access to source code or to a service after the stolen access key is rotated, or resets an existing credential to take it over. CloudTrail records the calls under iam.amazonaws.com with the caller in userIdentity, the user in requestParameters.userName and, for a service-specific credential, the service in requestParameters.serviceName. Amazon Bedrock is one of the services with long-term API keys: such a key is a service-specific credential for bedrock.amazonaws.com, and when it is generated in the Bedrock console AWS creates a dedicated IAM user named BedrockAPIKey- plus a suffix with the AmazonBedrockLimitedAccess policy attached. A rule on this page singles these keys out, because they give direct access to model invocation at the owner's cost.

What an attacker needs

  • Credentials for a principal allowed to call iam:CreateServiceSpecificCredential, iam:ResetServiceSpecificCredential, iam:UploadSSHPublicKey or iam:UploadSigningCertificate on the target user.
  • A target IAM user that has permissions in the service the credential is for.

Impact

Long-term access to one service with the target user's permissions. For CodeCommit this is read and write access to source code, which can expose secrets in repositories and allow changes to what gets built and deployed. The credential survives a password reset and the rotation of the user's access keys.

Detection rules

Long-Term Amazon Bedrock API Key Created

Detects CreateServiceSpecificCredential calls to IAM whose service is bedrock.amazonaws.com. AWS documents that a long-term Amazon Bedrock API key is generated with CreateServiceSpecificCredential and that service name, and its Security Blog publishes an example CloudTrail record of the event: the service is in requestParameters.serviceName, the lifetime in requestParameters.credentialAgeDays, and the IAM user in requestParameters.userName (a user named BedrockAPIKey- plus a suffix when the key was generated in the Bedrock console). The key is a bearer token that calls Bedrock with the permissions of that user until it expires or is deleted, and AWS describes long-term keys as meant for exploration, not for production. A key that nobody in the organization asked for gives whoever holds it model access at the owner's cost. A reset of an existing key (ResetServiceSpecificCredential) is matched by the general rule on this page. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: Long-Term Amazon Bedrock API Key Created
id: fcb4d1c1-9d96-49b2-a59b-05d1f7acf1eb
status: experimental
description: >-
  Detects CreateServiceSpecificCredential calls to IAM whose service is
  bedrock.amazonaws.com. AWS documents that a
  long-term Amazon Bedrock API key is generated with
  CreateServiceSpecificCredential and that service name, and its Security
  Blog publishes an example CloudTrail record of the event: the service is in
  requestParameters.serviceName, the lifetime in
  requestParameters.credentialAgeDays, and the IAM user in
  requestParameters.userName (a user named BedrockAPIKey- plus a suffix when
  the key was generated in the Bedrock console). The key is a bearer token
  that calls Bedrock with the permissions of that user until it expires or
  is deleted, and AWS describes long-term keys as meant for exploration, not
  for production. A key that nobody in the organization asked for gives
  whoever holds it model access at the owner's cost. A reset of an existing
  key (ResetServiceSpecificCredential) is matched by the general rule on
  this page.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-generate.html
  - https://aws.amazon.com/blogs/security/securing-amazon-bedrock-api-keys-best-practices-for-implementation-and-management/
  - https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: CreateServiceSpecificCredential
    requestParameters.serviceName: bedrock.amazonaws.com
  condition: selection
falsepositives:
  - Developers who generate a key to try Bedrock, from the Bedrock console or the command line. Confirm each key with its owner, check its lifetime, and prefer short-term keys or roles for anything that stays.
level: medium

False positives

  • Developers who generate a key to try Bedrock, from the Bedrock console or the command line. Confirm each key with its owner, check its lifetime, and prefer short-term keys or roles for anything that stays.

IAM Service-Specific Credential Created or Reset

Detects CreateServiceSpecificCredential and ResetServiceSpecificCredential calls. The first generates a user name and password for an IAM user that work only for the service named in requestParameters.serviceName, and the second gives an existing credential a new password and invalidates the old one. Triage by comparing the caller (userIdentity.arn) with requestParameters.userName and by checking whether the user works with that service. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM Service-Specific Credential Created or Reset
id: ca647931-da0c-46a0-8103-6db75226782b
status: experimental
description: >-
  Detects CreateServiceSpecificCredential and ResetServiceSpecificCredential
  calls. The first generates a user name and password for an IAM user that
  work only for the service named in requestParameters.serviceName, and the
  second gives an existing credential a new password and invalidates the old
  one. Triage by comparing the caller (userIdentity.arn) with
  requestParameters.userName and by checking whether the user works with that
  service.
  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_CreateServiceSpecificCredential.html
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_ResetServiceSpecificCredential.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_api_keys_for_aws_services.html
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName:
      - CreateServiceSpecificCredential
      - ResetServiceSpecificCredential
  condition: selection
falsepositives:
  - Developers who create Git credentials for CodeCommit or API keys for their own user, and administrators who provision them for service users; allow-list the expected services and review credentials created for another user.
level: medium

False positives

  • Developers who create Git credentials for CodeCommit or API keys for their own user, and administrators who provision them for service users; allow-list the expected services and review credentials created for another user.

Signing Certificate Uploaded for an IAM User

Detects UploadSigningCertificate calls, which upload an X.509 signing certificate and associate it with an IAM user. The certificate is active as soon as it is uploaded, and some AWS services accept requests that are signed with the matching private key. When the request names no user, IAM takes the user from the access key that signed the request, so requestParameters.userName can be absent. An upload for a user that has never used a certificate is worth a look. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: Signing Certificate Uploaded for an IAM User
id: df56dc7a-0c2e-4974-b8bb-9742cf0ca281
status: experimental
description: >-
  Detects UploadSigningCertificate calls, which upload an X.509 signing
  certificate and associate it with an IAM user. The certificate is active as
  soon as it is uploaded, and some AWS services accept requests that are
  signed with the matching private key. When the request names no user, IAM
  takes the user from the access key that signed the request, so
  requestParameters.userName can be absent. An upload for a user that has
  never used a certificate is worth a look.
  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_UploadSigningCertificate.html
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: UploadSigningCertificate
  condition: selection
falsepositives:
  - Older tools and integrations that sign requests with X.509 certificates, and the rotation of their certificates; confirm with the owner of the user.
level: low

False positives

  • Older tools and integrations that sign requests with X.509 certificates, and the rotation of their certificates; confirm with the owner of the user.

SSH Public Key Uploaded for an IAM User

Detects UploadSSHPublicKey calls, which upload an SSH public key and associate it with an IAM user. AWS documents that such a key can be used only to authenticate the user to CodeCommit repositories, so the holder of the matching private key gets the user's access to source code. Triage by comparing the caller (userIdentity.arn) with requestParameters.userName and by checking whether the user works with CodeCommit. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: SSH Public Key Uploaded for an IAM User
id: 6ccac110-c12b-459a-b00a-ed640e4f4371
status: experimental
description: >-
  Detects UploadSSHPublicKey calls, which upload an SSH public key and
  associate it with an IAM user. AWS documents that such a key can be used
  only to authenticate the user to CodeCommit repositories, so the holder of
  the matching private key gets the user's access to source code. Triage by
  comparing the caller (userIdentity.arn) with requestParameters.userName and
  by checking whether the user works with CodeCommit.
  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_UploadSSHPublicKey.html
  - https://attack.mitre.org/techniques/T1098/001/
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.001
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: UploadSSHPublicKey
  condition: selection
falsepositives:
  - Developers who add an SSH key to their own user for CodeCommit, and onboarding automation; review keys that were uploaded for another user or in accounts that do not use CodeCommit.
level: low

False positives

  • Developers who add an SSH key to their own user for CodeCommit, and onboarding automation; review keys that were uploaded for another user or in accounts that do not use CodeCommit.

Triage

  • Compare the caller (userIdentity.arn) with requestParameters.userName. A credential added to someone else's user is the strongest signal.
  • For a service-specific credential, read requestParameters.serviceName and check whether the user has ever worked with that service.
  • Check whether the user already had a credential of this type, and whether a reset was requested by its owner.
  • Check errorCode. A failed attempt shows that someone tested the permission.
  • Review the activity of the user in the service after the credential was added.

Response

Once the attack is confirmed:

  1. Set the credential, key or certificate to inactive, and delete it once you have reviewed what it was used for.
  2. Contain the principal that added it by deactivating its access keys or revoking its role sessions, because it can add another credential for as long as it keeps the permission.
  3. Review what was reached with the credential. For CodeCommit, treat the repositories the user can read as copied, rotate the secrets they contain and review the commits pushed in that period.
  4. List the service-specific credentials, SSH public keys and signing certificates of the other users in the account, and remove those nobody owns.
  5. If an existing credential was reset, give its owner a new one and confirm that the applications using it work again.

Mitigation

  • Restrict these four IAM actions to self-service on the caller's own user and to identity administrators.
  • Deny iam:CreateServiceSpecificCredential and iam:UploadSSHPublicKey with a service control policy in accounts that do not use the services these credentials are for.
  • Set an expiry on long-term API keys, and prefer temporary credentials wherever the service supports them.
  • Include service-specific credentials, SSH public keys and signing certificates in credential reviews. The IAM credential report does not show service-specific credentials, so list them per user.
  • Remove wildcard IAM actions (iam:*) from customer managed policies so that ordinary principals cannot add credentials to other users.

Frequently asked questions

Why do access key reviews miss these credentials?

They are separate credential types with their own API calls and their own lists. AWS documents that the IAM credential report includes passwords, the first two access keys of each user, MFA devices and X.509 signing certificates, and that it does not include service-specific credentials such as CodeCommit passwords or long-term API keys. A review that reads only the report or the access keys does not see them.

Does resetting the user's password or rotating its access keys remove the credential?

No. A service-specific credential, an SSH public key and a signing certificate are each stored on the user as their own object. They stay active when the console password is reset and when access keys are deactivated or replaced. Each of them has to be set to inactive or deleted on its own.

What can a service-specific credential reach?

Only the service it was created for. AWS documents that the credential has the same permissions as the associated user, except that it can be used only to access the specified service. The damage is therefore limited to what the user may do in that service, which for a developer with access to many repositories can still be a lot.

Why does the rule on service-specific credentials also match a reset?

ResetServiceSpecificCredential gives an existing credential a new password and invalidates the previous password immediately. A principal that calls it for another user takes that credential over and locks the owner's applications out. The effect for the attacker is the same as creating a credential, so one rule matches both calls.

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.