如果用户有两个访问键,我该如何检查AWS,如何确定其中一个已禁用的日期?
我正在尝试检查AWS如果用户有两个访问键,我想知道何时禁用其中一个密钥。
我已经尝试过:
import boto3
iam = boto3.client('iam')
for user in iam.list_users()['Users']:
print(user)
res = iam.list_access_keys(UserName=user['UserName'])
print(res)
但这并没有向我展示我需要的信息。
I'm trying to check in AWS if a user has two access keys, and I'd like to know when one of the keys was disabled.
I've tried:
import boto3
iam = boto3.client('iam')
for user in iam.list_users()['Users']:
print(user)
res = iam.list_access_keys(UserName=user['UserName'])
print(res)
But it doesn't show me the information I need.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试运行这些
awscli
命令:然后,
这将为您提供有关用户键的完整报告(上次访问,发行,旋转等)等等。
这是 report 的概述。
You could try running these
awscli
commands:And then
This will give you the full report on your user's keys (last accessed, issued, rotated etc.) and a lot more.
Here's an overview of what's in the report.
还有一个选项可以通过下载IAM凭据报告使用给定AWS帐户中所有用户的控制台查看信息。
该报告是您的IAM用户和根帐户的快照,其中包含有关安全凭据的详细信息,例如是否激活了MFA,直到最后旋转密码时,访问密钥1 /访问密钥2(如果有)。
参考文章
https://aws.amazon.com/blogs/security/new-inew-iam-quickly-isendify-when-an-an-access-key-was-was-last-used/
There is also an option to view the information using the console for all the users in a given AWS account by downloading the IAM credential report.
This report is a snapshot of your IAM users and root account, contains details about security credentials, such as whether MFA is activated, when passwords were last rotated, access key 1 / access key 2 if any.
Reference article
https://aws.amazon.com/blogs/security/new-in-iam-quickly-identify-when-an-access-key-was-last-used/