1. Resources
  2. Detection rules
  3. AWS RAM Resource Share Opened to External Principals

AWS RAM Resource Share Opened to External Principals detection rules

An attacker uses AWS Resource Access Manager to share resources of the account with a principal outside the organization, which gives an account they control lasting use of those resources.

Platform
AWS
Severity
Medium
Log source
AWS CloudTrail
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Credentials for a principal that may create or change AWS RAM resource shares, and an outside account that accepts the invitation.
Impact
An account outside the organization can use the shared resources with the permissions of the share until it is disassociated or the share is deleted.
Response
Disassociate the outside principal or delete the share, set shares back to organization-only, and contain the identity that changed them.
Mitigation
Deny resource shares that allow external principals with the condition key ram:RequestedAllowsExternalPrincipals and share with the organization instead.
CloudTrail events
AssociateResourceShareUpdateResourceShareCreateResourceShare

How the attack works

AWS Resource Access Manager (RAM) is the service for sharing resources between accounts. A resource share holds a list of resources and a list of principals, and AWS states plainly what it does: sharing a resource makes it available for use by principals outside the account that created it. A principal can be an account ID, an organization or organizational unit, an IAM role or user, or a service principal. Whether accounts outside the organization may be added is decided by one setting of the share, allowExternalPrincipals, and its default is true. A share that is created without thinking about it can therefore be extended to any AWS account.

For an attacker RAM is a way to hand resources to an account of their own without touching the resource policies one by one, and for some resource types RAM writes the policy itself: when a KMS key is shared through RAM, RAM creates and manages a key policy named AWS_RAM on the key. The attacker either creates a new share (CreateResourceShare), adds a principal or more resources to an existing one (AssociateResourceShare), or switches an organization-only share to allow outside principals (UpdateResourceShare). An account outside the organization receives an invitation and has to accept it. Accounts inside the same organization get access without one.

RAM logs all of its actions in CloudTrail under ram.amazonaws.com. AWS's example record for CreateResourceShare shows the name of the share in the request and allowExternalPrincipals in responseElements.resourceShare, which is where the first rule reads it, because the value is there even when the request left it to the default. No public incident report was used for this page: it follows what AWS documents about RAM.

What an attacker needs

  • Credentials for a principal allowed ram:CreateResourceShare, ram:AssociateResourceShare or ram:UpdateResourceShare.
  • An account outside the organization that accepts the invitation, which an attacker controls.

Impact

The outside account can use the shared resources with the permissions the share grants, for as long as the share and the association exist. What that means depends on the resource type. A shared KMS key, for example, can be used by principals of the outside account once their own IAM policies allow it. The access does not depend on the compromised identity any more.

Detection rules

Principals or Resources Added to an AWS RAM Resource Share

Detects AssociateResourceShare calls to AWS Resource Access Manager, which add principals or resources to an existing resource share. AWS documents that newly added principals immediately receive access to the resources of the share, and that principals already on the share immediately receive access to added resources. An attacker can use an existing, legitimate share to hand a resource to an account that is already on it, or add an account of their own to it. AWS names the call among the RAM actions that CloudTrail logs and publishes no example record for it, so the rule matches the event name only: read the principals and the resource ARNs of the request and compare the account IDs with your own. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: Principals or Resources Added to an AWS RAM Resource Share
id: 96aba89e-31d8-403a-a185-fffe7f26a486
status: experimental
description: >-
  Detects AssociateResourceShare calls to AWS Resource Access Manager, which
  add principals or resources to an existing resource share. AWS documents
  that newly added principals immediately receive access to the resources of
  the share, and that principals already on the share immediately receive
  access to added resources. An attacker can use an existing, legitimate
  share to hand a resource to an account that is already on it, or add an
  account of their own to it. AWS names the call among the RAM actions that
  CloudTrail logs and publishes no example record for it, so the rule
  matches the event name only: read the principals and the resource ARNs of
  the request and compare the account IDs with your own.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/ram/latest/APIReference/API_AssociateResourceShare.html
  - https://docs.aws.amazon.com/ram/latest/userguide/cloudtrail-logging.html
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: ram.amazonaws.com
    eventName: AssociateResourceShare
  condition: selection
