如何获取AWS IAM用户的控制台访问状态?boto3没有直接的程序用于此目的。

huangapple go评论66阅读模式
英文:

How do we get he console access status of an AWS IAM user? boto3 doesn't have a direct program for it?

问题

client = boto3.client("iam")

获取用户,但这里没有直接的功能来获取控制台访问的状态。我在这里寻找一个直接的函数:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html

英文:

client = boto3.client("iam")

gets the users but there is no direct function here to get the status of the console access

I am looking here for a direct function:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html

答案1

得分: 1

如果您指的是IAM用户登录到AWS Web控制台的访问权限,而不是其他类似创建SSH或SSM连接到EC2实例的能力,那么您需要使用get_login_profile

登录配置文件是在为用户创建密码以访问Amazon Web Services管理控制台时创建的。如果用户不存在或没有密码,该操作将返回404(NoSuchEntity)错误。

英文:

If you are referring to an IAM user's access to login to the AWS web console, and not something else such as the ability to create an SSH or SSM connection to an EC2 instance, then you are looking for get_login_profile.

> A login profile is created when you create a password for the user to access the Amazon Web Services Management Console. If the user does not exist or does not have a password, the operation returns a 404 ( NoSuchEntity) error.

答案2

得分: 0

使用 get_login_profile(),我可以检查控制台访问权限。这有点间接,只有具有控制台访问权限的用户才会收到此调用的响应,而其他用户会收到404错误,因为配置文件不会加载。

英文:

Using get_login_profile(), I am able to to check console access. It's somewhat indirect. Like only users with console access will get a response to this call, while others will get a 404 error since the profile won't be loaded.

huangapple
  • 本文由 发表于 2023年6月1日 01:39:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76376059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定