

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 自动部署-堆栈
<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 CloudFormation 模板启动到您的 AWS Security Hub 管理员账户。
+ 选择要安装的安全标准。
+ 选择要使用的现有 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 日志组的名称。它必须是接收 CloudWatch CloudTrail 日志的日志组的名称。
+ 选择是否安装修复角色。每个账户只能安装一次这些角色。
+ 选择要安装的剧本。
+ 输入 AWS Security Hub 管理员账户的账户 ID。

 [步骤 4：（可选）调整可用的补救措施](#step-4) 
+ 按每个成员账户删除所有补救措施。此为可选步骤。

## （可选）步骤 0：启动工单系统集成堆栈
<a name="step-0"></a>

1. 如果您打算使用票证功能，请先启动相应的集成堆栈。

1. 为 Jira 或选择提供的集成堆栈 ServiceNow，或者将其用作蓝图来实现您自己的自定义集成。

    **要部署 Jira 堆栈，**请执行以下操作：

   1. 输入堆栈的名称。

   1. 为您的 Jira 实例提供 URI。

   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_cn/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-jira.png)

       **Jira 字段配置**：

      有关自定义 Jira 工单字段的信息，请参阅部署[步骤 0 中的 Jira 字段配置部分。 StackSet ](deployment-stackset.md#step-0-stackset)

       **要部署 ServiceNow 堆栈，请执行**以下操作：

   1. 输入堆栈的名称。

   1. 提供您的 ServiceNow 实例的 URI。

   1. 提供您的 ServiceNow 表名。

   1. 在中创建 API 密钥，该密钥 ServiceNow 具有修改您要写入的表的权限。

   1. 使用密钥在 Secrets Manager 中创建密钥，`API_Key`然后将密钥 ARN 作为堆栈的输入提供给堆栈。

       **提供堆栈名称、 ServiceNow 项目信息和 ServiceNow API 凭证。**  
![\[票务系统集成堆栈服务now\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/ticket-system-integration-stack-servicenow.png)

       **要创建自定义集成堆栈，**请执行以下操作：添加一个 Lambda 函数，解决方案协调器 Step Functions 可以在每次修复中调用该函数。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. 在**创建堆栈**页面上，确认 **Amazon S3 URL 文本框中的模板 URL** 是否正确，然后选择**下一步**。

1. 在**指定堆栈详细信息**页面上，为您的解决方案堆栈分配一个名称。有关命名字符限制的信息，请参阅 AWS Identity an [d A *ccess 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_cn/solutions/latest/automated-security-response-on-aws/deployment.html)

**注意**  
部署或更新解决方案 CloudFormation 堆栈后，您必须在管理员帐户中手动启用自动修复。

1. 在**配置堆栈选项**页面上，请选择**下一步**。

1. 在**审核**页面上，审核并确认设置。选中确认模板将创建 AWS Identity and Access Management（AWS IAM）资源的复选框。

1. 选择 **Create stack（创建堆栈）**以部署堆栈。

您可以在 AWS CloudFormation 控制台的 “状态” 列中查看堆栈的**状态**。大约 15 分钟后，您应该会收到 “创建完成” 状态。

## 第 2 步：将修复角色安装到每个 AWS Security Hub 成员账户中
<a name="step-2"></a>

每个成员账户`automated-security-response-member-roles.template` StackSet 只能部署在一个区域。它定义了允许通过 ASR Orchestrator 步骤函数进行跨账户 API 调用的全局角色。

1. 登录每个 AWS Security Hub 成员账户（包括同时也是成员的管理员账户）的 AWS 管理控制台。选择按钮启动 A `automated-security-response-member-roles.template` WS 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. 在**创建堆栈**页面上，确认 Amazon S3 URL 文本框中的模板 URL 是否正确，然后选择**下一步**。

1. 在**指定堆栈详细信息**页面上，为您的解决方案堆栈分配一个名称。有关命名字符限制的信息，请参阅 AWS Identity and Access Management 用户指南中的 IAM 和 STS 限制。

1. 在 “**参数**” 页面上，指定以下参数并选择 “下一步”。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/deployment.html)

1. 在**配置堆栈选项**页面上，请选择**下一步**。

1. 在**审核**页面上，审核并确认设置。选中确认模板将创建 AWS Identity and Access Management（AWS IAM）资源的复选框。

1. 选择 **Create stack（创建堆栈）**以部署堆栈。

   您可以在 AWS CloudFormation 控制台的 “状态” 列中查看堆栈的**状态**。您将在大约 5 分钟后看到 CREATE\$1COMPLETE 状态。您可以在加载此堆栈时继续下一步。

## 步骤 3：启动成员堆栈
<a name="step-3"></a>

**重要**  
该解决方案包括数据收集。我们使用这些数据来更好地了解客户如何使用此解决方案以及相关服务和产品。通过此调查收集的数据归 AWS 所有，数据收集受 AWS 隐私政策的约束。

`automated-security-response-member`堆栈必须安装到每个 Security Hub 成员账户中。此堆栈定义了自动修复的运行手册。每个成员账户的管理员都可以通过此堆栈控制可用的补救措施。

1. 登录每个 AWS Security Hub 成员账户（包括同时也是成员的管理员账户）的 AWS 管理控制台。选择按钮启动 A `automated-security-response-member.template` WS 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. 在**创建堆栈**页面上，确认 **Amazon S3 URL 文本框中的模板 URL** 是否正确，然后选择**下一步**。

1. 在**指定堆栈详细信息**页面上，为您的解决方案堆栈分配一个名称。有关命名字符限制的信息，请参阅 AWS Identity an [d A *ccess 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_cn/solutions/latest/automated-security-response-on-aws/deployment.html)

1. 在**配置堆栈选项**页面上，请选择**下一步**。

1. 在**审核**页面上，审核并确认设置。选中确认模板将创建 AWS Identity and Access Management（AWS IAM）资源的复选框。

1. 选择 **Create stack（创建堆栈）**以部署堆栈。

您可以在 AWS CloudFormation 控制台的 “状态” 列中查看堆栈的**状态**。大约 15 分钟后，您应该会收到 “创建完成” 状态。

## 步骤 4：（可选）调整可用的补救措施
<a name="step-4"></a>

如果要从成员账户中删除特定的补救措施，可以通过更新安全标准的嵌套堆栈来实现。为简单起见，嵌套堆栈选项不会传播到根堆栈。

1. 登录 A [WS CloudFormation 控制台](https://console.aws.amazon.com/cloudformation/home)并选择嵌套堆栈。

1. 选择**更新**。

1. 选择 “**更新嵌套堆栈**”，然后选择 “**更新堆栈**”。

    **更新嵌套堆栈**   
![\[嵌套堆栈\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/nested-stack.png)

1. 选择 “**使用当前模板**”，然后选择 “**下一步**”。

1. 调整可用的补救措施。将所需控件的值更改为，将不需要`Available`的控件的值更改为。`Not available`
**注意**  
关闭补救措施会移除针对安全标准和控制的解决方案补救操作手册。

1. 在**配置堆栈选项**页面上，请选择**下一步**。

1. 在**审核**页面上，审核并确认设置。选中确认模板将创建 AWS Identity and Access Management（AWS IAM）资源的复选框。

1. 选择**更新堆栈**。

您可以在 AWS CloudFormation 控制台的 “状态” 列中查看堆栈的**状态**。大约 15 分钟后，您应该会收到 “创建完成” 状态。