falsepositives:
  - Platform teams and infrastructure-as-code tools that maintain shared networks and other shared infrastructure, which add accounts and resources to shares as the organization grows. Add the deployment roles to a filter_* selection on userIdentity.arn.
level: low

False positives

  • Platform teams and infrastructure-as-code tools that maintain shared networks and other shared infrastructure, which add accounts and resources to shares as the organization grows. Add the deployment roles to a filter_* selection on userIdentity.arn.

AWS RAM Resource Share Changed to Allow External Principals

Detects UpdateResourceShare calls to AWS Resource Access Manager that set allowExternalPrincipals to true. This turns a share that was limited to the organization into one that accounts outside it can be associated with, and it is the step before an outside account is added. The value is read from requestParameters.allowExternalPrincipals, which follows the request parameter of the RAM API reference: AWS publishes an example record for CreateResourceShare only, so confirm the field in your own events. AWS's own example policy for keeping shares inside the organization denies exactly this request. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: AWS RAM Resource Share Changed to Allow External Principals
id: cf9542e4-22b7-4e93-a862-2ea2aa664fb0
status: experimental
description: >-
  Detects UpdateResourceShare calls to AWS Resource Access Manager that set
  allowExternalPrincipals to true. This turns a share that was limited to
  the organization into one that accounts outside it can be associated
  with, and it is the step before an outside account is added. The value is
  read from requestParameters.allowExternalPrincipals, which follows the
  request parameter of the RAM API reference: AWS publishes an example
  record for CreateResourceShare only, so confirm the field in your own
  events. AWS's own example policy for keeping shares inside the
  organization denies exactly this request.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/ram/latest/APIReference/API_UpdateResourceShare.html
  - https://docs.aws.amazon.com/ram/latest/userguide/security-iam-policies-examples.html
  - https://docs.aws.amazon.com/ram/latest/userguide/cloudtrail-logging.html
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: ram.amazonaws.com
    eventName: UpdateResourceShare
    requestParameters.allowExternalPrincipals: 'true'
  condition: selection
falsepositives:
  - A platform team that opens a share for an approved partner or for an account that is about to join the organization. This should come with a change record.
  - Tools that send the unchanged value true again when they rename a share.
level: medium

False positives

  • A platform team that opens a share for an approved partner or for an account that is about to join the organization. This should come with a change record.
  • Tools that send the unchanged value true again when they rename a share.

AWS RAM Resource Share Created That Allows External Principals

Detects CreateResourceShare calls to AWS Resource Access Manager whose resulting share allows external principals. The setting decides whether accounts outside the organization can be associated with the share, and AWS documents that it defaults to true when the request does not set it. AWS's example record for this event shows the setting in responseElements.resourceShare.allowExternalPrincipals, and the rule reads it there, so that shares created with the default are matched as well. The rule does not say that an outside account is on the share: read the principals and the resource ARNs of the request. Failed calls carry no response and are not matched.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: AWS RAM Resource Share Created That Allows External Principals
id: cf3d4672-bf1f-40f1-988d-42b01b5ee3d3
status: experimental
description: >-
  Detects CreateResourceShare calls to AWS Resource Access Manager whose
  resulting share allows external principals. The setting decides whether
  accounts outside the organization can be associated with the share, and
  AWS documents that it defaults to true when the request does not set it.
  AWS's example record for this event shows the setting in
  responseElements.resourceShare.allowExternalPrincipals, and the rule reads
  it there, so that shares created with the default are matched as well. The
  rule does not say that an outside account is on the share: read the
  principals and the resource ARNs of the request. Failed calls carry no
  response and are not matched.
references:
  - https://docs.aws.amazon.com/ram/latest/userguide/cloudtrail-logging.html
  - https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html
  - https://docs.aws.amazon.com/ram/latest/userguide/security-iam-policies-examples.html
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: ram.amazonaws.com
    eventName: CreateResourceShare
    responseElements.resourceShare.allowExternalPrincipals: 'true'
  condition: selection
