

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

# 部署解决方案
<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 堆栈提供模板中描述的资源。

为了使解决方案发挥作用，必须部署三个模板。首先，决定将模板部署到何处，然后决定如何部署模板。

本概述将描述模板以及如何决定将其部署在何处和如何部署。接下来的章节将详细说明如何将每个堆栈部署为堆栈或 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 的成员账户也已加入 [AWS Security Hub（非 CSPM](https://docs.aws.amazon.com/securityhub/latest/userguide/what-is-securityhub.html)）。AWS Security Hub CSPM 中聚合的区域也应与 AWS Security Hub（非 CSPM）中汇总的区域相匹配。

例如，一个组织拥有在区域运营的账户`us-west-2`，在区域`us-east-1`中拥有`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 管理堆栈的 Security Hub 委托管理员帐户。自动化文档必须在成员账户中执行，才能使用 SSM 自动化的免费套餐。

使用前面的示例，如果您要修复所有账户和区域的调查结果，则必须将成员堆栈部署到所有三个账户（`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 使用服务管理权限最为方便，因为它们不需要部署您自己的角色，并且可以自动部署到组织中的新帐户。不幸的是，此方法不支持嵌套堆栈，我们在管理堆栈和成员堆栈中都使用嵌套堆栈。唯一可以通过这种方式部署的堆栈是成员角色堆栈。

请注意，在部署到整个组织时，不包括组织管理帐户，因此，如果您要修复组织管理帐户中的调查结果，则必须单独部署到该帐户。

成员堆栈必须部署到每个账户和区域，但不能使用服务管理权限 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>

该解决方案确实支持在中国区域部署，**但是您必须使用以下 Launch 按钮在中国地区进行一键部署，而不是使用本指南其他部分中提供的启动按钮**。如果您在中国地区部署，则无法使用本指南后续章节中提供的 “启动解决方案” 按钮。您仍然可以从任何 S3 存储桶链接下载模板并通过上传模板文件来部署堆栈。
+  **automated-security-response-admin。模板**：

 [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**。模板：

 [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。模板**：

 [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 （美国）部署
<a name="govcloud-deployment"></a>

该解决方案确实支持在 GovCloud （美国）地区进行部署，但是**您必须使用以下 Launch 按钮在 GovCloud （美国）地区进行一键部署，而不是使用本指南其他部分中提供的启动按钮**。如果您在 GovCloud （美国）地区进行部署，则无法使用本指南后续章节中提供的 “启动解决方案” 按钮。您仍然可以从任何 S3 存储桶链接下载模板并通过上传模板文件来部署堆栈。
+  **automated-security-response-admin。模板**：

 [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**。模板：

 [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。模板**：

 [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>

 [![\[View Template\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/view-template.png)automated-security-response-admin](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template)**.template**-使用此模板启动 AWS 上的自动安全响应解决方案。该模板安装解决方案的核心组件、AWS Step Functions 日志的嵌套堆栈以及您选择激活的每个安全标准的一个嵌套堆栈。

使用的服务包括亚马逊简单通知服务、AWS 密钥管理服务、AWS 身份和访问管理、AWS Lambda、AWS Step Functions、亚马逊 CloudWatch 日志、亚马逊 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 函数创建 CloudWatch 日志组。

 **automated-security-response-webui-nested-stack.template**-创建资源以支持解决方案的 Web 用户界面。

 **AFSBPStack.template**-AWS 基础安全最佳实践 v1.0.0 规则。

 **CIS120Stack.Template**-独联体亚马逊 Web Services 基金会基准测试，v1.2.0 规则。

 **CIS140Stack.Template**-独联体亚马逊 Web Services Foundations 基准测试，v1.4.0 规则。

 **CIS300Stack.Template**-独联体亚马逊 Web Services Foundations 基准测试，v3.0.0 规则。

 **PCI321Stack.template**-PCI-DSS v3.2.1 规则。

 **NISTStack.template**-美国国家标准与技术研究院 (NIST)，v5.0.0 规则。

 **SCStack.template**-安全控制 v2.0.0 规则。

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

 [![\[View Template\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/view-template.png)automated-security-response-member](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member-roles.template)**-roles.templ** ate-定义每个 AWS Security Hub 成员账户所需的补救角色。

## 成员账户
<a name="member-accounts"></a>

 [![\[View Template\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/view-template.png)automated-security-response-member](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-member.template)**.templat** e-在设置核心解决方案后，使用此模板在每个 AWS Security Hub 成员账户（包括管理员账户）中安装 AWS Systems Manager 自动化运行手册和权限。此模板允许您选择要安装的安全标准手册。

将根据您的选择`automated-security-response-member.template`安装以下模板：

 **automated-security-response-remediation-runbooks.templat** e-一项或多项安全标准使用的常用补救代码。

 **AFSBPMemberStack.Template-** AWS 基础安全最佳实践 v1.0.0 设置、权限和补救运行手册。

 **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 版设置、权限和补救运行手册。

 **PCI321MemberStack.tem** plate-PCI-DSS v3.2.1 设置、权限和补救操作手册。

 **NISTMemberStack.Template**-美国国家标准与技术研究院 (NIST)，v5.0.0 设置、权限和补救运行手册。

 **SCMemberStack.Template**-安全控制设置、权限和补救操作手册。

 **automated-security-response-member-cloudtrail.temp** late-在操作日志功能中用于跟踪和审计以及服务活动。

## 票务系统集成
<a name="ticket-system-integration"></a>

使用以下模板之一与您的票务系统集成。

 [![\[View Template\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/view-template.png)JiraBlueprintStack](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/JiraBlueprintStack.template)**.template**-如果您使用 Jira 作为票务系统，请进行部署。

 [![\[View Template\]](http://docs.aws.amazon.com/zh_cn/solutions/latest/automated-security-response-on-aws/images/view-template.png)ServiceNowBlueprintStack](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/blueprints/ServiceNowBlueprintStack.template)**.template**-如果您 ServiceNow 用作票务系统，请进行部署。

如果您想集成不同的外部票务系统，则可以使用这两个堆栈中的任何一个作为蓝图，以了解如何实现自己的自定义集成。

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

**注意**  
我们建议使用进行部署 StackSets。但是，对于单账户部署或出于测试或评估目的，请考虑使用[堆栈部署](deployment.md)选项。

在启动解决方案之前，请查看本指南中讨论的架构、解决方案组件、安全性和设计注意事项。按照本节中的 step-by-step说明配置解决方案并将其部署到您的 AWS Organizations 中。

 **部署时间：**每个账户大约 30 分钟，具体取决于 StackSet 参数。

## 先决条件
<a name="prerequisites-stackset"></a>

 [AWS O](https://aws.amazon.com/organizations/) rganizations 可帮助您集中管理和管理您的多账户 AWS 环境和资源。 StackSets 最适合与 AWS Organiations 合作。

如果您之前部署过此解决方案的 1.3.x 或更早版本，则必须卸载现有解决方案。有关更多信息，请参阅[更新解决方案](update-the-solution.md)。

在部署此解决方案之前，请查看您的 AWS Security Hub 部署情况：
+ 您的 AWS 组织中必须有一个委托的 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管理尚不支持嵌套。

使用您的 StackSets AWS Organizati [ons 中的委托管理员账户](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-cloudformation.html)进行部署。

**规划**  
使用以下表格来帮助进行 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，将 `automated-security-response-admin.template` AWS CloudFormation 模板启动到您的 AWS Security Hub 管理员账户中，该账户与您的 Security Hub 管理员位于同一区域。此模板使用嵌套堆栈。
+ 选择要安装的安全标准。默认情况下，仅选择 SC（推荐）。
+ 选择要使用的现有 Orchestrator 日志组。`Yes`如果之前的安装中`SO0111-ASR- Orchestrator`已经存在，请选择此选项。
+ 选择是否启用解决方案的 Web UI。如果您选择启用此功能，则还必须输入要分配管理员角色的电子邮件地址。
+ 选择收集与解决方案运行状况相关的 CloudWatch 指标的首选项。

有关自我管理的更多信息 StackSets，请参阅 AW *S 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 CloudFormation 模板启动到您的 AWS Organizations 中每个账户的单个区域。
+ 选择在新账户加入组织时自动安装此模板。
+ 输入您的 AWS Security Hub 管理员账户的账户 ID。
+ 输入一个值，`namespace`该值将用于防止资源名称与同一个账户中的先前或并发部署发生冲突。输入最多 9 个小写字母数字字符的字符串。

 [步骤 3：将成员堆栈启动到每个 AWS Security Hub 成员账户和区域](#step-3-stackset) 
+ 使用自我管理 StackSets，将 `automated-security-response-member.template` AWS CloudFormation 模板启动到所有区域，在该区域中，您的 AWS 组织中的每个账户都有 AWS 资源，由同一 Security Hub 管理员管理。
**注意**  
在服务管理 StackSets 支持嵌套堆栈之前，您必须为加入组织的所有新帐户执行此步骤。
+ 选择要安装的安全标准攻略手册。
+ 提供 CloudTrail 日志组的名称（用于某些补救措施）。
+ 输入您的 AWS Security Hub 管理员账户的账户 ID。
+ 输入一个值，`namespace`该值将用于防止资源名称与同一个账户中的先前或并发部署发生冲突。输入最多 9 个小写字母数字字符的字符串。这应该与您为成员角色堆栈选择的`namespace`值相匹配，此外，每个成员账户的命名空间值不必是唯一的。

## （可选）步骤 0：启动工单系统集成堆栈
<a name="step-0-stackset"></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 堆栈后，您可以通过在 Lambda 函数上设置`JIRA_FIELDS_MAPPING`环境变量来自定义 Jira 工单字段。此 JSON 字符串会覆盖默认的 Jira 工单字段，并且必须遵循 Jira API 字段的结构。

      为空或未指定字段时的`JIRA_FIELDS_MAPPING`默认值：
      +  **优先级**:`{"id": "3"}`（中等优先级）
      +  **问题类型**:`{"id": "10006"}`（任务）
      +  **账户 ID**：使用 API 端点自动检索 `GET /rest/api/2/myself`

        带有自定义字段的配置示例：

        ```
        {
          "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）
      +  **账户 ID**：格式 `123456:494dcbff-1b80-482c-a89d-56ae81c145a4` 

        你可以 IDs 使用 Jira REST API 找到你的 Jira 字段 IDs 和账户：
      +  `GET /rest/api/2/myself`获取账户 ID
      +  `GET /rest/api/2/priority`优先考虑 IDs
      +  `GET /rest/api/2/project/{projectKey}`对于问题类型 IDs

        有关更多信息，请参阅 [Jira REST API v2 问题发布格式](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. 在中创建 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 步：在委派的 Security Hub 管理员账户中启动管理堆栈
<a name="step-1-stackset"></a>

1. 使用您的 Securit `automated-security-response-admin.template` y Hub 管理员帐户启动管理[堆栈](https://solutions-reference.s3.amazonaws.com/automated-security-response-on-aws/latest/automated-security-response-admin.template)。通常，在单个区域中每个组织一个。由于此堆栈使用嵌套堆栈，因此您必须将此模板部署为自 StackSet管理模板。

### 参数
<a name="parameters"></a>


| 参数 | 默认值 | 说明 | 
| --- | --- | --- | 
|   **加载 SC 管理堆栈**   |   `yes`   |  指定是否安装用于自动修复 SC 控件的管理组件。  | 
|   **加载 AFSBP 管理堆栈**   |   `no`   |  指定是否安装管理组件以自动修复 FSBP 控件。  | 
|   **加载 CIS120 管理堆栈**   |   `no`   |  指定是否安装管理组件以自动修复 CIS120 控件。  | 
|   **加载 CIS140 管理堆栈**   |   `no`   |  指定是否安装管理组件以自动修复 CIS140 控件。  | 
|   **加载 CIS300 管理堆栈**   |   `no`   |  指定是否安装管理组件以自动修复 CIS300 控件。  | 
|   **加载 PC1321 管理堆栈**   |   `no`   |  指定是否安装管理组件以自动修复 PC1321 控件。  | 
|   **加载 NIST 管理堆栈**   |   `no`   |  指定是否安装用于自动修复 NIST 控件的管理组件。  | 
|   **重用 Orchestrator 日志组**   |   `no`   |  选择是否重复使用现有的`SO0111-ASR-Orchestrator` CloudWatch 日志组。这简化了重新安装和升级，而不会丢失先前版本的日志数据。`yes`如果此账户中`Orchestrator Log Group`仍存在先前部署的现有`Orchestrator Log Group`选择，否则，请重复使用现有选择`no`。如果您要从 v2.3.0 之前的版本执行堆栈更新，请选择 `no`   | 
|   **ShouldDeployWeb用户界面**   |   `yes`   |  部署 Web 用户界面组件，包括 API Gateway、Lambda 函数和 CloudFront 分发。选择 “是” 以启用基于 Web 的用户界面，用于查看发现结果和补救状态。如果您选择禁用此功能，您仍然可以使用 Security Hub CSPM 自定义操作配置自动修复并按需运行修复。  | 
|   **AdminUserEmail**   |   *（可选输入）*   |  初始管理员用户的电子邮件地址。此用户将拥有对 ASR Web UI 的完全管理权限。**仅在启用 Web 用户界面时才**需要。  | 
|   **使用 CloudWatch 指标**   |   `yes`   |  指定是否启用用于监控解决方案的 CloudWatch 指标。这将创建一个用于查看指标的 CloudWatch 控制面板。  | 
|   **使用 CloudWatch 指标警报**   |   `yes`   |  指定是否为解决方案启用 CloudWatch 指标警报。这将为解决方案收集的某些指标创建警报。  | 
|   **RemediationFailureAlarmThreshold**   |   `5`   |  为每个控件 ID 指定修复失败百分比的阈值。例如，如果您输入`5`，则如果控制 ID 在给定日期失败超过 5% 的补救措施，则会收到警报。 此参数仅在创建警报后才起作用（请参阅**使用 CloudWatch 指标警报**参数）。  | 
|   **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_cn/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 调用的全局角色。

### 参数
<a name="parameters-2"></a>


| 参数 | 默认值 | 说明 | 
| --- | --- | --- | 
|   **命名空间**   |   *<Requires input>*   |  输入最多 9 个小写字母数字字符的字符串。将添加为修复 IAM 角色名称的后缀的唯一命名空间。成员角色和成员堆栈中应使用相同的命名空间。对于每个解决方案部署，此字符串应是唯一的，但在堆栈更新期间无需更改。每个成员账户的命名空间值**不**必是唯一的。  | 
|   **Sec Hub 账户管理员**   |   *<Requires input>*   |  输入 AWS Security Hub 管理员账户的 12 位数账户 ID。此值向管理员账户的解决方案角色授予权限。  | 

1. 根据您的组织政策，部署到整个组织（典型值）或组织单位。

1. 开启自动部署，这样 AWS Organizations 中的新账户就可以获得这些权限。

1. 在 “**指定区域**” 参数中，选择单个区域。IAM 角色是全球性的。 StackSet 部署期间，您可以继续执行步骤 3。

    **指定 StackSet 细节**   
![\[指定堆栈集详细信息\]](http://docs.aws.amazon.com/zh_cn/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 组织中的新账户。

### 参数
<a name="parameters"></a>


| 参数 | 默认值 | 说明 | 
| --- | --- | --- | 
|   **提供用于创建指标筛选器和警报的名称 LogGroup **   |   *<Requires input>*   |  指定用于记录 API 调用的 CloudWatch CloudTrail 日志组的名称。这用于 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 管理员账户**   |   *<Requires input>*   |  输入 AWS Security Hub 管理员账户的 12 位数账户 ID。  | 
|   **命名空间**   |   *<Requires input>*   |  输入最多 9 个小写字母数字字符的字符串。此字符串成为 IAM 角色名称和 Action Log S3 存储桶的一部分。对成员堆栈部署和成员角色堆栈部署使用相同的值。每个解决方案部署的字符串都应是唯一的，但在堆栈更新期间无需更改。  | 
|   **EnableCloudTrailForASRAction日志**   |   `no`   |  选择`yes`是否要在 CloudWatch 仪表板上监控解决方案执行的管理事件。该解决方案会在您选择的每个成员账户中创建一个 CloudTrail 跟踪`yes`。您必须将解决方案部署到 AWS 组织中才能启用此功能。**此外，您只能在同一个账户的单个地区启用此功能。**[要了解由此产生的额外成本，请参阅 “成本” 部分。](cost.md#additional-cost-action-log)  | 

 **账户** 

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


 **部署地点**：您可以指定账号或组织单位的列表。

 **指定区域**：选择要修复结果的所有区域。您可以根据账户数量和区域数量调整部署选项。区域并发可以是并行的。

# 自动部署-堆栈
<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 分钟后，您应该会收到 “创建完成” 状态。

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

AWS Control Tower 定制 (cfcT) 指南适用于想要为公司和客户定制和扩展 AWS Control Tower 环境的管理员、 DevOps 专业人士、独立软件供应商、IT 基础设施架构师和系统集成商。它提供了有关使用 CfCT 自定义包自定义和扩展 AWS Control Tower 环境的信息。

 **部署时间：**大约 30 分钟

## 先决条件
<a name="cfctprerequisites"></a>

在部署此解决方案之前，请确保它适用于 **AWS Control Tower 管理员**。

当您准备好使用 AWS Control Tower 控制台设置着陆区时 APIs，或者按照以下步骤操作：

要开始使用 AWS Control Tower，请参阅：[AWS 控制塔入门](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 存储桶配置-仅适用于管理员。这是一次性设置步骤，最终用户不应重复此步骤。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 Solutions 使用两个存储桶：一个用于全球访问模板的存储桶（通过 HTTPS 进行访问）和用于访问区域内资产（例如 Lambda 代码）的区域存储桶。

**1. 配置 S3 存储桶**  
选择一个唯一的存储桶名称，例如 asr-staging。在您的终端上设置两个环境变量，一个应该是基本存储桶名称，后缀为-reference，另一个应以您的预期部署区域作为后缀：

```
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 存储桶策略以包含 PutObject 执行账户 ID 的权限。将此权限分配给执行账户中有权写入存储桶的 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
  + 带有 pip 的 Python 3.11\$1
  + 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 install。

接下来，从克隆存储库的部署文件夹中运行 build-s3-dist.sh，传递存储桶的根名称（例如 mybucket）和您正在构建的版本（例如 v1.0.0）。我们建议根据下载的版本使用 semver 版本 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) 