Resource Access Manager (RAM) shares AWS resources across accounts. Shared subnets let other accounts launch EC2 in your VPC, shared TGWs enable routing changes, and shared Resolver rules redirect DNS.
RAM creates resource shares containing AWS resources (subnets, TGWs, Resolver rules, License Manager configs). Shares can target specific accounts, OUs, or the entire organization. Within an org, shares are auto-accepted without invitation.
When subnets are shared, participant accounts can launch EC2 instances, RDS databases, and other resources directly in the owner account VPC. The participant sees the subnet but cannot modify VPC-level networking, creating a trust boundary issue.
EnableSharingWithAwsOrganization auto-accepts shares for all org accounts. RAM shares do not appear prominently in CloudTrail, and there is no native alerting when resources are shared with your account, creating visibility gaps.
RAM enables cross-account resource access that is difficult to audit. Shared subnets allow launching instances in other accounts VPCs, shared TGWs enable routing changes, and shared Resolver rules can redirect DNS queries.
aws ram get-resource-shares \
--resource-owner SELFaws ram list-resources \
--resource-owner SELFaws ram list-principals \
--resource-owner SELFaws ram list-resources \
--resource-owner OTHER-ACCOUNTSaws ram list-resource-share-permissions \
--resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/abc123aws ram create-resource-share \
--name "SharedInfra" \
--resource-arns arn:aws:ec2:us-east-1:123456789012:subnet/subnet-abc123 \
--principals arn:aws:organizations::123456789012:organization/o-abc123aws ram accept-resource-share-invitation \
--resource-share-invitation-arn arn:aws:ram:us-east-1:123456789012:resource-share-invitation/abc123aws ram enable-sharing-with-aws-organizationaws ram associate-resource-share \
--resource-share-arn arn:aws:ram:us-east-1:123456789012:resource-share/abc123 \
--principals 999888777666aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type t3.micro \
--subnet-id subnet-shared-abc123 \
--key-name attacker-keyecho "=== Shared BY me ===" && aws ram list-resources --resource-owner SELF --query 'resources[].[type,arn]' --output table && echo "=== Shared WITH me ===" && aws ram list-resources --resource-owner OTHER-ACCOUNTS --query 'resources[].[type,arn]' --output table{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "ram:*",
"Resource": "*"
}]
}Full RAM access allows creating shares targeting any account, enabling org-wide sharing, and modifying existing shares
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ram:Get*",
"ram:List*"
],
"Resource": "*"
}]
}Read-only access for auditing resource shares without ability to create or modify them
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ram:EnableSharingWithAwsOrganization",
"ram:CreateResourceShare",
"ram:AssociateResourceShare"
],
"Resource": "*"
}]
}Enables org-wide auto-accept sharing and can share any resource with any account in the organization
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyRAMSharing",
"Effect": "Deny",
"Action": [
"ram:CreateResourceShare",
"ram:EnableSharingWithAwsOrganization",
"ram:AssociateResourceShare"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:PrincipalArn": "arn:aws:iam::*:role/NetworkAdmin"
}
}
}]
}SCP restricts RAM sharing to dedicated NetworkAdmin role, preventing unauthorized cross-account resource exposure
Do not enable EnableSharingWithAwsOrganization unless required. Use explicit account-level sharing instead.
Use SCPs to deny CreateResourceShare and AssociateResourceShare except for authorized roles.
Periodically enumerate all resource shares and validate that each share is still needed and correctly scoped.
aws ram get-resource-shares --resource-owner SELF \
--query 'resourceShares[].[name,status]' \
--output tableUse tag-based conditions in RAM policies to restrict which resources can be shared.
"Condition": {"StringEquals": {
"ram:ResourceTag/Shareable": "true"
}}Create EventBridge rules for CreateResourceShare, EnableSharingWithAwsOrganization, and AcceptResourceShareInvitation.
Regularly check what resources other accounts have shared with you to detect unauthorized access.
aws ram list-resources --resource-owner OTHER-ACCOUNTS \
--query 'resources[].[type,arn,resourceShareArn]' \
--output tableAWS RAM Security Card • Toc Consulting
Always obtain proper authorization before testing