

# SEC08-BP03 自动执行静态数据保护
<a name="sec_protect_data_rest_automate_protection"></a>

 使用自动化技术来验证和执行静态数据控制。 使用自动扫描功能来检测数据存储解决方案的错误配置，并在可能的情况下通过自动程序化响应进行修复。 在 CI/CD 流程中融入自动化功能，以便在数据存储部署到生产环境之前检测出错误配置。

 **期望结果：**自动化系统对数据存储位置进行扫描和监控，防止出现控制措施配置错误、未经授权的访问和意外使用。 检测到配置错误的存储位置后，自动修复措施就会启动。 自动化流程可创建数据备份，并在原始环境之外存储不可更改的副本。

 **常见反模式：**
+  在支持的情况下，不考虑通过默认设置启用加密的选项。
+  在制定自动备份和恢复策略时，除操作事件外，不考虑安全事件。
+  不对存储服务执行公共访问设置。
+  不监控和审计保护静态数据的控制措施。

 **建立此最佳实践的好处：**自动化有助于防止错误配置数据存储位置的风险。这有助于防止错误配置进入生产环境。这种最佳实践还有助于在发生错误配置时进行检测和修复。  

 **在未建立这种最佳实践的情况下暴露的风险等级：**中 

## 实施指导 
<a name="implementation-guidance"></a>

 自动化是整个静态数据保护实践的主题。[SEC01-BP06 自动部署标准安全控制措施](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_securely_operate_automate_security_controls.html)介绍如何使用*基础设施即代码*（IaC）模板（例如 [AWS CloudFormation](https://aws.amazon.com/cloudformation/)）捕获资源配置。 这些模板已提交到版本控制系统，并用于通过 CI/CD 管道在 AWS 上部署资源。 这些技术同样适用于自动配置数据存储解决方案，如 Amazon S3 存储桶的加密设置。  

 您可以在 CI/CD 管道中使用 [AWS CloudFormation Guard](https://docs.aws.amazon.com/cfn-guard/latest/ug/what-is-guard.html) 中的规则，来检查您在 IaC 模板中定义的设置是否存在配置错误。 您可以使用 [AWS Config](https://aws.amazon.com/config/) 监控 CloudFormation 或其它 IaC 工具中尚未提供的设置，以防配置错误。 如 [SEC04-BP04 启动对不合规资源的修复](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_detect_investigate_events_noncompliant_resources.html)中所述，Config 针对错误配置生成的警报可自动修复。

 将自动化功能融入权限管理策略，也是自动化数据保护不可或缺的组成部分。[SEC03-BP02 授予最低访问权限](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_permissions_least_privileges.html)和 [SEC03-BP04 持续减少权限](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_permissions_continuous_reduction.html)描述了如何配置最低权限访问策略，这些策略会受到 [AWS Identity and Access Management Access Analyzer](https://aws.amazon.com/iam/access-analyzer/) 的持续监控，以便得出何时可以减少权限的调查发现。 除了监控权限的自动化功能之外，您还可以配置 [Amazon GuardDuty](https://aws.amazon.com/guardduty/) 以监控 [EBS 卷](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-ec2.html)（通过 EC2 实例）、[S3 存储桶](https://docs.aws.amazon.com/guardduty/latest/ug/s3-protection.html)和受支持的 [Amazon Relational Database Service 数据库](https://docs.aws.amazon.com/guardduty/latest/ug/rds-protection.html)的异常数据访问行为。

 在检测敏感数据何时存储在未经授权的位置时，自动化功能也能发挥作用。[SEC07-BP03 自动识别和分类](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_data_classification_auto_classification.html)描述了 [Amazon Macie](https://aws.amazon.com/macie/) 如何监控您的 S3 存储桶中是否存在意外敏感数据，并生成可启动自动响应的警报。

 按照 [REL09 备份数据](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/back-up-data.html)中的做法，制定自动数据备份和恢复策略。对于从安全事件中恢复和从操作事件中恢复，备份数据和恢复数据同样重要。

### 实施步骤
<a name="implementation-steps"></a>

1.  在 IaC 模板中捕获数据存储配置。 在 CI/CD 管道中使用自动检查来检测错误配置。

   1.  您可以使用 [CloudFormation](https://aws.amazon.com/cloudformation/) 来处理 IaC 模板，并使用 [CloudFormation Guard](https://docs.aws.amazon.com/cfn-guard/latest/ug/what-is-guard.html) 来检查模板是否存在配置错误。

   1.  使用 [AWS Config](https://aws.amazon.com/config/) 以主动评估模式运行规则。使用此设置可在创建资源前，检查资源作为 CI/CD 管道中的一个步骤的合规性。

1.  监控资源中是否存在数据存储配置错误。

   1.  设置 [AWS Config](https://aws.amazon.com/config/) 以监控数据存储资源中控制措施配置的变化，并在检测到错误配置时生成警报，以便调用修复措施。

   1.  有关自动修复的更多指导，请参见 [SEC04-BP04 启动对不合规资源的修复](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_detect_investigate_events_noncompliant_resources.html)。

1.  通过自动化功能持续监控和减少数据访问权限。

   1.  [IAM Access Analyzer](https://aws.amazon.com/iam/access-analyzer/) 可持续运行，在权限可能减少时发出警报。

1.  监控异常数据访问行为并发出警报。

   1.  [GuardDuty](https://aws.amazon.com/guardduty/) 可监控已知威胁特征，还监控 EBS 卷、S3 存储桶和 RDS 数据库等数据存储资源的基线访问行为偏差。

1.  对存储在意外位置的敏感数据进行监控并发出警报。

   1.  使用 [Amazon Macie](https://aws.amazon.com/macie/) 持续扫描 S3 存储桶，查找敏感数据。

1.  自动对数据进行安全加密备份。

   1.  [AWS Backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html) 是一项托管服务，可为 AWS 上的各种数据来源创建加密和安全的备份。 [弹性灾难恢复](https://aws.amazon.com/disaster-recovery/)允许您复制完整的服务器工作负载，并保持持续的数据保护，恢复点目标（RPO）以秒为单位。 您可以配置这两项服务，使之协同工作，从而自动创建数据备份并复制到失效转移位置。 这有助于在受到操作或安全事件影响时保持数据可用。

## 资源
<a name="resources"></a>

 **相关最佳实践：**
+  [SEC01-BP06 自动部署标准安全控制措施](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_securely_operate_automate_security_controls.html) 
+  [SEC03-BP02 授予最低访问权限](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_permissions_least_privileges.html) 
+  [SEC03-BP04 持续减少权限](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_permissions_continuous_reduction.html) 
+  [SEC04-BP04 启动对不合规资源的修复](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_detect_investigate_events_noncompliant_resources.html) 
+  [SEC07-BP03 自动识别和分类](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_data_classification_auto_classification.html) 
+  [REL09-BP02 保护并加密备份](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_backing_up_data_secured_backups_data.html) 
+  [REL09-BP03 自动执行数据备份](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_backing_up_data_automated_backups_data.html) 

 **相关文档：**
+  [AWS Prescriptive Guidance: Automatically encrypt existing and new Amazon EBS volumes](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/automatically-encrypt-existing-and-new-amazon-ebs-volumes.html) 
+  [Ransomware Risk Management on AWS Using the NIST Cyber Security Framework (CSF)](https://docs.aws.amazon.com/whitepapers/latest/ransomware-risk-management-on-aws-using-nist-csf/ransomware-risk-management-on-aws-using-nist-csf.html) 

 **相关示例：**
+  [How to use AWS Config proactive rules and AWS CloudFormation Hooks to prevent creation of noncompliant cloud resources](https://aws.amazon.com/blogs/mt/how-to-use-aws-config-proactive-rules-and-aws-cloudformation-hooks-to-prevent-creation-of-non-complaint-cloud-resources/) 
+  [Automate and centrally manage data protection for Amazon S3 with AWS Backup](https://aws.amazon.com/blogs/storage/automate-and-centrally-manage-data-protection-for-amazon-s3-with-aws-backup/) 
+  [AWS re:Invent 2023 - Implement proactive data protection using Amazon EBS snapshots](https://www.youtube.com/watch?v=d7C6XsUnmHc) 
+  [AWS re:Invent 2022 - Build and automate for resilience with modern data protection](https://www.youtube.com/watch?v=OkaGvr3xYNk) 

 **相关工具：**
+  [AWS CloudFormation Guard](https://docs.aws.amazon.com/cfn-guard/latest/ug/what-is-guard.html) 
+  [AWS CloudFormation Guard 规则注册表](https://github.com/aws-cloudformation/aws-guard-rules-registry) 
+  [IAM Access Analyzer](https://aws.amazon.com/iam/access-analyzer/) 
+  [Amazon Macie](https://aws.amazon.com/macie/) 
+  [AWS Backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html) 
+  [弹性灾难恢复](https://aws.amazon.com/disaster-recovery/) 