

# SEC03-BP07 分析公有和跨帳戶存取權
<a name="sec_permissions_analyze_cross_account"></a>

持續監控強調公有和跨帳戶存取權的問題清單。減少僅對需要此類存取之資源的公有存取權和跨帳戶存取權。

 **常見的反模式：** 
+  未遵循程序來管控跨帳戶的存取權以及資源的公有存取權。 

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

## 實作指引
<a name="implementation-guidance"></a>

在 AWS 中，您可以授予另一個帳戶中資源的存取權。您授予直接跨帳戶存取權，方法是使用附加至資源的政策 (例如，[Amazon Simple Storage Service (Amazon S3) 儲存貯體政策](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-policies.html)) 或透過允許某個身分在另一個帳戶中擔任 IAM 角色。使用資源政策時，確認將存取權授予貴組織中的身分，且您預計公開資源。定義程序，來核准所有需要公開提供的資源。

 [IAM Access Analyzer](https://aws.amazon.com/iam/features/analyze-access/) 使用 [可證明的安全](https://aws.amazon.com/security/provable-security/) ，來找出從其帳戶外部存取資源的所有路徑。其會持續審查資源政策，並報告公有和跨帳戶存取權的問題清單，讓您輕鬆分析可能的各種存取。考量使用 AWS Organizations 設定 IAM Access Analyzer，來確認您對所有帳戶的能見度。IAM Access Analyzer 也讓您能夠 [預覽 Access Analyzer 問題清單](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-access-preview.html)，然後再部署資源許可。這可讓您驗證政策變更是否僅授予對您資源的預期公有和跨帳戶存取權。預計授予多帳戶存取權時，您可以使用 [信任政策來控制在什麼情況下可以擔任角色](https://aws.amazon.com/blogs/security/how-to-use-trust-policies-with-iam-roles/)。例如，您可以將角色擔任限制在特定來源 IP 範圍。

 您也可以使用 [AWS Config，透過](https://docs.aws.amazon.com/config/latest/developerguide/operational-best-practices-for-Publicly-Accessible-Resources.html) AWS Config 政策檢查，報告和修復資源的任何意外公有存取組態。諸如 [AWS Control Tower](https://aws.amazon.com/controltower) 和 [AWS Security Hub CSPM](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp.html) 之類的服務可簡化 AWS Organizations 之間的部署檢查和防護機制，來找出和修復公開暴露的資源。例如，AWS Control Tower 具備受管的防護機制，可偵測是否 [所有 AWS 帳戶都可復原所有 Amazon EBS 快照](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html)。

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

 **相關文件：** 
+  [使用 AWS Identity and Access Management Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html?ref=wellarchitected)
+  [AWS Control Tower 中的防護機制](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html) 
+  [AWS 基礎安全最佳實務標準](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-fsbp.html)
+  [AWS Config 受管規則](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html) 
+  [AWS Trusted Advisor 檢查參考](https://docs.aws.amazon.com/awssupport/latest/user/trusted-advisor-check-reference.html) 

 **相關影片：** 
+ [保護多帳戶環境的最佳實務](https://www.youtube.com/watch?v=ip5sn3z5FNg)
+ [深入了解 IAM Access Analyzer](https://www.youtube.com/watch?v=i5apYXya2m0)