1. Resources
  2. Detection rules
  3. IAM Roles Anywhere Trust Anchor or Profile Created

IAM Roles Anywhere Trust Anchor or Profile Created detection rules

An attacker registers a certificate authority they control as an IAM Roles Anywhere trust anchor, or adds a profile, and then gets role credentials from outside AWS with a certificate instead of a user, password or access key.

Platform
AWS
Severity
High
Log source
AWS CloudTrail
Last updated
MITRE ATT&CK technique
T1098Account Manipulation
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Permission to create an IAM Roles Anywhere trust anchor or profile, a role that trusts the service, and a certificate authority under the attacker's control.
Impact
Temporary credentials for the roles in the profile, requested from anywhere with a certificate the attacker issues, with no IAM user, password or access key involved.
Response
Disable the trust anchor and the profile first, then revoke the active sessions of every role the profile lists and every role that trusts the service without conditions.
Mitigation
Restrict the IAM Roles Anywhere write actions to a few identity administrators, and add an aws:SourceArn condition to every role that trusts the service.
CloudTrail events
ImportCrlUpdateCrlDisableCrlDeleteCrlCreateProfileCreateSessionCreateTrustAnchorUpdateTrustAnchorEnableTrustAnchorUpdateProfileEnableProfilePutAttributeMappingand 1 more in the rules below

How the attack works

IAM Roles Anywhere lets workloads outside AWS exchange an X.509 certificate for temporary credentials of an IAM role. Three objects decide who gets what. A trust anchor registers a certificate authority (CA), either an AWS Private CA or an uploaded CA certificate. A profile lists the roles that can be assumed and can limit the sessions with policies. The role itself must trust the service principal rolesanywhere.amazonaws.com in its trust policy.

A principal allowed to call rolesanywhere:CreateTrustAnchor can register a CA whose private key it holds. From then on it can issue itself certificates at will, and AWS accepts each one as a credential. AWS sets the trust boundary at the account level: certificates issued under any trust anchor in the account can be used to assume any role in that account that trusts the service, unless the trust policy of the role restricts it with conditions such as aws:SourceArn. A new profile (CreateProfile) names the roles to hand out. Where roles already trust IAM Roles Anywhere without conditions, nothing else has to change.

The result is a way back in that does not show up in a review of users, access keys or identity providers. CloudTrail records both calls under rolesanywhere.amazonaws.com, with the caller in userIdentity and the request (the CA source, or the role list of the profile) in requestParameters. The later credential requests are logged as CreateSession, and the role session name is the hex-encoded serial number of the certificate that was used. Changes to objects that already exist are logged under the same event source, among them UpdateTrustAnchor, UpdateProfile and the calls that import, disable or delete a certificate revocation list.

What an attacker needs

  • Credentials for a principal allowed rolesanywhere:CreateTrustAnchor or rolesanywhere:CreateProfile, directly or through a wildcard.
  • A role whose trust policy trusts rolesanywhere.amazonaws.com. The attacker uses one that exists, or creates or edits one (iam:CreateRole, iam:UpdateAssumeRolePolicy).
  • A certificate authority under the attacker's control, which can live anywhere outside AWS.

Impact

Temporary credentials for the roles in the profile, requested from anywhere with a certificate the attacker issues. No IAM user, password or access key is involved, so the access survives credential rotation and the removal of the identity that set it up. New sessions can be requested for as long as the trust anchor, the profile and the role trust stay in place.

Detection rules

IAM Roles Anywhere Certificate Revocation List Changed

Detects ImportCrl, UpdateCrl, DisableCrl and DeleteCrl calls to IAM Roles Anywhere. An imported certificate revocation list (CRL) tells the service which certificates must no longer be accepted. Disabling or deleting the list, or replacing it with one that leaves a certificate out, lets a revoked certificate obtain role credentials again, which undoes the containment of a stolen workload certificate. AWS documents that all IAM Roles Anywhere actions are logged. The rule matches the event names: compare the list in the request with the one your certificate authority publishes. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM Roles Anywhere Certificate Revocation List Changed
id: 8e9ff235-bbec-4c3a-a94e-85deef0a8d7c
status: experimental
description: >-
  Detects ImportCrl, UpdateCrl, DisableCrl and DeleteCrl calls to IAM Roles
  Anywhere. An imported certificate revocation list (CRL) tells the service
  which certificates must no longer be accepted. Disabling or
  deleting the list, or replacing it with one that leaves a certificate out,
  lets a revoked certificate obtain role credentials again, which undoes the
  containment of a stolen workload certificate. AWS documents that all IAM
  Roles Anywhere actions are logged. The rule matches the event names:
  compare the list in the request with the one your certificate authority
  publishes.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_Operations.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rolesanywhere.amazonaws.com
    eventName:
      - ImportCrl
      - UpdateCrl
      - DisableCrl
      - DeleteCrl
  condition: selection
