安全性与合规性
第 1 章 为基于 IP 的 AWS 角色假设添加额外的限制 复制链接链接已复制到粘贴板!
您可以在 AWS 帐户中实施额外的安全层,以防止有未列出的 IP 地址进行角色假设。
1.1. 创建基于身份的 IAM 策略 复制链接链接已复制到粘贴板!
您可以创建一个基于身份的 Identity and Access Management (IAM)策略,在请求源自红帽提供的 IP 地址时拒绝访问所有 AWS 操作。
先决条件
- 您可以使用创建和修改 IAM 策略所需的权限访问 AWS 管理控制台。
流程
- 使用您的 AWS 帐户凭证登录到 AWS 管理控制台。
- 进入 IAM 服务。
- 在 IAM 控制台中,从左侧导航菜单中选择 Policies。
- 点击 Create policy。
- 选择 JSON 选项卡,以使用 JSON 格式定义策略。
要获取您需要进入 JSON 策略文档的 IP 地址,请运行以下命令:
ocm get /api/clusters_mgmt/v1/trusted_ip_addresses
$ ocm get /api/clusters_mgmt/v1/trusted_ip_addresses
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意这些 IP 地址不是永久性的,可能随时更改。您必须持续检查 API 输出,并在 JSON 策略文档中进行必要的更新。
将以下
policy_document.json
文件复制并粘贴到编辑器中:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将在第 6 步中获得的所有 IP 地址复制并粘贴到
policy_document.json
文件中的"aws:SourceIp": []
数组中。 - 点 Review and create。
- 提供策略的名称和描述,并查看准确性的详细信息。
- 点 Create policy 保存策略。
条件键 aws:ViaAWSService
必须设为 false,以便后续调用根据初始调用成功。例如,如果您对 aws ec2 describe-instances
发出初始调用,则 AWS API 服务器中的所有后续调用都会检索附加到 ec2 实例的 EBS 卷的信息,如果条件键 aws:ViaAWSService
没有设置为 false,则会失败。后续的调用将失败,因为它们源自于 AllowList 中的 AWS IP 地址。
1.2. 附加基于身份的 IAM 策略 复制链接链接已复制到粘贴板!
创建基于身份的 IAM 策略后,将其附加到 AWS 帐户中的相关 IAM 用户、组或角色,以防止这些实体基于 IP 的角色假设。
流程
- 进入 AWS 管理控制台中的 IAM 控制台。
选择您要附加策略的默认 IAM
ManagedOpenShift-Support-Role
角色。注意您可以更改默认的 IAM
ManagedOpenShift-Support-Role
角色。有关角色的更多信息,请参阅 红帽支持访问。- 在 Permissions 选项卡中,从 Add Permissions 下拉列表中选择 Add Permissions 或 Create inline policy。
搜索您之前创建的策略:
- 输入策略名称。
- 根据适当的类别过滤。
- 选择策略并单击 Attach policy。
为确保基于 IP 的有效角色假设阻止,您必须将允许列表的 IP 保持最新状态。如果不这样做,可能会导致红帽站点可靠性工程(SRE)无法访问您的帐户并影响您的 SLA。如果您有进一步的问题或需要协助,请联系我们的支持团队。
Legal Notice
复制链接链接已复制到粘贴板!
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.