查找使用 .net SDK 运行服务的当前 IAM 用户?

发布于 2025-01-20 13:32:59 字数 234 浏览 0 评论 0原文

我们有一项服务将使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凡尘雨 2025-01-27 13:32:59

使用sts getCallerIntientity api call。

Use the STS GetCallerIdentity API call.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文