falsepositives:
  - The scheduled import of a new revocation list by the PKI team or its automation, which is the normal way to keep an imported CRL current. Add that role to a filter_* selection on userIdentity.arn and review DisableCrl and DeleteCrl whoever made them.
level: medium

False positives

  • The scheduled import of a new revocation list by the PKI team or its automation, which is the normal way to keep an imported CRL current. Add that role to a filter_* selection on userIdentity.arn and review DisableCrl and DeleteCrl whoever made them.

IAM Roles Anywhere Profile Created

Detects CreateProfile calls to IAM Roles Anywhere. A profile lists the IAM roles that certificate holders can obtain credentials for, and it can limit those sessions with managed or inline session policies. Check the role ARNs and the session policy in requestParameters, and the caller in userIdentity.arn. A profile that lists privileged roles without a session policy hands out those roles in full to anyone with a certificate from a trust anchor in the account. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM Roles Anywhere Profile Created
id: 4b5bc048-ceab-4c10-a5b7-b72fdd60876b
status: experimental
description: >-
  Detects CreateProfile calls to IAM Roles Anywhere. A profile lists the IAM
  roles that certificate holders can obtain credentials for, and it can limit
  those sessions with managed or inline session policies. Check the role ARNs
  and the session policy in requestParameters, and the caller in
  userIdentity.arn. A profile that lists privileged roles without a session
  policy hands out those roles in full to anyone with a certificate from a
  trust anchor in the account.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateProfile.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-14
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rolesanywhere.amazonaws.com
    eventName: CreateProfile
  condition: selection
falsepositives:
  - New workloads outside AWS being given a role by the platform team, often one profile per workload. Add the provisioning roles to a filter_* selection on userIdentity.arn, and review profiles that list administrator roles whoever created them.
level: medium

False positives

  • New workloads outside AWS being given a role by the platform team, often one profile per workload. Add the provisioning roles to a filter_* selection on userIdentity.arn, and review profiles that list administrator roles whoever created them.

IAM Roles Anywhere Session Created with a Certificate

Detects CreateSession events of IAM Roles Anywhere, the call that exchanges a certificate for temporary credentials of a role. AWS names CreateSession among the calls that generate CloudTrail entries, and documents that the role session name of the resulting session is the hex-encoded serial number of the certificate that was used. In an account that does not use IAM Roles Anywhere every such event deserves a look. Where the service is in use the event is routine and the rule is a source for a baseline of certificate serial numbers and source addresses (see the detection logic on the page). The rule matches the event name only, because AWS publishes no example record of the request. It also matches attempts that failed (errorCode present): check errorCode, because a rejected certificate is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: IAM Roles Anywhere Session Created with a Certificate
id: 77694eb9-1175-4430-86b1-d8b8d2f3bf5f
status: experimental
description: >-
  Detects CreateSession events of IAM Roles Anywhere, the call that exchanges
  a certificate for temporary credentials of a role. AWS names CreateSession
  among the calls that generate CloudTrail entries, and documents that the
  role session name of the resulting session is the hex-encoded serial
  number of the certificate that was used. In an account that does not use
  IAM Roles Anywhere every such event deserves a look. Where the service is
  in use the event is routine and the rule is a source for a baseline of
  certificate serial numbers and source addresses (see the detection logic
  on the page). The rule matches the event name only, because AWS publishes
  no example record of the request.
  It also matches attempts that failed (errorCode present): check errorCode,
  because a rejected certificate is worth seeing.
references:
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rolesanywhere.amazonaws.com
    eventName: CreateSession
  condition: selection
falsepositives:
  - Every workload outside AWS that uses IAM Roles Anywhere, each time it renews its credentials. Useful as it stands only in accounts and Regions that do not use the service. Elsewhere, limit it to source addresses or roles you do not expect.
level: low

False positives

  • Every workload outside AWS that uses IAM Roles Anywhere, each time it renews its credentials. Useful as it stands only in accounts and Regions that do not use the service. Elsewhere, limit it to source addresses or roles you do not expect.

IAM Roles Anywhere Trust Anchor Created

