本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
IAMAmazon OpenSearch Serverless 的身份中心支持
IAMAmazon OpenSearch Serverless 的身份中心支持
您可以使用IAM身份中心委托人(用户和群组)通过亚马逊应用程序访问亚马逊 OpenSearch 无服务器数据。 OpenSearch 要为 Amazon OpenSearch Serverless 启用IAM身份中心支持,您需要启用IAM身份中心的使用。要详细了解如何执行此操作,请参阅什么是IAM身份中心?
创建IAM身份中心实例后,客户账户管理员需要为 Amazon OpenSearch Serverless 服务创建IAM身份中心应用程序。这可以通过调用CreateSecurityConfig:来完成。客户账户管理员可以指定将使用哪些属性来授权请求。使用的默认属性是UserId
和 GroupId.
Amazon OpenSearch Serverless 的IAM身份中心集成使用以下 Amazon IAM身份中心 (IAM) 权限:
-
aoss:CreateSecurityConfig
— 创建IAM身份中心提供商 -
aoss:ListSecurityConfig
— 列出当前账户中的所有IAM身份中心提供商。 -
aoss:GetSecurityConfig
— 查看IAM身份中心提供商信息。 -
aoss:UpdateSecurityConfig
— 修改给定的IAM身份中心配置 -
aoss:DeleteSecurityConfig
— 删除IAM身份中心提供商。
以下基于身份的访问策略可用于管理所有 Identity Center IAM 配置:
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "aoss:CreateSecurityConfig", "aoss:DeleteSecurityConfig", "aoss:GetSecurityConfig", "aoss:UpdateSecurityConfig", "aoss:ListSecurityConfigs" ], "Effect": "Allow", "Resource": "*" } ] }
注意
该Resource
元素必须是通配符。
创建IAM身份中心提供商(控制台)
您可以创建IAM身份中心提供商以启用 OpenSearch应用程序身份验证。要为 OpenSearch 仪表板启用 Identity Center IAM 身份验证,请执行以下步骤:
-
在左侧导航面板上,展开无服务器并选择身份验证。
-
选择 “IAM身份中心身份验证”。
-
选择 “编辑”
-
选中 “通过身份中心进行身份验证” 旁边的IAM复选框。
-
从下拉菜单中选择用户和群组属性键。用户属性将用于根据
UserName
UserId
、和对用户进行授权Email
。组属性将用于根据GroupName
和对用户进行身份验证GroupId
。 -
选择IAM身份中心实例。
-
选择 “保存”
创建IAM身份中心提供商 (Amazon CLI)
要使用 Amazon Command Line Interface (Amazon CLI) 创建IAM身份中心提供商,请使用以下命令:
aws opensearchserverless create-security-config \ --region us-east-2 \ --name "iamidentitycenter-config" \ --description "description" \ --type "iamidentitycenter" \ --iam-identity-center-options '{ "instanceArn": "arn:aws:sso:::instance/ssoins-99199c99e99ee999", "userAttribute": "UserName", "groupAttribute": "GroupId" }'
启用IAM身份中心后,客户只能修改用户和群组的属性。
aws opensearchserverless update-security-config \ --region us-east-1 \ --id <id_from_list_security_configs> \ --config-version <config_version_from_get_security_config> \ --iam-identity-center-options-updates '{ "userAttribute": "UserId", "groupAttribute": "GroupId" }'
要使用查看IAM身份中心提供商 Amazon Command Line Interface,请使用以下命令:
aws opensearchserverless list-security-configs --type iamidentitycenter
删除IAM身份中心提供商
IAMIdentity Center 提供两个提供商实例,一个用于您的组织帐户,另一个用于您的成员帐户。如果您需要更改 Ident IAM ity Center 实例,则需要通过删除您的安全配置,DeleteSecurityConfig
API并使用新的 Ident IAM ity Center 实例创建新的安全配置。以下命令可用于删除IAM身份中心提供商:
aws opensearchserverless delete-security-config \ --region us-east-1 \ --id <id_from_list_security_configs>
授予IAM身份中心对集合数据的访问权限
启用 IAM Identity Center 提供商后,您可以更新集合数据访问策略以包括IAM身份中心委托人。 IAM需要按以下格式更新身份中心负责人:
[ { "Rules":[ ... ], "Principal":[ "iamidentitycenter/<iamidentitycenter-instance-id>/user/<UserName>", "iamidentitycenter/<iamidentitycenter-instance-id>/group/<GroupId>" ] } ]
注意
Amazon OpenSearch Serverless 仅支持一个IAM身份中心实例用于所有客户集合,并且单个用户最多可以支持 100 个群组。如果您尝试使用的实例数量超过允许的数量,则会遇到与数据访问策略授权处理不一致的问题,并会收到一条403
错误消息。
您可以授予针对集合、索引或两者的访问权限。如果您希望不同的用户拥有不同的权限,则需要创建多个规则。有关可用权限的列表,请参阅亚马逊 OpenSearch 服务中的 Identity and Access 管理。有关如何格式化访问策略的信息,请参阅向SAML身份授予对集合数据的访问权限。
IAMIdentity Center 提供两个提供商实例,一个用于您的组织帐户,另一个用于您的成员帐户。如果您需要更改 Ident IAM ity Center 实例,则需要通过删除您的安全配置,DeleteSecurityConfig
API并使用新的 Ident IAM ity Center 实例创建新的安全配置。以下命令可用于删除IAM身份中心提供商:
aws opensearchserverless delete-security-config \ --region us-east-1 \ --id <id_from_list_security_configs>