設定 SCPs或 RCPs的組態套件 - AWS Control Tower

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

設定 SCPs或 RCPs的組態套件

本節說明如何建立服務控制政策 SCPs) 或資源控制政策 (RCPs組態套件。此程序的兩個主要部分是 (1) 準備資訊清單檔案,以及 (2) 準備您的資料夾結構。

步驟 1:編輯 manifest.yaml 檔案

使用範例manifest.yaml檔案做為起點。輸入所有必要的組態。新增 resource_filedeployment_targets 詳細資訊。

下列程式碼片段顯示預設資訊清單檔案。

--- region: us-east-1 version: 2021-03-15 resources: []

部署期間會自動region新增 的值。它必須符合您部署 CfCT 的區域。此區域必須與 AWS Control Tower 區域相同。

若要在存放在 Amazon S3 儲存貯體的 zip 套件的example-configuration資料夾中新增自訂 SCP 或 RCP,請開啟 example-manifest.yaml 檔案並開始編輯。

--- region: your-home-region version: 2021-03-15 resources: - name: test-preventive-controls description: To prevent from deleting or disabling resources in member accounts resource_file: policies/preventive-controls.json deploy_method: scp | rcp #Apply to the following OU(s) deployment_targets: organizational_units: #array of strings - OUName1 - OUName2 …truncated…

下列程式碼片段顯示自訂資訊清單檔案的範例。您可以在單一變更中新增多個政策。

--- region: us-east-1 version: 2021-03-15 resources: - name: block-s3-public-access description: To S3 buckets to have public access resource_file: policies/block-s3-public.json deploy_method: scp | rcp #Apply to the following OU(s) deployment_targets: organizational_units: #array of strings - OUName1 - OUName2

步驟 2:建立資料夾結構

如果您使用資源檔案的 Amazon S3 URL,並使用具有金鑰/值對的參數,則可以略過此步驟。

您必須包含 JSON 格式的 SCP 政策或 RCP 政策以支援資訊清單,因為資訊清單檔案參考 JSON 檔案。確保檔案路徑符合資訊清單檔案中提供的路徑資訊。

  • 政策 JSON 檔案包含要部署到 OUs SCPs 或 RCPs。

下列程式碼片段顯示範例資訊清單檔案的資料夾結構。

- manifest.yaml - policies/ - block-s3-public.json

下列程式碼片段是block-s3-public.json政策檔案的範例。

{ "Version":"2012-10-17", "Statement":[ { "Sid":"GuardPutAccountPublicAccessBlock", "Effect":"Deny", "Action":"s3:PutAccountPublicAccessBlock", "Resource":"arn:aws:s3:::*" } ] }