

# SEC02-BP05 定期稽核和輪換登入資料
<a name="sec_identities_audit"></a>

 當您無法倚賴臨時登入資料且需要長期登入資料時，請稽核登入資料以確保定義的控制 (例如 多重要素驗證 (MFA)) 會定期強制執行、輪換，且具有適當的存取層級。定期驗證 (最好是透過自動化工具) 是確認強制執行正確的控制項的必要項目。若是人類身份，您應要求使用者定期變更密碼，並使用臨時登入資料淘汰存取金鑰。當您從 AWS Identity and Access Management (IAM) 使用者移至集中式身份時，可以 [產生登入資料報告 ](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)來稽核您的 IAM 使用者。我們也建議您在身份供應商中強制執行 MFA 設定。您可以設定 [AWS Config 規則](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) 來監控這些設定。若是機器身份，您應倚賴使用 IAM 角色的臨時登入資料。在無法執行此操作的情況下，需要頻繁稽核和輪換存取金鑰。

 **若未建立此最佳實務，暴露的風險等級為：** 中 

## 實作指引
<a name="implementation-guidance"></a>
+  定期稽核登入資料：使用登入資料報告和 Identify and Access Management (IAM) Access Analyzer，來稽核 IAM 登入資料和許可。 
  +  [IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html) 
  +  [獲取登入資料報告](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) 
  +  [實驗室：自動化 IAM 使用者清除](https://wellarchitectedlabs.com/Security/200_Automated_IAM_User_Cleanup/README.html?ref=wellarchitected-tool) 
+  使用存取層級來檢閱 IAM 許可：為了改善 AWS 帳戶的安全性，請定期檢閱和監控每個 IAM 政策。請確定您的政策授予僅執行必要動作所需的最低權限。 
  +  [使用存取層級來檢閱 IAM 許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#use-access-levels-to-review-permissions) 
+  考慮自動化 IAM 資源建立和更新：AWS CloudFormation 可以用來自動化 IAM 資源 (包括角色和政策) 的部署，以減少人為錯誤，因為範本可以進行驗證和進行版本控制。 
  +  [實驗室：IAM 群組和角色的自動部署](https://wellarchitectedlabs.com/Security/200_Automated_Deployment_of_IAM_Groups_and_Roles/README.html) 

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

 **相關文件：** 
+  [AWS Secrets Manager 入門](https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html) 
+  [IAM 最佳實務](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) 
+  [身份提供者與聯合](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html) 
+  [安全合作夥伴解決方案：存取與存取控制](https://aws.amazon.com/security/partner-solutions/#access-control) 
+  [暫時安全登入資料](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) 

 **相關影片：** 
+  [大規模管理、擷取和輪換密碼的最佳實務](https://youtu.be/qoxxRlwJKZ4) 
+  [使用 AWS IAM Identity Center 大規模管理使用者許可](https://youtu.be/aEIqeFCcK7E) 
+  [在每一層都能掌握身份](https://www.youtube.com/watch?v=vbjFjMNVEpc) 