哪些用户推出的EC2实例? [英] Which user launched EC2 instance?

查看:203
本文介绍了哪些用户推出的EC2实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些EC2实例,我真的不知道是谁发动了进攻。

有没有办法知道谁发动了具体的实例?

解决方案

不幸的是这些信息不能直接可以通过API调用 - 你现在有两个选择:

  1. 根据您的需求,您可以通过使用接近你的目标的<一个href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html"相对=nofollow> DescribeInstances API行动来看看键名用于启动该实例(如果有的话,它是可选的,但通常是在的地方) - 假设你遵循安全性的最佳实践,并使用专用的EC2密钥对每 IAM 用户(而非共享密钥),密钥通常应该代表谁开始的实例的用户;)
  2. 现在你可以激活 AWS CloudTrail ,其中的记录AWS API调用为您的帐户和提供日志文件,以你正好提供了你的信息后,

      

    所记录的信息包括了API调用者的身份,该   API调用的API调用者的源IP地址,时间   请求参数,以及由AWS返回的响应元素   服务。

  3.   
  AWS CloudTrail是一个早就应该和宝贵的工具,提供联合国precedented洞察您的AWS使用情况;很容易上手并只有少数剩余的注意事项目前:

I have some EC2 instances that I don't really know who launched them.

Is there a way to know who launched a specific instance?

解决方案

Unfortunately this information is not directly available via an API call - you currently have two options:

  1. depending on your needs, you could approximate your goal by using the DescribeInstances API action to look at the key-name used for starting that instance (if any, it's optional, though usually in place) - assuming you have followed security best practices and are using a dedicated EC2 key pair per IAM user (rather than sharing keys), the key should usually denote the user who started the instance ;)
  2. nowadays you could activate AWS CloudTrail, which records AWS API calls for your account and delivers log files to you and provides exactly the information you are after:

    The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service.

AWS CloudTrail is a long overdue and invaluable tool and provides unprecedented insight into your AWS usage; it is easy to get started and only has a few remaining caveats currently:

  • most importantly, it isn't available in all regions yet, but AWS has just extended it to 3 more for a total of 5, see AWS CloudTrail Expands Again - More Locations and Services, thus quickly approaching coverage of their entire Global Infrastructure
  • not all services are covered yet, but AWS hast just extended it to 7 more for a total of 15, see AWS CloudTrail Update - Seven New Services
  • depending on your needs, you most likely want to have a Logging as a Service (LaaS) solution in place to ease digging through the vast amount of logs, and provide alerts etc. - several providers already offer dedicated CloudTrail integration (and usually a free tier sufficient for that as well)
  • events are delivered within 15 minutes of the API call and the resulting logs to your S3 bucket approximately every 5 minutes, resulting in a maximum delay of 20 minutes, which is enough for post hoc and batch analysis, but not sufficient for near real-time alerting of course (see the AWS CloudTrail FAQ)

这篇关于哪些用户推出的EC2实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