

# 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/)) 擷取資源的組態。 這些範本已遞交至版本控制系統中，且用於在 AWS 上透過 CI/CD 管道部署資源。 這些技術同樣適用於自動化資料儲存解決方案的組態，例如 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 工具中提供的設定，以檢查是否有組態錯誤。 Config 針對錯誤組態所產生的提醒可以自動修復，如 [SEC04-BP04 針對不合規資源實施補救措施](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_detect_investigate_events_noncompliant_resources.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)中說明了如何設定最低權限存取權政策，這些政策會受到 [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 方案指引：自動加密現有和新的 Amazon EBS 磁碟區](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/automatically-encrypt-existing-and-new-amazon-ebs-volumes.html) 
+  [在 AWS 上使用 NIST 網路安全架構 (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) 

 **相關範例：**
+  [如何使用 AWS Config 主動式規則和 AWS CloudFormation 勾點來防止建立不合規的雲端資源](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/) 
+  [使用 AWS Backup 自動化並集中管理 Amazon S3 的資料保護](https://aws.amazon.com/blogs/storage/automate-and-centrally-manage-data-protection-for-amazon-s3-with-aws-backup/) 
+  [AWS re:Invent 2023 - 使用 Amazon EBS 快照實作主動式資料保護](https://www.youtube.com/watch?v=d7C6XsUnmHc) 
+  [AWS re:Invent 2022 - 利用現代化資料保護建置並自動化以強化恢復能力](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/) 