

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

# 使用服务控制策略在账户级别阻止访问互联网
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy"></a>

*Sergiy Shevchenko、Sean O'Sullivan 和 Victor Mazeo Whitaker，Amazon Web Services*

## Summary
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-summary"></a>

一般而言，组织都会希望限制本应保持私密的账户资源访问互联网。在这些账户中，虚拟私有云 (VPCs) 中的资源不应以任何方式访问互联网。许多组织选择采用[集中式检查架构](https://aws.amazon.com/blogs/networking-and-content-delivery/centralized-inspection-architecture-with-aws-gateway-load-balancer-and-aws-transit-gateway/)。对于集中式检查架构中的东西向（VPC 到 VPC）流量，必须确保分支账户及其资源无法访问互联网。对于南北向（互联网出口与本地网络）流量，仅允许通过检查 VPC 访问互联网。

此模式使用[服务控制策略（SCP）](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html)来协助阻止访问互联网。可以在账户或组织单元（OU）级别应用此 SCP。SCP 通过阻止以下情况来限制互联网连接：
+ 创建或连接允许直接通过 IPv6 [Internet 访问 VPC 的互联网网关 IPv4 ](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html)
+ 创建或接受可能允许通过其他 VPC 间接访问互联网的 [VPC 对等连接](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html)
+ 创建或更新可能允许通过 VPC 资源直接访问互联网的 [AWS Global Accelerator](https://docs.aws.amazon.com/global-accelerator/latest/dg/what-is-global-accelerator.html) 配置

## 先决条件和限制
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-prereqs"></a>

**先决条件**
+ 一个或多个作为组织在中进行 AWS 账户 管理 AWS Organizations。
+ [所有功能均已在中启用](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) AWS Organizations。
+ [SCPs 已在组织中启用](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_enable-disable.html)。
+ 拥有以下权限：
  + 访问组织的管理账户。
  + 创建 SCPs。有关最低权限的更多信息，请参阅[创建 SCP](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_create.html#create-an-scp)。
  + 将 SCP 附加到目标客户或组织单位 (OUs)。有关最低权限的更多信息，请参阅[附加和分离服务控制策略](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_attach.html)。

**限制**
+ SCPs 不要影响管理账户中的用户或角色。它们仅影响组织中的成员账户。
+ SCPs 仅影响由属于组织的账户管理的 AWS Identity and Access Management (IAM) 用户和角色。有关更多信息，请参阅 [SCP 对权限的影响](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html#scp-effects-on-permissions)。

## 工具
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-tools"></a>

**AWS 服务**
+ [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)是一项账户管理服务，可帮助您将多个账户整合 AWS 账户 到一个由您创建和集中管理的组织中。在此模式中，您可以在中使用[服务控制策略 (SCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) AWS Organizations。
+ [Amazon Virtual Private Cloud（亚马逊 VPC）](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)可帮助您将 AWS 资源启动到您定义的虚拟网络中。该虚拟网络类似于您在数据中心中运行的传统网络，并具有使用 AWS的可扩展基础设施的优势。

## 最佳实践
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-best-practices"></a>

在您的组织中建立此 SCP 后，请务必经常对其进行更新，以解决可能影响互联网访问的任何新功能 AWS 服务 或新功能。

## 操作说明
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-epics"></a>

### 创建和附加 SCP
<a name="create-and-attach-the-scp"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 创建 SCP。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/prevent-internet-access-at-the-account-level-by-using-a-service-control-policy.html) | AWS 管理员 | 
| 附加 SCP。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/prevent-internet-access-at-the-account-level-by-using-a-service-control-policy.html) | AWS 管理员 | 

## 相关资源
<a name="prevent-internet-access-at-the-account-level-by-using-a-service-control-policy-resources"></a>
+ [AWS Organizations 文档](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)
+ [服务控制策略 (SCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)
+ [使用 AWS Gateway Load Balancer 和 AWS Transit Gateway（AWS 博客文章）的集中检查架构](https://aws.amazon.com/blogs/networking-and-content-delivery/centralized-inspection-architecture-with-aws-gateway-load-balancer-and-aws-transit-gateway/)