Detects CreateTrustAnchor calls to IAM Roles Anywhere. A trust anchor registers a certificate authority, and certificates issued by that CA can then be exchanged for temporary credentials of every role in the account that trusts rolesanywhere.amazonaws.com, unless the trust policy of the role limits it to one trust anchor. Check the CA source in requestParameters (an AWS Private CA or an uploaded certificate bundle) against the CAs your organization operates, and the caller in userIdentity.arn. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelHighStatusExperimentalLog sourceAWS CloudTrail
title: IAM Roles Anywhere Trust Anchor Created
id: 28007baa-7c08-451c-afbe-17fd17a0da4f
status: experimental
description: >-
  Detects CreateTrustAnchor calls to IAM Roles Anywhere. A trust anchor
  registers a certificate authority, and certificates issued by that CA can
  then be exchanged for temporary credentials of every role in the account
  that trusts rolesanywhere.amazonaws.com, unless the trust policy of the role
  limits it to one trust anchor. Check the CA source in requestParameters
  (an AWS Private CA or an uploaded certificate bundle) against the CAs your
  organization operates, and the caller in userIdentity.arn.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateTrustAnchor.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-14
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rolesanywhere.amazonaws.com
    eventName: CreateTrustAnchor
  condition: selection
falsepositives:
  - Onboarding of workloads outside AWS by the platform or PKI team, and infrastructure-as-code runs that create the trust anchor. Trust anchors are created rarely; confirm each one against a change record, and add the provisioning role to a filter_* selection on userIdentity.arn only if it creates them routinely.
level: high

False positives

  • Onboarding of workloads outside AWS by the platform or PKI team, and infrastructure-as-code runs that create the trust anchor. Trust anchors are created rarely; confirm each one against a change record, and add the provisioning role to a filter_* selection on userIdentity.arn only if it creates them routinely.

IAM Roles Anywhere Trust Anchor or Profile Updated or Enabled

Detects changes to IAM Roles Anywhere objects that already exist: UpdateTrustAnchor, EnableTrustAnchor, UpdateProfile, EnableProfile, PutAttributeMapping and DeleteAttributeMapping. An attacker does not have to create a trust anchor when one exists: UpdateTrustAnchor can replace its certificate authority, UpdateProfile can add roles or drop the session policy that limits them, and the enable calls bring back an object that was switched off. AWS documents that all IAM Roles Anywhere actions are logged, and publishes an UpdateProfile record whose requestParameters hold the profile ID, the managed policy ARNs and the session policy. Compare the new certificate authority, role list and session policy with the last approved state. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM Roles Anywhere Trust Anchor or Profile Updated or Enabled
id: acdbdba0-7958-4218-98a3-939ecc3b7578
status: experimental
description: >-
  Detects changes to IAM Roles Anywhere objects that already exist:
  UpdateTrustAnchor, EnableTrustAnchor, UpdateProfile, EnableProfile,
  PutAttributeMapping and DeleteAttributeMapping. An attacker does not have
  to create a trust anchor when one exists: UpdateTrustAnchor can replace
  its certificate authority, UpdateProfile can add roles or drop the session
  policy that limits them, and the enable calls bring back an object that
  was switched off. AWS documents that all IAM Roles Anywhere actions are
  logged, and publishes an UpdateProfile record whose requestParameters hold
  the profile ID, the managed policy ARNs and the session policy. Compare
  the new certificate authority, role list and session policy with the last
  approved state.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_Operations.html
  - https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rolesanywhere.amazonaws.com
    eventName:
      - UpdateTrustAnchor
      - EnableTrustAnchor
      - UpdateProfile
      - EnableProfile
      - PutAttributeMapping
      - DeleteAttributeMapping
  condition: selection
falsepositives:
  - Renewal of a certificate authority by the PKI team, which updates the trust anchor, and changes to the role list of a profile when a workload is onboarded. Confirm the change record, and add the provisioning role to a filter_* selection on userIdentity.arn only if it makes these changes routinely.
level: medium

False positives

  • Renewal of a certificate authority by the PKI team, which updates the trust anchor, and changes to the role list of a profile when a workload is onboarded. Confirm the change record, and add the provisioning role to a filter_* selection on userIdentity.arn only if it makes these changes routinely.

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.

First credential request with a certificate that was not seen before

Detection hypothesisNeeds a baselineSequence of events

