使用 AWS-SDK 访问 AWS SSO

Accessing AWS SSO using the AWS-SDK

有没有办法使用 AWS-SDK 与 AWS SSO 服务交互?

https://aws.amazon.com/single-sign-on/

我只是在寻找对 AWS SSO 的编程访问 - 使用 AWS CLI 或使用 SDK 或其他任何东西。

很遗憾,没有。然而,AWS CLI 上有一个未解决的问题 - 去那里投票,这可能是实现这一目标的唯一方法。

https://github.com/aws/aws-cli/issues/3447

您好,我还想指出这个工具:https://github.com/Noovolari/leapp/issues 通过透明地为您管理 AWS SSO 账户和角色,它帮助我们使用 AWS SSO 和一般临时凭证与任何一方工具,然后它在 .aws/credentials 中生成兼容的临时凭据,正如您期望任何第三方工具都能正常工作一样。

4/21/2021:查看 AWS SSO 文档。现在有一个 API 来管理权限集并将它们分配给用户:https://docs.aws.amazon.com/singlesignon/latest/APIReference/welcome.html

这是支持此 API 的有关此功能的博客: https://aws.amazon.com/blogs/security/use-new-account-assignment-apis-for-aws-sso-to-automate-multi-account-access/:

“AWS SSO 最近添加了 new account assignment APIs and AWS CloudFormation support to automate access assignment across AWS Organizations accounts. This release addressed feedback from our customers with multi-account environments who wanted to adopt AWS SSO, but faced challenges related to managing AWS account permissions. To automate the previously manual process and save your administration time, you can now use the new AWS SSO account assignment APIs 或 AWS CloudFormation 模板,以编程方式管理多账户环境中的 AWS 账户权限集。

借助 AWS SSO 账户分配 API,您现在可以构建自动化,为您的用户和组分配对 AWS 账户的访问权限。您还可以深入了解谁有权访问整个 AWS Organizations 结构中哪些账户的哪些权限集。"

我想分享我使用 docker 制作的这个工具。 https://hub.docker.com/r/javiortizmol/aws_sso_magic

图片包含:

  1. aws cli v2.
  2. Python3.9.
  3. aws-sso-魔法

或者直接从 pypi.org https://pypi.org/project/aws-sso-magic/

安装