查找使用 .net SDK 运行服务的当前 IAM 用户?
我们有一项服务将使用 AWS SDK 来使用 AWS 服务。我们希望记录服务运行时使用的 IAM 用户和/或角色,以便在调试期间和登录生产时一目了然,从而阐明安全性是如何工作的。
在开发人员计算机上,应用程序可能正在使用开发人员密钥运行,然后代码可能会发挥作用。但在生产中,该服务将在 EC2 实例上运行,该实例将分配有角色。我们想记录服务的运行方式,但我找不到任何有关检测正在运行代码的用户和/或角色的参考。
有什么想法吗?
We have a service that is going to be using AWS services using the AWS SDK. We would like to log what IAM User and or Role that the service is running under so it is clear during debugging and when logging in production to clarify how security is working.
On developer machines, it's likely that the application is running using the developers keys, and the code will likely then assume a role. In production though, the service will be running on an EC2 instance which will have a role assigned to it. We would like to log how the service is running, but I could not find any reference to detecting the user and or role that code is running on.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用sts getCallerIntientity api call。
Use the STS GetCallerIdentity API call.