falsepositives:
  - Shares created by platform teams and infrastructure-as-code tools that leave the setting at its default, including shares that only ever hold accounts of the organization. Add the deployment roles to a filter_* selection on userIdentity.arn, or enforce allowExternalPrincipals false with the condition key ram:RequestedAllowsExternalPrincipals so that the rule fires only on exceptions.
  - Accounts that are not a member of an organization, where the setting has no meaning.
level: medium

False positives

  • Shares created by platform teams and infrastructure-as-code tools that leave the setting at its default, including shares that only ever hold accounts of the organization. Add the deployment roles to a filter_* selection on userIdentity.arn, or enforce allowExternalPrincipals false with the condition key ram:RequestedAllowsExternalPrincipals so that the rule fires only on exceptions.
  • Accounts that are not a member of an organization, where the setting has no meaning.

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.

Principal added to a resource share is not an account of yours

Detection hypothesisNeeds your own lists

Adding an account to a share is an ordinary call that names the account. Whether it is an attacker's account or one of your own is not in the event and needs your own account list.

  1. Collect CreateResourceShare and AssociateResourceShare events from ram.amazonaws.com and read the principals of the request, which are account IDs, organization or organizational unit ARNs, or IAM role and user ARNs.
  2. Extract every 12-digit account ID and compare it with the accounts of your organization and the third parties you have approved.
  3. Alert when an ID is on neither list, and read the resource ARNs of the share to see what was handed over.

EventsCreateResourceShareAssociateResourceShare

LimitsIt needs a current list of your accounts and approved partners. The principals are a request parameter of the RAM API reference. AWS's example record shows a request without principals, so confirm in your own events where the list appears.

Triage

  • Identify the caller (userIdentity.arn), the source IP address and the user agent, and the share by its name in the request or its ARN in the response. Is the caller a platform role that manages shared infrastructure?
  • Read the principals and the resource ARNs of the request. An account ID that is not in your organization needs an owner and a reason.
  • Check whether the share allows external principals. For CreateResourceShare the response carries the setting in responseElements.resourceShare.allowExternalPrincipals.
  • List the current associations of the share to see whether the outside account has accepted the invitation.
  • For a shared KMS key, look for the PutKeyPolicy entry whose policy name is AWS_RAM.

Response

Once the attack is confirmed:

  1. Stop the sharing. Disassociate the outside principal from the resource share, or delete the share if the attacker created it.
  2. Set allowExternalPrincipals back to false on shares that should stay inside the organization.
  3. Contain the identity that made the change by deactivating its access keys or revoking its role sessions.
  4. Review what the outside account could do with each shared resource while it had access, and treat data that it could reach as exposed.
  5. Check the other resource shares of the account, and of the accounts the identity could reach, for principals nobody recognizes.

Mitigation

  • Deny ram:CreateResourceShare unless the request sets allowExternalPrincipals to false, and deny ram:UpdateResourceShare requests that set it to true, with the condition key ram:RequestedAllowsExternalPrincipals. AWS publishes this policy as an example.
  • Enable sharing with AWS Organizations and share with the organization or with organizational units instead of single account IDs.
  • Allow the RAM write actions only to platform roles that manage shared infrastructure.
  • Review resource shares, their principals and their resources on a schedule, and remove shares nobody owns.

Frequently asked questions

Why does the first rule read the response and not the request?

AWS documents that allowExternalPrincipals defaults to true, and its example record for CreateResourceShare shows a request that carries only the name of the share. The setting that applies is in the response, in `responseElements.resourceShare.allowExternalPrincipals`. A rule on the request alone would miss every share that was created with the default.

Does a share that allows external principals mean that an outside account has access?

No. The setting says that accounts outside the organization can be associated with the share. Access needs an outside principal on the share, and that account has to accept the invitation. Read the principals of the request and the current associations of the share.

Do the rules tell an outside account from one of my own?

No. A rule on one event cannot compare an account ID with the accounts of your organization. The rules report shares that are able to include outside accounts and every change to who or what is on a share. The comparison with your account list is described under detection logic.

Has this been seen in real intrusions?

This page was not written from an incident report, and no public report that describes RAM abuse at the audit event level was used. It follows what AWS documents about resource shares and external principals.

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.