

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# AWS Organizations 和資源總管的服務控制策略示例
<a name="security_iam_scp"></a>

AWS 資源總管 支援服務控制原則 (SCP)。SCP 是您附加至組織中元素的政策，藉此管理該組織內的許可。SCP 適用於[您附加 SCP 的元素下的](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_evaluation.html)所有組織 AWS 帳戶 中。SCP 可集中控制組織中所有帳戶可用的許可上限。他們可以幫助您確保您的 AWS 帳戶 逗留在組織的存取控制準則範圍內。如需詳細資訊，請參閱《AWS Organizations 使用者指南》中的[服務控制政策](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_type-auth.html)。

## 必要條件
<a name="scp-prereqs"></a>

若要使用 SCP，您必須執行下列動作：
+ 啟用您組織的所有功能。如需詳細資訊，請參閱 *AWS Organizations 使用者指南*中的[啟用組織中的所有功能](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html)。
+ 啟用 SCP 以便於您的組織內使用。如需詳細資訊，請參閱《*AWS Organizations 使用者指南*》中的[啟用和停用政策類型](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_enable-disable.html)。
+ 建立您需要的 SCP。如需有關建立 SCP 的詳細資訊，請參閱《*AWS Organizations 使*用指南》中的〈[建立和更新 SCP](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp-create.html)〉。

## 服務控制政策的範例
<a name="scp-examples"></a>

下列範例顯示如何使用以[屬性為基礎的存取控制 (ABAC)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html) 來控制對資源總管系統管理作業的存取。除了搜尋所需的兩個權限以外，此範例政策會拒絕存取所有 Resource Explorer 作業`resource-explorer-2:GetView`，`resource-explorer-2:Search`並且除非提出請求的 IAM 主體已加上標籤`ResourceExplorerAdmin=TRUE`。如需將 ABAC 與資源總管搭配使用的更完整討論，請參閱[使用基於標籤的授權來控制對視圖的存取權](manage-views-grant-access.md#manage-views-grant-access-abac)。

```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Action": [
        "resource-explorer-2:AssociateDefaultView",
        "resource-explorer-2:BatchGetView",
        "resource-explorer-2:CreateIndex",
        "resource-explorer-2:CreateView",
        "resource-explorer-2:DeleteIndex",
        "resource-explorer-2:DeleteView",
        "resource-explorer-2:DisassociateDefaultView",
        "resource-explorer-2:GetDefaultView",
        "resource-explorer-2:GetIndex",
        "resource-explorer-2:ListIndexes",
        "resource-explorer-2:ListSupportedResourceTypes",
        "resource-explorer-2:ListTagsForResource",
        "resource-explorer-2:ListViews",
        "resource-explorer-2:TagResource",
        "resource-explorer-2:UntagResource",
        "resource-explorer-2:UpdateIndexType",
        "resource-explorer-2:UpdateView""
      ],
      "Resource": [
        "*"
      ],
      "Condition": {
          "StringNotEqualsIgnoreCase": {"aws:PrincipalTag/ResourceExplorerAdmin": "TRUE"}
      }
   ]
}
```