A workload renews its credentials with the same certificate from the same place for months. A certificate that appears for the first time, above all shortly after a trust anchor, a profile or a revocation list was changed, is how access through a certificate authority of the attacker shows up.

  1. Collect CreateSession events from rolesanywhere.amazonaws.com and the activity of the role sessions they start. AWS documents that the role session name is the hex-encoded serial number of the certificate.
  2. Keep a baseline of the serial numbers seen for each role, taken from the session name at the end of userIdentity.arn, and of the sourceIPAddress values of the CreateSession events.
  3. Alert on a serial number or a source address that is new for the role, and raise the priority when a trust anchor, profile or revocation list event precedes it within 24 hours.

EventsCreateSession

LimitsEvery certificate renewal brings a new serial number, so the baseline has to follow your renewal schedule, and short-lived certificates make it noisy. Workloads that move between networks change their source address. The 24 hours are a starting point.

Triage

  • For CreateTrustAnchor, read the source in requestParameters. An uploaded CA certificate (source type CERTIFICATE_BUNDLE) from a CA your organization does not run is the key signal; an AWS Private CA in your own organization is the usual legitimate source.
  • For CreateProfile, read the role ARNs and the session policy. A profile that lists administrator roles and has no session policy hands out those roles in full.
  • Identify the caller (userIdentity.arn) and the Region, and check whether the account uses IAM Roles Anywhere at all. A first trust anchor in an account or Region with no outside workloads is rarely legitimate.
  • List the roles that trust rolesanywhere.amazonaws.com and check their conditions. Then search for CreateSession events and for activity by role sessions whose session name is a certificate serial number.
  • If the change is not approved, disable or delete the trust anchor and the profile, remove the service principal from the role trust policies it was added to, revoke the sessions of the affected roles and review what they did.

Response

Once the attack is confirmed:

  1. Disable the trust anchor first, because AWS refuses credential requests that specify a disabled trust anchor. Disable the profile too while you investigate.
  2. Revoke the active sessions of every role the profile lists and of every role that trusts rolesanywhere.amazonaws.com without conditions. Credentials that were already issued stay valid until they expire unless the sessions are revoked.
  3. Remove the service principal from the role trust policies it was added to, then delete the trust anchor and the profile.
  4. Look for the same objects in every Region, including Regions you do not use, because trust anchors and profiles are regional.
  5. Review what the role sessions did. Their session name is the hex-encoded serial number of the certificate that was used. Contain the principal that created the trust anchor or the profile.

Mitigation

  • Restrict the IAM Roles Anywhere write actions (CreateTrustAnchor, UpdateTrustAnchor, CreateProfile, UpdateProfile) to a few identity administrators, and deny them with a service control policy in accounts and Regions that do not use the service.
  • In every role that trusts rolesanywhere.amazonaws.com, add an aws:SourceArn condition with the ARN of the expected trust anchor and conditions on the certificate attributes (for example aws:PrincipalTag/x509Subject/CN). Without them, any trust anchor in the account can reach the role.
  • Manage trust anchors and profiles as code, and compare the list in each Region (ListTrustAnchors, ListProfiles) with the CAs your organization operates. The resources are regional, so include Regions you do not use.
  • Keep the role list of each profile short and limit its sessions with a session policy.

Frequently asked questions

Do these rules show a certificate being used to get credentials?

One rule does, at a low level. It matches `CreateSession`, the call that exchanges a certificate for credentials, and AWS documents that the role session name is the hex-encoded serial number of the certificate that was used. Where the service is in daily use that event is routine, so the rules for the setup, `CreateTrustAnchor` and `CreateProfile`, stay the main signal. Search for the sessions and their activity when one of them fires.

Do the rules fire when an existing trust anchor or profile is changed?

Yes. One rule matches the update and enable calls for trust anchors and profiles and the changes to attribute mappings, and another matches the import, update, disabling and deletion of a certificate revocation list. The rules cannot judge whether a change widens access, so compare the configured certificate authorities and role lists with what you expect.

Why can a new trust anchor reach roles that were set up for a different certificate authority?

AWS sets the trust boundary at the account level. Certificates issued under any trust anchor in the account can be used to assume any role in that account that trusts `rolesanywhere.amazonaws.com`, unless the trust policy of the role restricts it, for example with an `aws:SourceArn` condition that names the expected trust anchor.

Does rotating access keys or removing users end this kind of access?

No. The access rests on a certificate the attacker issues, on the trust anchor, on the profile and on the trust policy of the role. No IAM user, password or access key is involved, so it survives credential rotation and the removal of the identity that set it up. New sessions can be requested for as long as the trust anchor, the profile and the role trust stay in place.

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.