

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

# 自動化部署 - 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 狀態。