

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

# 部署解決方案
<a name="deploy-the-solution"></a>

**重要**  
如果 Security Hub 中的[合併控制調查結果](deciding-where-to-deploy-each-stack.md#consolidated-controls-findings)功能已開啟，則只有在部署此解決方案時才會啟用安全控制 (SC) 手冊。如果未開啟此功能，請**僅**針對 Security Hub 中啟用的安全標準啟用程序手冊。如果您在 2023 年 2 月 23 日或之後啟用 Security Hub CSPM，則預設會啟用合併控制調查結果。

此解決方案使用 [AWS CloudFormation 範本和堆疊](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html)來自動化其部署。CloudFormation 範本會指定此解決方案中包含的 AWS 資源及其屬性。CloudFormation 堆疊會佈建範本中所述的資源。

若要讓解決方案運作，必須部署三個範本。首先，決定部署範本的位置，然後決定如何部署範本。

此概觀將描述範本，以及如何決定部署它們的位置和方式。下一節將更詳細說明如何將每個堆疊部署為 Stack 或 StackSet。

# 決定部署每個堆疊的位置
<a name="deciding-where-to-deploy-each-stack"></a>

這三個範本將由下列名稱參考，並包含下列資源：
+ 管理員堆疊：協調器步驟函數、事件規則和 Security Hub 自訂動作。
+ 成員堆疊：修復 SSM 自動化文件。
+ 成員角色堆疊：用於修復的 IAM 角色。

管理員堆疊必須部署在單一帳戶和單一區域中一次。它必須部署到您已設定為組織 Security Hub 調查結果彙總目的地的帳戶和區域中。如果您想要使用動作日誌功能來監控管理事件，您必須在組織的管理帳戶或委派管理員帳戶中部署管理員堆疊。

解決方案會在 Security Hub 問題清單上運作，因此如果該帳戶或區域尚未設定為彙總 Security Hub 管理員帳戶和區域中的問題清單，該解決方案將無法在特定帳戶和區域中的問題清單上運作。

**重要**  
如果您使用的是 [AWS Security Hub （非 CSPM)](https://aws.amazon.com/security-hub/)，則您有責任確保加入 [AWS Security Hub CSPM](https://docs.aws.amazon.com/securityhub/latest/userguide/what-is-securityhub.html) 的成員帳戶也加入 AWS Security Hub （非 CSPM)。AWS Security Hub CSPM 中彙總的區域也應符合 AWS Security Hub （非 CSPM) 中彙總的區域。

例如，組織擁有在區域 `us-east-1`和 中操作的帳戶`us-west-2`，其帳戶`111111111111`為區域 中的 Security Hub 委派管理員`us-east-1`。帳戶 `222222222222`和 `333333333333` 必須是委派管理員帳戶 的 Security Hub 成員帳戶`111111111111`。所有三個帳戶都必須設定為將問題清單從 彙總`us-west-2`到 `us-east-1`。管理員堆疊必須部署到 `111111111111`中的帳戶`us-east-1`。

如需尋找彙總的詳細資訊，請參閱 Security Hub [委派管理員帳戶](https://docs.aws.amazon.com/securityhub/latest/userguide/designate-orgs-admin-account.html)和[跨區域彙總](https://docs.aws.amazon.com/securityhub/latest/userguide/finding-aggregation.html)的文件。

管理員堆疊必須先完成部署，才能部署成員堆疊，以便從成員帳戶到中樞帳戶建立信任關係。

成員堆疊必須部署到您想要修復問題清單的每個帳戶和區域。這可能包括您先前部署 ASR Admin 堆疊的 Security Hub 委派管理員帳戶。自動化文件必須在成員帳戶中執行，才能使用 SSM Automation 的免費方案。

使用上述範例，如果您想要修復所有帳戶和區域的調查結果，成員堆疊必須部署到所有三個帳戶 (`111111111111`、 `222222222222`和 `333333333333`) 和兩個區域 (`us-east-1` 和 `us-west-2`)。

成員角色堆疊必須部署到每個帳戶，但它包含每個帳戶只能部署一次的全域資源 (IAM 角色）。您部署成員角色堆疊的區域並不重要，因此為了簡單起見，我們建議部署到部署管理員堆疊的相同區域。

使用上述範例，我們建議將成員角色堆疊部署到 中的所有三個帳戶 (`111111111111`、 `222222222222`和 `333333333333`)`us-east-1`。

## 決定如何部署每個堆疊
<a name="deciding-how-to-deploy-each-stack"></a>

部署堆疊的選項為
+ CloudFormation StackSet （自我管理許可）
+ CloudFormation StackSet （服務受管許可）
+ CloudFormation 堆疊

具有服務管理許可的 StackSets 是最方便的，因為它們不需要部署您自己的角色，並且可以自動部署到組織中的新帳戶。很抱歉，此方法不支援巢狀堆疊，我們在 Admin 堆疊和成員堆疊中使用。以這種方式部署的唯一堆疊是成員角色堆疊。

請注意，部署到整個組織時，組織管理帳戶不會包含在內，因此如果您想要修復組織管理帳戶中的問題清單，您必須分別部署到此帳戶。

成員堆疊必須部署到每個帳戶和區域，但無法使用具有服務受管許可的 StackSets 部署，因為它包含巢狀堆疊。因此，我們建議您使用具有自我管理許可的 StackSets 部署此堆疊。

管理員堆疊只會部署一次，因此可以部署為純 CloudFormation 堆疊，或在單一帳戶和區域中部署為具有自我管理許可的 StackSet。

## 合併的控制問題清單
<a name="consolidated-controls-findings"></a>

您可以在 Security Hub 的合併控制調查結果功能開啟或關閉的情況下設定組織中的帳戶。請參閱《*AWS Security Hub 使用者指南*》中的[合併控制問題](https://docs.aws.amazon.com/securityhub/latest/userguide/controls-findings-create-update.html#consolidated-control-findings)清單。

**重要**  
啟用此功能時，您必須使用解決方案 2.0.0 版或更新版本，並在管理員和成員堆疊中啟用「SC」（安全控制） 手冊。這些堆疊會部署使用合併控制 IDs 所需的自動化文件。使用合併控制調查結果時，您不需要為個別標準 （例如 AWS FSBP) 部署堆疊。

## 中國部署
<a name="china-deployment"></a>

解決方案確實支援在中國區域部署，但**您必須使用下列啟動按鈕在中國區域進行一鍵式部署，而不是本指南其他章節中提供的啟動按鈕。**如果您在中國區域部署 ，則使用本指南中後續章節提供的「啟動解決方案」按鈕將無法運作。您仍然可以從任何 S3 儲存貯體連結下載範本，並透過上傳範本檔案來部署堆疊。
+  **automated-security-response-admin.template**：

 [https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide](https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide) 
+  **automated-security-response-member-roles.template**：

 [https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide](https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide) 
+  **automated-security-response-member.template**：

 [https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide](https://cn-north-1.console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3---cn-north-1.amazonaws.com.rproxy.govskope.us.cn%2Fsolutions-reference-cn%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide) 

## GovCloud (US) 部署
<a name="govcloud-deployment"></a>

解決方案確實支援在 GovCloud (US) 區域中部署，但**您必須在 GovCloud (US) 區域中的一鍵式部署使用下列啟動按鈕，而不是本指南其他章節中提供的啟動按鈕。**如果您在 GovCloud (US) 區域中部署 ，則使用本指南中後續章節提供的「啟動解決方案」按鈕將無法運作。您仍然可以從任何 S3 儲存貯體連結下載範本，並透過上傳範本檔案來部署堆疊。
+  **automated-security-response-admin.template**：

 [https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide) 
+  **automated-security-response-member-roles.template**：

 [https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide) 
+  **automated-security-response-member.template**：

 [https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3.us-gov-west-1.amazonaws.com%2Fsolutions-reference-us-gov%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide) 

# AWS CloudFormation 範本
<a name="aws-cloudformation-template"></a>

 [https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template) **automated-security-response-admin.template** - 使用此範本啟動 AWS 解決方案上的自動安全回應。範本會安裝解決方案的核心元件、AWS Step Functions 日誌的巢狀堆疊，以及您選擇的每個安全標準的一個巢狀堆疊。

使用的服務包括 Amazon Simple Notification Service、AWS Key Management Service、AWS Identity and Access Management、AWS Lambda、AWS Step Functions、Amazon CloudWatch Logs、Amazon S3 和 AWS Systems Manager。

## 管理員帳戶支援
<a name="admin-account-support"></a>

下列範本安裝在 AWS Security Hub 管理員帳戶中，以開啟您要支援的安全標準。您可以在安裝 時選擇要安裝的下列哪些範本`automated-security-response-admin.template`。

 **automated-security-response-orchestrator-log.template** - 為 Orchestrator Step Function 建立 CloudWatch 日誌群組。

 **automated-security-response-webui-nested-stack.template** - 建立資源以支援解決方案的 Web UI。

 **AFSBPStack.template** - AWS Foundational Security 最佳實務 1.0.0 版規則。

 **CIS120Stack.template** - CIS Amazon Web Services Foundations 基準測試，1.2.0 版規則。

 **CIS140Stack.template** - CIS Amazon Web Services Foundations 基準測試，1.4.0 版規則。

 **CIS300Stack.template** - CIS Amazon Web Services Foundations 基準測試，3.0.0 版規則。

 **PCI321Stack.template** - PCI-DSS 3.2.1 版規則。

 **NISTStack.template** - 國家標準技術研究所 (NIST)，5.0.0 版規則。

 **SCStack.template** - 安全控制 v2.0.0 規則。

## 成員角色
<a name="member-roles"></a>

 [https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member-roles.template](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member-roles.template) **automated-security-response-member-roles.template** - 定義每個 AWS Security Hub 成員帳戶中所需的修復角色。

## 成員帳戶
<a name="member-accounts"></a>

 [https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member.template](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member.template) **automated-security-response-member.template** - 在您設定核心解決方案，在每個 AWS Security Hub 成員帳戶 （包括管理員帳戶） 中安裝 AWS Systems Manager 自動化 Runbook 和許可後，請使用此範本。此範本可讓您選擇要安裝的安全標準手冊。

會根據您的選擇`automated-security-response-member.template`安裝下列範本：

 **automated-security-response-remediation-runbooks.template** - 一或多個安全標準所使用的常見修補程式碼。

 **AFSBPMemberStack.template** - AWS Foundational Security Best Practices v1.0.0 設定、許可和修復 Runbook。

 **CIS120MemberStack.template** - CIS Amazon Web Services Foundations 基準測試、1.2.0 版設定、許可和修復執行手冊。

 **CIS140MemberStack.template** - CIS Amazon Web Services Foundations 基準測試、1.4.0 版設定、許可和修復執行手冊。

 **CIS300MemberStack.template** - CIS Amazon Web Services Foundations 基準測試、3.0.0 版設定、許可和修復 Runbook。

 **PCI321MemberStack.template** - PCI-DSS v3.2.1 設定、許可和修復 Runbook。

 **NISTMemberStack.template** - 國家標準技術研究所 (NIST)、5.0.0 版設定、許可和修復執行手冊。

 **SCMemberStack.template** - 安全控制設定、許可和修復 Runbook。

 **automated-security-response-member-cloudtrail.template** - 用於動作日誌功能，以追蹤和稽核 和 服務活動。

## 票證系統整合
<a name="ticket-system-integration"></a>

使用下列其中一個範本與您的票證系統整合。

 [https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/JiraBlueprintStack.template](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/JiraBlueprintStack.template) **JiraBlueprintStack.template** - 如果您使用 Jira 做為票證系統，請部署 。

 [https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/ServiceNowBlueprintStack.template](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/ServiceNowBlueprintStack.template) **ServiceNowBlueprintStack.template** - 如果您使用 ServiceNow 做為票證系統，請部署 。

如果您想要整合不同的外部票證系統，您可以使用其中一個堆疊做為藍圖，了解如何實作自己的自訂整合。

# 自動化部署 - StackSets
<a name="deployment-stackset"></a>

**注意**  
我們建議您使用 StackSets 部署 。不過，對於單一帳戶部署或測試或評估目的，請考慮[堆疊部署](deployment.md)選項。

啟動解決方案之前，請檢閱本指南中討論的架構、解決方案元件、安全性和設計考量事項。遵循本節中的step-by-step說明，設定解決方案並將其部署到您的 AWS Organizations。

 **部署時間：**每個帳戶約 30 分鐘，取決於 StackSet 參數。

## 先決條件
<a name="prerequisites-stackset"></a>

 [AWS Organizations](https://aws.amazon.com/organizations/) 可協助您集中管理多帳戶 AWS 環境和資源。StackSets 最適合與 AWS Organizations 搭配使用。

如果您先前已部署此解決方案的 v1.3.x 或更早版本，則必須解除安裝現有的解決方案。如需詳細資訊，請參閱[更新解決方案](update-the-solution.md)。

在部署此解決方案之前，請檢閱您的 AWS Security Hub 部署：
+ 您的 AWS Organization 中必須有委派的 Security Hub 管理員帳戶。
+ Security Hub 應設定為跨區域彙總問題清單。如需詳細資訊，請參閱《AWS Security Hub 使用者指南》中的[跨區域彙總問題](https://docs.aws.amazon.com/securityhub/latest/userguide/finding-aggregation.html)清單。
+ 您應該在擁有 AWS 用量的每個區域中為您的組織[啟用 Security Hub](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-prereq-config.html)。

此程序假設您有多個使用 AWS Organizations 的帳戶，並已委派 AWS Organizations 管理員帳戶和 AWS Security Hub 管理員帳戶。

 **請注意，此解決方案適用於 [AWS Security Hub 和 AWS Security Hub CSPM](https://docs.aws.amazon.com/securityhub/latest/userguide/what-are-securityhub-services.html)。**

## 部署概觀
<a name="deployment-overview-stackset"></a>

**注意**  
此解決方案的 StackSets 部署使用服務受管和自我管理 StackSets 的組合。自我管理的 StackSets 必須目前使用，因為它們使用巢狀 StackSets，服務管理的 StackSets 尚不支援。

從 AWS Organizations 中的委派管理員帳戶部署 StackSets。 [https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-cloudformation.html](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-cloudformation.html) AWS Organizations

**規劃**  
使用下列表單來協助 StackSets 部署。準備您的資料，然後在部署期間複製並貼上這些值。

```
AWS Organizations admin account ID: _______________
Security Hub admin account ID: _______________
CloudTrail Logs Group: ______________________________
Member account IDs (comma-separated list):
___________________,
___________________,
___________________,
___________________,
___________________
AWS Organizations OUs (comma-separated list):
___________________,
___________________,
___________________,
___________________,
___________________
```

 [（選用） 步驟 0：部署票證整合堆疊](#step-0-stackset) 
+ 如果您想要使用票證功能，請先將票證整合堆疊部署到您的 Security Hub 管理員帳戶。
+ 從此堆疊複製 Lambda 函數名稱，並將其做為管理員堆疊的輸入提供 （請參閱步驟 1)。

 [步驟 1：在委派的 Security Hub 管理員帳戶中啟動管理員堆疊](#step-1-stackset) 
+ 使用自我管理的 StackSet，在與 Security Hub 管理員位於相同區域的 AWS Security Hub 管理員帳戶中啟動 `automated-security-response-admin.template` AWS CloudFormation 範本。此範本使用巢狀堆疊。
+ 選擇要安裝的安全標準。根據預設，只會選取 SC （建議）。
+ 選擇要使用的現有 Orchestrator 日誌群組。`Yes` 如果先前安裝`SO0111-ASR- Orchestrator`已存在，請選取 。
+ 選擇是否啟用解決方案的 Web UI。如果您選擇啟用此功能，您也必須輸入要指派管理員角色的電子郵件地址。
+ 選取收集與解決方案運作狀態相關的 CloudWatch 指標的偏好設定。

如需自我管理 StackSets 的詳細資訊，請參閱《*AWS CloudFormation 使用者指南*》中的[授予自我管理許可](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html)。

 [步驟 2：在每個 AWS Security Hub 成員帳戶中安裝修復角色](#step-2-stackset) 

等待步驟 1 完成部署，因為步驟 2 中的範本參考步驟 1 建立的 IAM 角色。
+ 使用服務管理的 StackSet，在 `automated-security-response-member-roles.template` AWS Organizations 中每個帳戶中的單一區域中啟動 AWS CloudFormation 範本。 AWS Organizations
+ 選擇在新帳戶加入組織時自動安裝此範本。
+ 輸入您的 AWS Security Hub 管理員帳戶的帳戶 ID。
+ 輸入 的值`namespace`，此值將用於防止資源名稱與相同帳戶中的先前或並行部署發生衝突。輸入最多 9 個小寫英數字元的字串。

 [步驟 3：在每個 AWS Security Hub 成員帳戶和區域中啟動成員堆疊](#step-3-stackset) 
+ 使用自我管理的 StackSets，在 AWS Organization `automated-security-response-member.template` 中擁有相同 Security Hub 管理員管理之每個帳戶中 AWS 資源的所有區域中啟動 AWS CloudFormation 範本。
**注意**  
在服務受管 StackSets 支援巢狀堆疊之前，您必須為加入組織的任何新帳戶執行此步驟。
+ 選擇要安裝的 Security Standard 手冊。
+ 提供 CloudTrail 日誌群組的名稱 （由部分修復使用）。
+ 輸入您的 AWS Security Hub 管理員帳戶的帳戶 ID。
+ 輸入 的值`namespace`，此值將用於防止資源名稱與相同帳戶中的先前或並行部署發生衝突。輸入最多 9 個小寫英數字元的字串。這應該符合您為成員角色堆疊選取的`namespace`值，此外，命名空間值不需要為每個成員帳戶唯一。

## （選用） 步驟 0：啟動票證系統整合堆疊
<a name="step-0-stackset"></a>

1. 如果您想要使用票證功能，請先啟動個別的整合堆疊。

1. 選擇 Jira 或 ServiceNow 提供的整合堆疊，或使用它們做為藍圖，以實作您自己的自訂整合。

    **若要部署 Jira 堆疊**：

   1. 輸入堆疊的名稱。

   1. 將 URI 提供給 Jira 執行個體。

   1. 為您要傳送票證的 Jira 專案提供專案金鑰。

   1. 在 Secrets Manager 中建立新的金鑰/值秘密，該秘密會保存您的 Jira `Username`和 `Password`。
**注意**  
您可以選擇使用 Jira API 金鑰來取代您的密碼，方法是將您的使用者名稱提供為 `Username`，並將您的 API 金鑰提供為 `Password`。

   1. 新增此秘密的 ARN 做為堆疊的輸入。

       **提供堆疊名稱 Jira 專案資訊和 Jira API 登入資料。**  
![\[票證系統整合堆疊 jira\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-jira.png)

       **Jira 欄位組態**：

      部署 Jira 堆疊之後，您可以透過在 Lambda 函數上設定`JIRA_FIELDS_MAPPING`環境變數來自訂 Jira 票證欄位。此 JSON 字串會覆寫預設 Jira 票證欄位，且必須遵循 Jira API 欄位結構。

      當 `JIRA_FIELDS_MAPPING`為空或未指定欄位時的預設值：
      +  **優先順序**： `{"id": "3"}` （中等優先順序）
      +  **issuetype**： `{"id": "10006"}` （任務）
      +  **accountId**：使用 `GET /rest/api/2/myself` API 端點自動擷取

        具有自訂欄位的範例組態：

        ```
        {
          "reporter": {"accountId": "123456:494dcbff-1b80-482c-a89d-56ae81c145a4"},
          "priority": {"id": "1"},
          "issuetype": {"id": "10006"},
          "assignee": {"accountId": "123456:another-user-id"},
          "customfield_10001": "custom value"
        }
        ```

        常見的 Jira 欄位 IDs：
      +  **優先順序 IDs**：1 （最高）、2 （高）、3 （中）、4 （低）、5 （最低）
      +  **問題類型 ID**：依 Jira 專案而異 （例如 10006 for Task)
      +  **帳戶 ID**：格式化 `123456:494dcbff-1b80-482c-a89d-56ae81c145a4` 

        您可以使用 Jira REST API 尋找 Jira 欄位 IDs 和帳戶 IDs：
      +  `GET /rest/api/2/myself` 帳戶 ID 的
      +  `GET /rest/api/2/priority` 優先順序 IDs
      +  `GET /rest/api/2/project/{projectKey}` 適用於問題類型 IDs

        如需詳細資訊，請參閱 [Jira REST API v2 問題 POST 格式](https://developer.atlassian.com/server/jira/platform/rest/v10000/api-group-issue/#api-api-2-issue-post)。

         **若要部署 ServiceNow 堆疊**：

   1. 輸入堆疊的名稱。

   1. 提供 ServiceNow 執行個體的 URI。

   1. 提供您的 ServiceNow 資料表名稱。

   1. 在 ServiceNow 中建立 API 金鑰，並具有修改您要寫入之資料表的許可。

   1. 使用 金鑰在 Secrets Manager 中建立秘密，`API_Key`並提供秘密 ARN 做為堆疊的輸入。

       **提供堆疊名稱 ServiceNow 專案資訊和 ServiceNow API 登入資料。**  
![\[票證系統整合堆疊服務現在\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-servicenow.png)

       **若要建立自訂整合堆疊**：包含解決方案協調器 Step Functions 可以針對每個修復呼叫的 Lambda 函數。Lambda 函數應採用 Step Functions 提供的輸入，根據您的票證系統需求建構承載，並向您的系統提出建立票證的請求。

## 步驟 1：在委派的 Security Hub 管理員帳戶中啟動管理員堆疊
<a name="step-1-stackset"></a>

1. `automated-security-response-admin.template`使用您的 Security Hub 管理員帳戶啟動管理員[堆疊](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template) 。一般而言，單一區域中每個組織一個。由於此堆疊使用巢狀堆疊，您必須將此範本部署為自我管理的 StackSet。

### Parameters
<a name="parameters"></a>


| 參數 | 預設 | Description | 
| --- | --- | --- | 
|   **載入 SC 管理員堆疊**   |   `yes`   |  指定是否要安裝管理員元件以自動修復 SC 控制項。  | 
|   **載入 AFSBP Admin Stack**   |   `no`   |  指定是否要安裝管理員元件以自動修復 FSBP 控制項。  | 
|   **載入 CIS120 管理員堆疊**   |   `no`   |  指定是否要安裝管理員元件以自動修復 CIS120 控制項。  | 
|   **載入 CIS140 管理員堆疊**   |   `no`   |  指定是否要安裝管理員元件以自動修復 CIS140 控制項。  | 
|   **載入 CIS300 管理員堆疊**   |   `no`   |  指定是否要安裝管理員元件以自動修復 CIS300 控制項。  | 
|   **載入 PC1321 管理員堆疊**   |   `no`   |  指定是否要安裝管理員元件以自動修復 PC1321 控制項。  | 
|   **載入 NIST Admin Stack**   |   `no`   |  指定是否要安裝管理員元件以自動修復 NIST 控制項。  | 
|   **重複使用協調器日誌群組**   |   `no`   |  選取是否要重複使用現有的 `SO0111-ASR-Orchestrator` CloudWatch Logs 群組。這可簡化重新安裝和升級，而不會遺失先前版本的日誌資料。如果此帳戶中先前部署`Orchestrator Log Group`仍存在 ，`yes`請重複使用現有的`Orchestrator Log Group`選擇，否則為 `no`。如果您從比 v2.3.0 更舊的版本執行堆疊更新，請選擇 `no`   | 
|   **ShouldDeployWebUI**   |   `yes`   |  部署 Web UI 元件，包括 API Gateway、Lambda 函數和 CloudFront 分佈。選取「是」以啟用 Web 型使用者介面，以檢視問題清單和修復狀態。如果您選擇停用此功能，您仍然可以使用 Security Hub CSPM 自訂動作來設定自動修復並隨需執行修復。  | 
|   **AdminUserEmail**   |   *（選用輸入）*   |  初始管理員使用者的電子郵件地址。此使用者將擁有 ASR Web UI 的完整管理存取權。**只有在**啟用 Web UI 時才需要。  | 
|   **使用 CloudWatch 指標**   |   `yes`   |  指定是否啟用 CloudWatch 指標來監控解決方案。這會建立 CloudWatch Dashboard 來檢視指標。  | 
|   **使用 CloudWatch 指標警示**   |   `yes`   |  指定是否啟用解決方案的 CloudWatch 指標警示。這將為解決方案收集的特定指標建立警示。  | 
|   **RemediationFailureAlarmThreshold**   |   `5`   |  指定每個控制項 ID 修復失敗百分比的閾值。例如，如果您輸入 `5`，當控制 ID 在指定日期失敗超過 5% 的修復時，您會收到警示。 只有在警示建立時，此參數才會運作 （請參閱**使用 CloudWatch Metrics 警示**參數）。  | 
|   **EnableEnhancedCloudWatchMetrics**   |   `no`   |  如果 `yes`， 會建立其他 CloudWatch 指標，以個別追蹤 CloudWatch 儀表板上的所有控制項 IDs，並做為 CloudWatch 警示。 請參閱 [成本](cost.md#additional-cost-enhanced-metrics) 一節，了解這會產生的額外成本。  | 
|   **TicketGenFunctionName**   |   *（選用輸入）*   |  選用。如果您不想整合票證系統，請保留空白。否則，請從[步驟 0](deployment.md#step-0) 的堆疊輸出提供 Lambda 函數名稱，例如：`SO0111-ASR-ServiceNow-TicketGenerator`。  | 

 **設定 StackSet 選項** 

![\[設定堆疊集選項\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/configre-stackset-options.png)


1. 針對**帳戶號碼**參數，輸入 AWS Security Hub 管理員帳戶的帳戶 ID。

1. 針對**指定區域**參數，僅選取開啟 Security Hub 管理員的區域。請等待此步驟完成，再繼續步驟 2。

## 步驟 2：在每個 AWS Security Hub 成員帳戶中安裝修補角色
<a name="step-2-stackset"></a>

使用服務管理的 StackSets 來部署[成員角色範本](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member-roles.template) `automated-security-response-member-roles.template`。此 StackSet 必須部署在每個成員帳戶的一個區域中。它定義了允許從 ASR Orchestrator 步驟函數進行跨帳戶 API 呼叫的全域角色。

### Parameters
<a name="parameters-2"></a>


| 參數 | 預設 | Description | 
| --- | --- | --- | 
|   **命名空間**   |   *需要輸入*   |  輸入最多 9 個小寫英數字元的字串。要新增為修補 IAM 角色名稱尾碼的唯一命名空間。相同的命名空間應該用於成員角色和成員堆疊。對於每個解決方案部署，此字串應該是唯一的，但不需要在堆疊更新期間變更。命名空間值**不需要**每個成員帳戶是唯一的。  | 
|   **Sec Hub 帳戶管理員**   |   *需要輸入*   |  輸入 AWS Security Hub 管理員帳戶的 12 位數帳戶 ID。此值會將許可授予管理員帳戶的解決方案角色。  | 

1. 根據您的組織政策，部署到整個組織 （典型） 或組織單位。

1. 開啟自動部署，讓 AWS Organizations 中的新帳戶收到這些許可。

1. 針對**指定區域**參數，選取單一區域。IAM 角色是全域的。您可以在此 StackSet 部署時繼續執行步驟 3。

    **指定 StackSet 詳細資訊**   
![\[指定堆疊集詳細資訊\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/specify-stackset-details.png)

## 步驟 3：在每個 AWS Security Hub 成員帳戶和區域中啟動成員堆疊
<a name="step-3-stackset"></a>

由於[成員堆疊](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member.template)使用巢狀堆疊，您必須部署為自我管理的 StackSet。這不支援自動部署到 AWS Organization 中的新帳戶。

### Parameters
<a name="parameters"></a>


| 參數 | 預設 | Description | 
| --- | --- | --- | 
|   **提供用於建立指標篩選條件和警示的 LogGroup 名稱**   |   *需要輸入*   |  指定 CloudTrail 記錄 API 呼叫的 CloudWatch CloudWatch Logs 群組名稱。這用於 CIS 3.1-3.14 修復。  | 
|   **載入 SC 成員堆疊**   |   `yes`   |  指定是否要安裝成員元件以自動修復 SC 控制項。  | 
|   **載入 AFSBP 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 FSBP 控制項。  | 
|   **載入 CIS120 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 CIS120 控制項。  | 
|   **載入 CIS140 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 CIS140 控制項。  | 
|   **載入 CIS300 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 CIS300 控制項。  | 
|   **載入 PC1321 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 PC1321 控制項。  | 
|   **載入 NIST 成員堆疊**   |   `no`   |  指定是否要安裝成員元件以自動修復 NIST 控制項。  | 
|   **為 Redshift 稽核記錄建立 S3 儲存貯體**   |   `no`   |  選取`yes`是否應為 FSBP RedShift.4 修復建立 S3 儲存貯體。如需 S3 儲存貯體和修復的詳細資訊，請參閱《*AWS Security Hub 使用者指南*》中的 [Redshift.4 修復](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp-controls.html#fsbp-redshift-4)。  | 
|   **Sec Hub 管理員帳戶**   |   *需要輸入*   |  輸入 AWS Security Hub 管理員帳戶的 12 位數帳戶 ID。  | 
|   **命名空間**   |   *需要輸入*   |  輸入最多 9 個小寫英數字元的字串。此字串會成為 IAM 角色名稱和動作日誌 S3 儲存貯體的一部分。針對成員堆疊部署和成員角色堆疊部署使用相同的值。每個解決方案部署的字串應該是唯一的，但不需要在堆疊更新期間變更。  | 
|   **EnableCloudTrailForASRActionLog**   |   `no`   |  `yes` 如果您想要監控 CloudWatch 儀表板上解決方案執行的管理事件，請選取 。解決方案會在您選取 的每個成員帳戶中建立 CloudTrail 追蹤`yes`。您必須將解決方案部署到 AWS 組織，才能啟用此功能。**此外，您只能在相同帳戶中的單一區域中啟用此功能。**請參閱 [成本](cost.md#additional-cost-action-log) 一節，以了解這會產生的額外成本。  | 

 **帳戶** 

![\[帳戶\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/accounts.png)


 **部署位置**：您可以指定帳戶號碼或組織單位的清單。

 **指定區域**：選取您要修復問題清單的所有區域。您可以根據帳戶和區域的數目適當調整部署選項。區域並行可以是平行的。

# 自動化部署 - Stacks
<a name="deployment"></a>

**注意**  
對於多帳戶客戶，我們強烈建議[使用 StackSets 部署](deployment-stackset.md)。

啟動解決方案之前，請檢閱本指南中討論的架構、解決方案元件、安全性和設計考量事項。遵循本節中的step-by-step說明，設定解決方案並將其部署至您的帳戶。

 **部署時間：**約 30 分鐘

## 先決條件
<a name="prerequisites"></a>

部署此解決方案之前，請確定 AWS Security Hub 與您的主要和次要帳戶位於相同的 AWS 區域。如果您先前已部署此解決方案，則必須解除安裝現有的解決方案。如需詳細資訊，請參閱[更新解決方案](update-the-solution.md)。

## 部署概觀
<a name="deployment-overview"></a>

使用下列步驟在 AWS 上部署此解決方案。

 [（選用） 步驟 0：啟動票證系統整合堆疊](#step-0) 
+ 如果您想要使用票證功能，請先將票證整合堆疊部署到您的 Security Hub 管理員帳戶。
+ 從此堆疊複製 Lambda 函數名稱，並將其做為管理員堆疊的輸入提供 （請參閱步驟 1)。

 [步驟 1：啟動管理員堆疊](#step-1) 
+ 在您的 `automated-security-response-admin.template` AWS Security Hub 管理員帳戶中啟動 AWS CloudFormation 範本。
+ 選擇要安裝的安全標準。
+ 選擇要使用的現有 Orchestrator 日誌群組 (`Yes`如果先前安裝`SO0111-ASR-Orchestrator`已存在，請選取此選項）。

 [步驟 2：在每個 AWS Security Hub 成員帳戶中安裝修復角色](#step-2) 
+ 在每個成員帳戶的一個區域中啟動 `automated-security-response-member-roles.template` AWS CloudFormation 範本。
+ 輸入 AWS Security Hub 管理員帳戶的 12 位數帳戶 IG。

 [步驟 3：啟動成員堆疊](#step-3) 
+ 指定要與 CIS 3.1-3.14 修復搭配使用的 CloudWatch Logs 群組名稱。它必須是接收 CloudTrail 日誌的 CloudWatch Logs 日誌群組的名稱。 CloudTrail 
+ 選擇是否要安裝修復角色。每個帳戶只能安裝這些角色一次。
+ 選取要安裝的手冊。
+ 輸入 AWS Security Hub 管理員帳戶的帳戶 ID。

 [步驟 4：（選用） 調整可用的補救措施](#step-4) 
+ 根據每個成員帳戶移除任何修補。此為選擇性步驟。

## （選用） 步驟 0：啟動票證系統整合堆疊
<a name="step-0"></a>

1. 如果您想要使用票證功能，請先啟動個別的整合堆疊。

1. 選擇 Jira 或 ServiceNow 提供的整合堆疊，或使用它們做為藍圖，以實作您自己的自訂整合。

    **若要部署 Jira 堆疊**：

   1. 輸入堆疊的名稱。

   1. 將 URI 提供給 Jira 執行個體。

   1. 為您要傳送票證的 Jira 專案提供專案金鑰。

   1. 在 Secrets Manager 中建立新的金鑰/值秘密，該秘密會保留您的 Jira `Username`和 `Password`。
**注意**  
您可以選擇使用 Jira API 金鑰來取代您的密碼，方法是將您的使用者名稱提供為 `Username`，並將您的 API 金鑰提供為 `Password`。

   1. 新增此秘密的 ARN 做為堆疊的輸入。

       **「提供堆疊名稱 Jira 專案資訊和 Jira API 登入資料。**  
![\[票證系統整合堆疊 jira\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-jira.png)

       **Jira 欄位組態**：

      如需自訂 Jira 票證欄位的資訊，請參閱 [StackSet 部署步驟 0 ](deployment-stackset.md#step-0-stackset)中的 Jira 欄位組態一節。

       **若要部署 ServiceNow 堆疊**：

   1. 輸入堆疊的名稱。

   1. 提供 ServiceNow 執行個體的 URI。

   1. 提供您的 ServiceNow 資料表名稱。

   1. 在 ServiceNow 中建立 API 金鑰，並具有修改您要寫入之資料表的許可。

   1. 使用 金鑰在 Secrets Manager 中建立秘密，`API_Key`並提供秘密 ARN 做為堆疊的輸入。

       **提供堆疊名稱 ServiceNow 專案資訊和 ServiceNow API 登入資料。**  
![\[票證系統整合堆疊服務現在\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-servicenow.png)

       **若要建立自訂整合堆疊**：包含解決方案協調器 Step Functions 可以針對每個修復呼叫的 Lambda 函數。Lambda 函數應採用 Step Functions 提供的輸入，根據您的票證系統需求建構承載，並向您的系統提出建立票證的請求。

## 步驟 1：啟動管理員堆疊
<a name="step-1"></a>

**重要**  
此解決方案包含資料收集。我們使用這些資料更好地了解客戶使用此解決方案、相關服務和產品的方式。AWS 擁有透過此問卷收集的資料。資料收集受 [AWS 隱私權聲明](https://aws.amazon.com/privacy/)約束。

此自動化 AWS CloudFormation 範本會在 AWS 雲端中部署 AWS 解決方案上的自動化安全回應。啟動堆疊之前，您必須啟用 Security Hub 並完成[先決條件](#prerequisites)。

**注意**  
您必須負責執行此解決方案時所使用的 AWS 服務成本。如需詳細資訊，請參閱本指南中的[成本](cost.md)一節，並參閱此解決方案中使用的每個 AWS 服務的定價網頁。

1. 從目前設定 AWS Security Hub 的帳戶登入 AWS 管理主控台，並使用下面的按鈕啟動 `automated-security-response-admin.template` AWS CloudFormation 範本。

    [https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-admin&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-admin.template&redirectId=ImplementationGuide) 

   您也可以將[下載範本](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template)作爲自有實作的起點。

1. 根據預設，範本會在美國東部 （維吉尼亞北部） 區域啟動。若要在不同的 AWS 區域中啟動此解決方案，請使用 AWS 管理主控台導覽列中的區域選擇器。
**注意**  
此解決方案使用 AWS Systems Manager，目前僅適用於特定 AWS 區域。解決方案適用於所有支援此服務的 區域。如需各區域的最新可用性，請參閱 [AWS 區域服務清單](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/)。

1. 在**建立堆疊**頁面上，確認正確的範本 URL 位於 **Amazon S3 URL** 文字方塊中，然後選擇**下一步**。

1. 在**指定堆疊詳細資訊**頁面上，為您的解決方案堆疊指派名稱。如需有關命名字元限制的資訊，請參閱《*AWS Identity and Access Management *[使用者指南》中的 IAM 和 STS 限制](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html)。

1. 在**參數**頁面上，選擇**下一步**。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/deployment.html)

**注意**  
部署或更新解決方案的 CloudFormation 堆疊後，您必須在 Admin 帳戶中手動啟用自動修復。

1. 在 **Configure stack options** (設定堆疊選項) 頁面，選擇 **Next** (下一步)。

1. 在**檢視** 頁面上，檢視和確認的設定。勾選確認範本將建立 AWS Identity and Access Management (IAM) 資源的方塊。

1. 選擇 **Create stack** (建立堆疊) 以部署堆疊。

您可以在狀態欄的 AWS CloudFormation 主控台中檢視堆疊**的狀態**。您應該會在大約 15 分鐘內收到 CREATE\$1COMPLETE 狀態。

## 步驟 2：在每個 AWS Security Hub 成員帳戶中安裝修復角色
<a name="step-2"></a>

StackSet `automated-security-response-member-roles.template` 只能部署在每個成員帳戶的一個區域中。它定義了允許從 ASR Orchestrator 步驟函數進行跨帳戶 API 呼叫的全域角色。

1. 登入每個 AWS Security Hub 成員帳戶的 AWS 管理主控台 （包括管理員帳戶，也是成員）。選取按鈕以啟動 `automated-security-response-member-roles.template` AWS CloudFormation 範本。您也可以將[下載範本](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member-roles.template)作爲自有實作的起點。

    [https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-member-roles&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member-roles.template&redirectId=ImplementationGuide) 

1. 根據預設，範本會在美國東部 （維吉尼亞北部） 區域啟動。若要在不同的 AWS 區域中啟動此解決方案，請使用 AWS 管理主控台導覽列中的區域選擇器。

1. 在**建立堆疊**頁面上，確認正確的範本 URL 位於 Amazon S3 URL 文字方塊中，然後選擇**下一步**。

1. 在**指定堆疊詳細資訊**頁面上，為您的解決方案堆疊指派名稱。如需有關命名字元限制的資訊，請參閱《AWS Identity and Access Management 使用者指南》中的 IAM 和 STS 限制。

1. 在**參數**頁面上，指定下列參數，然後選擇下一步。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/deployment.html)

1. 在 **Configure stack options** (設定堆疊選項) 頁面，選擇 **Next** (下一步)。

1. 在**檢視** 頁面上，檢視和確認的設定。勾選確認範本將建立 AWS Identity and Access Management (IAM) 資源的方塊。

1. 選擇 **Create stack** (建立堆疊) 以部署堆疊。

   您可以在狀態欄的 AWS CloudFormation 主控台中檢視堆疊**的狀態**。您應該會在大約 5 分鐘內收到 CREATE\$1COMPLETE 狀態。您可以在此堆疊載入時繼續下一個步驟。

## 步驟 3：啟動成員堆疊
<a name="step-3"></a>

**重要**  
此解決方案包含資料收集。我們使用這些資料更好地了解客戶使用此解決方案、相關服務和產品的方式。AWS 擁有透過此問卷收集的資料。資料收集受 AWS 隱私權政策約束。

`automated-security-response-member` 堆疊必須安裝在每個 Security Hub 成員帳戶中。此堆疊會定義自動修復的 Runbook。每個成員帳戶的管理員可以控制可透過此堆疊進行哪些修補。

1. 登入每個 AWS Security Hub 成員帳戶的 AWS 管理主控台 （包括管理員帳戶，也是成員）。選取按鈕以啟動 `automated-security-response-member.template` AWS CloudFormation 範本。

    [https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=automated-security-response-on-aws-member&templateURL=https:%2F%2Fs3.amazonaws.com%2Fsolutions-reference%2Fautomated-security-response-on-aws%2Flatest%2Fautomated-security-response-member.template&redirectId=ImplementationGuide) 

您也可以[下載範本](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member.template)做為自有實作的起點。根據預設，範本會在美國東部 （維吉尼亞北部） 區域啟動。若要在不同的 AWS 區域中啟動此解決方案，請使用 AWS 管理主控台導覽列中的區域選擇器。

\$1

**注意**  
此解決方案使用 AWS Systems Manager，目前可在大多數 AWS 區域使用。解決方案適用於所有支援這些服務的 區域。如需各區域的最新可用性，請參閱 [AWS 區域服務清單](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/)。

1. 在**建立堆疊**頁面上，確認正確的範本 URL 位於 **Amazon S3 URL** 文字方塊中，然後選擇**下一步**。

1. 在**指定堆疊詳細資訊**頁面上，為您的解決方案堆疊指派名稱。如需有關命名字元限制的資訊，請參閱《*AWS Identity and Access Management *[使用者指南》中的 IAM 和 STS 限制](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html)。

1. 在**參數**頁面上，指定下列參數，然後選擇**下一步**。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/deployment.html)

1. 在 **Configure stack options** (設定堆疊選項) 頁面，選擇 **Next** (下一步)。

1. 在**檢視** 頁面上，檢視和確認的設定。勾選確認範本將建立 AWS Identity and Access Management (IAM) 資源的方塊。

1. 選擇 **Create stack** (建立堆疊) 以部署堆疊。

您可以在狀態欄的 AWS CloudFormation 主控台中檢視堆疊**的狀態**。您應該會在大約 15 分鐘內收到 CREATE\$1COMPLETE 狀態。

## 步驟 4：（選用） 調整可用的補救措施
<a name="step-4"></a>

如果您想要從成員帳戶移除特定修復，您可以透過更新安全標準的巢狀堆疊來執行此操作。為了簡化，巢狀堆疊選項不會傳播到根堆疊。

1. 登入 [AWS CloudFormation 主控台](https://console.aws.amazon.com/cloudformation/home)，然後選取巢狀堆疊。

1. 選擇**更新**。

1. 選取**更新巢狀堆疊**，然後選擇**更新堆疊**。

    **更新巢狀堆疊**   
![\[巢狀堆疊\]](http://docs.aws.amazon.com/zh_tw/solutions/latest/automated-security-response-on-aws/images/nested-stack.png)

1. 選取**使用目前範本**，然後選擇**下一步**。

1. 調整可用的補救措施。將所需控制項的值變更為 `Available`，並將不需要的控制項變更為 `Not available`。
**注意**  
關閉修補會移除安全標準和控制項的解決方案修補 Runbook。

1. 在 **Configure stack options** (設定堆疊選項) 頁面，選擇 **Next** (下一步)。

1. 在**檢視** 頁面上，檢視和確認的設定。勾選確認範本將建立 AWS Identity and Access Management (IAM) 資源的方塊。

1. 請選擇**更新堆疊**。

您可以在狀態欄的 AWS CloudFormation 主控台中檢視堆疊**的狀態**。您應該會在大約 15 分鐘內收到 CREATE\$1COMPLETE 狀態。

# Control Tower (CT) 部署
<a name="cfctdeployment"></a>

適用於 AWS Control Tower (CfCT) 的自訂指南適用於管理員、DevOps 專業人員、獨立軟體廠商、IT 基礎設施架構師，以及希望為其公司和客戶自訂和擴展其 AWS Control Tower 環境的系統整合商。它提供使用 CfCT 自訂套件自訂和擴展 AWS Control Tower 環境的相關資訊。

 **部署時間：**約 30 分鐘

## 先決條件
<a name="cfctprerequisites"></a>

部署此解決方案之前，請確保其適用於 **AWS Control Tower 管理員**。

當您準備好使用 AWS Control Tower 主控台或 APIs 設定登陸區域時，請遵循下列步驟：

若要開始使用 AWS Control Tower，請參閱：[AWS Control Tower 入門](https://docs.aws.amazon.com/controltower/latest/userguide/getting-started-with-control-tower.html) 

若要了解如何自訂您的登陸區域，請參閱：[自訂您的登陸區域](https://docs.aws.amazon.com/controltower/latest/userguide/customize-landing-zone.html) 

若要啟動和部署您的登陸區域，請參閱：[登陸區域部署指南](https://docs.aws.amazon.com/controltower/latest/userguide/deployment.html) 

## 部署概觀
<a name="cfctdeployment-overview"></a>

使用下列步驟在 AWS 上部署此解決方案。

 [步驟 1：建置和部署 S3 儲存貯體](#step-1-cfn) 

**注意**  
S3 儲存貯體組態 – 僅適用於 ADMIN。這是一次性設定步驟，不應由最終使用者重複執行。S3 儲存貯體存放部署套件，包括執行 ASR 所需的 AWS CloudFormation 範本和 Lambda 程式碼。這些資源是使用 CfCt 或 StackSet 部署。

**1. 設定 S3 儲存貯體**  
設定用於存放和提供部署套件的 S3 儲存貯體。

**2. 設定 環境**  
準備建置和部署程序所需的必要環境變數、登入資料和工具。

**3. 設定 S3 儲存貯體政策**  
定義並套用適當的儲存貯體政策，以控制存取和許可。

**4. 準備組建**  
編譯、封裝或以其他方式準備您的應用程式或資產以進行部署。

**5. 將套件部署至 S3**  
將準備好的建置成品上傳至指定的 S3 儲存貯體。

 [步驟 2：堆疊部署至 AWS Control Tower](#step-2-cfn) 

**1. 建立 ASR 元件的建置資訊清單**  
定義組建資訊清單，列出所有 ASR 元件、其版本、相依性和組建指示。

**2. 更新 CodePipeline**  
修改 AWS CodePipeline 組態，以包含部署 ASR 元件所需的新建置步驟、成品或階段。

## 步驟 1：建置和部署至 S3 儲存貯體
<a name="step-1-cfn"></a>

AWS 解決方案使用兩個儲存貯體：透過 HTTPS 存取之範本的全域存取儲存貯體，以及存取區域內資產的區域儲存貯體，例如 Lambda 程式碼。

**1. 設定 S3 儲存貯體**  
選擇唯一的儲存貯體名稱，例如 asr-staging。在終端機上設定兩個環境變數，其中一個應該是 - 參考為尾碼的基本儲存貯體名稱，另一個是您預期部署區域的尾碼：

```
export BASE_BUCKET_NAME=asr-staging-$(date +%s)
export TEMPLATE_BUCKET_NAME=$BASE_BUCKET_NAME-reference
export REGION=us-east-1
export ASSET_BUCKET_NAME=$BASE_BUCKET_NAME-$REGION
```

**2. 環境設定**  
在您的 AWS 帳戶中，使用這些名稱建立兩個儲存貯體，例如 asr-staging-reference 和 asr-staging-us-east-1。（參考儲存貯體將保留 CloudFormation 範本，區域儲存貯體將保留所有其他資產，例如 lambda 程式碼套件。) 您的儲存貯體應該加密並不允許公開存取

```
aws s3 mb s3://$TEMPLATE_BUCKET_NAME/
aws s3 mb s3://$ASSET_BUCKET_NAME/
```

**注意**  
建立儲存貯體時，請確保它們不可公開存取。使用隨機儲存貯體名稱。停用公有存取。使用 KMS 加密。上傳之前，請確認儲存貯體擁有權。

**3. S3 儲存貯體政策設定**  
更新 \$1TEMPLATE\$1BUCKET\$1NAME S3 儲存貯體政策，以包含執行帳戶 ID 的 PutObject 許可。將此許可指派給執行帳戶中有權寫入儲存貯體的 IAM 角色。此設定可讓您避免在 管理帳戶中建立儲存貯體。

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::template-bucket-name/*",
                "arn:aws:s3:::template-bucket-name"
            ],
            "Condition": {
                "StringEquals": {
                    "aws:PrincipalOrgID": "org-id"
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:PutObject",
            "Resource": [
                "arn:aws:s3:::template-bucket-name/*",
                "arn:aws:s3:::template-bucket-name"
            ],
            "Condition": {
                "ArnLike": {
                    "aws:PrincipalArn": "arn:aws:iam::account-id:role/iam-role-name"
                }
            }
        }
    ]
}
```

修改資產 S3 儲存貯體政策以包含許可。將此許可指派給執行帳戶中有權寫入儲存貯體的 IAM 角色。為每個區域資產儲存貯體 （例如 asr-staging-us-east-1、asr-staging-eu-west-1 等） 重複此設定，允許跨多個區域部署，而無需在 管理帳戶中建立儲存貯體。

**4. 組建準備**
+ 事前準備：
  + AWS CLI v2
  + Python 3.11\$1 搭配 pip
  + AWS CDK 2.171.1\$1
  + Node.js 20\$1 搭配 npm
  + Poetry v2 搭配要匯出的外掛程式
+ Git 複製 [https://github.com/aws-solutions/automated-security-response-on-aws.git](https://github.com/aws-solutions/automated-security-response-on-aws.git) 

首先，請確定您已在來源資料夾中執行 npm 安裝。

在複製儲存庫的部署資料夾中，執行 build-s3-dist.sh，傳遞儲存貯體的根名稱 （例如 mybucket) 和您要建置的版本 （例如 v1.0.0)。我們建議根據從 GitHub 下載的版本 （例如 GitHub：v1.0.0，您的組建：v1.0.0.mybuild)

```
chmod +x build-s3-dist.sh
export SOLUTION_NAME=automated-security-response-on-aws
export SOLUTION_VERSION=v1.0.0.mybuild
./build-s3-dist.sh -b $BASE_BUCKET_NAME -v $SOLUTION_VERSION
```

 **5. 將套件部署至 S3** 

```
cd deployment
aws s3 cp global-s3-assets/  s3://$TEMPLATE_BUCKET_NAME/$SOLUTION_NAME/$SOLUTION_VERSION/ --recursive --acl bucket-owner-full-control
aws s3 cp regional-s3-assets/  s3://$ASSET_BUCKET_NAME/$SOLUTION_NAME/$SOLUTION_VERSION/ --recursive --acl bucket-owner-full-control
```

## 步驟 2：堆疊部署至 AWS Control Tower
<a name="step-2-cfn"></a>

**1. 為 ASR 元件建置資訊清單**  
將 ASR 成品部署至 S3 儲存貯體之後，請更新 Control Tower [管道資訊清單](https://docs.aws.amazon.com/controltower/latest/userguide/cfcn-byo-customizations.html)以參考新版本，然後觸發管道執行，請參閱：[Controltower 部署](https://docs.aws.amazon.com/controltower/latest/userguide/deployment.html) 

**重要**  
若要確保 ASR 解決方案的正確部署，請參閱官方 AWS 文件，以取得 CloudFormation 範本概觀和參數描述的詳細資訊。以下資訊連結：[CloudFormation 範本](https://docs.aws.amazon.com/en_us/solutions/latest/automated-security-response-on-aws/aws-cloudformation-template.html)[參數概觀指南](https://docs.aws.amazon.com/solutions/latest/automated-security-response-on-aws/deployment.html) 

ASR 元件的資訊清單如下所示：

```
region: us-east-1 #<HOME_REGION_NAME>
version: 2021-03-15

# Control Tower Custom CloudFormation Resources
resources:
  - name: <ADMIN STACK NAME>
    resource_file: s3://<ADMIN TEMPLATE BUCKET path>
    parameters:
      - parameter_key: UseCloudWatchMetricsAlarms
        parameter_value: "yes"
      - parameter_key: TicketGenFunctionName
        parameter_value: ""
      - parameter_key: ShouldDeployWebUI
        parameter_value: "yes"
      - parameter_key: AdminUserEmail
        parameter_value: "<YOUR EMAIL ADDRESS>"
      - parameter_key: LoadSCAdminStack
        parameter_value: "yes"
      - parameter_key: LoadCIS120AdminStack
        parameter_value: "no"
      - parameter_key: LoadCIS300AdminStack
        parameter_value: "no"
      - parameter_key: UseCloudWatchMetrics
        parameter_value: "yes"
      - parameter_key: LoadNIST80053AdminStack
        parameter_value: "no"
      - parameter_key: LoadCIS140AdminStack
        parameter_value: "no"
      - parameter_key: ReuseOrchestratorLogGroup
        parameter_value: "yes"
      - parameter_key: LoadPCI321AdminStack
        parameter_value: "no"
      - parameter_key: RemediationFailureAlarmThreshold
        parameter_value: "5"
      - parameter_key: LoadAFSBPAdminStack
        parameter_value: "no"
      - parameter_key: EnableEnhancedCloudWatchMetrics
        parameter_value: "no"
    deploy_method: stack_set
    deployment_targets:
     accounts: # :type: list
        - <ACCOUNT_NAME> # and/or
        - <ACCOUNT_NUMBER>
    regions:
      - <REGION_NAME>

  - name:  <ROLE MEMBER STACK NAME>
    resource_file: s3://<ROLE MEMBER TEMPLATE BUCKET path>
    parameters:
      - parameter_key: SecHubAdminAccount
        parameter_value: <ADMIN_ACCOUNT_NAME>
      - parameter_key: Namespace
        parameter_value: <NAMESPACE>
    deploy_method: stack_set
    deployment_targets:
      organizational_units:
        - <ORG UNIT>

  - name:  <MEMBER STACK NAME>
    resource_file: s3://<MEMBER TEMPLATE BUCKET path>
    parameters:
      - parameter_key: SecHubAdminAccount
        parameter_value: <ADMIN_ACCOUNT_NAME>
      - parameter_key: LoadCIS120MemberStack
        parameter_value: "no"
      - parameter_key: LoadNIST80053MemberStack
        parameter_value: "no"
      - parameter_key: Namespace
        parameter_value: <NAMESPACE>
      - parameter_key: CreateS3BucketForRedshiftAuditLogging
        parameter_value: "no"
      - parameter_key: LoadAFSBPMemberStack
        parameter_value: "no"
      - parameter_key: LoadSCMemberStack
        parameter_value: "yes"
      - parameter_key: LoadPCI321MemberStack
        parameter_value: "no"
      - parameter_key: LoadCIS140MemberStack
        parameter_value: "no"
      - parameter_key: EnableCloudTrailForASRActionLog
        parameter_value: "no"
      - parameter_key: LogGroupName
        parameter_value: <LOG_GROUP_NAME>
      - parameter_key: LoadCIS300MemberStack
        parameter_value: "no"
    deploy_method: stack_set
    deployment_targets:
     accounts: # :type: list
        - <ACCOUNT_NAME> # and/or
        - <ACCOUNT_NUMBER>
    organizational_units:
      - <ORG UNIT>
    regions: # :type: list
      - <REGION_NAME>
```

**2. 程式碼管道更新**  
將資訊清單檔案新增至 custom-control-tower-configuration.zip 並執行 CodePipeline，請參閱：[程式碼管道概觀](https://docs.aws.amazon.com/controltower/latest/userguide/cfct-codepipeline-overview.html) 