Updated on 2026-11-06 GMT+08:00

Example RCPs

This section provides some example RCPs for your reference, including:

Preventing Users Outside an Organization from Obtaining Temporary Agency Credentials Through the Agency of the Organization's Member Account, Except for Cloud Service-Initiated Requests

The following RCP prevents users outside an organization from obtaining temporary credentials of an agency through the agency of the organization's member account, except for requests initiated by cloud services.
{
  "Version": "5.0",
  "Statement": [
    {
      "Effect": "Deny",
      "Principal": "*",
      "Action": [
        "sts:agencies:assume"
      ],
      "Resource": [
        "*"
      ]
      "BoolIfExists": {
        "g:PrincipalIsServices": ["false"]
      }
    }
  ]
}

Preventing Users Outside an Organization from Accessing Resources in the Organization's Member Accounts, Except for Cloud Service-Initiated Requests

The following RCP prevents users outside an organization from accessing resources in the organization's member accounts, except for requests initiated by cloud services.
{
  "Version": "5.0",
  "Statement": [
    {
      "Effect": "Deny",
      "Principal": "*",
      "Action": [
        "sts:*:*",
        "kms:*:*",
        "swr:*:*",
        "csms:*:*"
      ],
      "Condition": {
        "StringNotEquals": {
            "g:PrincipalOrgId": ["<my-org-id>"]
        },
        "BoolIfExists": {
            "g:PrincipalIsService": ["false"]
        }
      }
    }
  ]
}

Blocking Access to Resources in an Organization's Member Accounts Without Using HTTPS, Except for Cloud Service-Initiated Requests

The following RCP blocks access to resources in an organization's member accounts without using HTTPS connections, except for requests initiated by cloud services.

{
   "Version": "5.0",
   "Statement": [
     {
       "Effect": "Deny",
       "Principal": "*",
       "Action": [
        "sts:*:*",
        "kms:*:*",
        "swr:*:*",
        "csms:*:*"
      ],
      "Condition": {
        "BoolIfExists": {
          "g:PrincipalIsService": ["false"],
          "g:SecureTransport": ["false"]
        }
      }
    }
  ]
}