
Amazon Machine Image(AMI)是AWS环境中用于批量部署实例的镜像模板,通常包含操作系统、应用及环境配置。
攻击者可通过修改AMI的启动权限,将镜像共享给特定外部AWS账号,从而使其能够启动实例并直接访问AMI内全部内容。
这一过程无需下载镜像文件,操作隐蔽,常被用于绕过传统边界防护,实现数据的未授权获取。
编写检测规则识别将AMI共享给其他账户的行为。
数据源CloudTrail,数据样例:
{ "awsRegion": "ap-southeast-2", "eventCategory": "Management", "eventID": "1d52e5c9-9c38-4888-a654-d08b5d3aae77", "eventName": "ModifyImageAttribute", "eventSource": "ec2.amazonaws.com", "eventTime": "2025-06-11T09:14:18Z", "eventType": "AwsApiCall", "eventVersion": "1.10", "managementEvent": true, "readOnly": false, "recipientAccountId": "438465128930", "requestID": "d8f7f205-d93a-4bee-8f0e-6ba3dd524502", "requestParameters": { "attributeType": "launchPermission", "imageId": "ami-011213ff2fc95b6f6", "launchPermission": { "add": { "items": [ { "userId": "012345678901" } ] } } }, "responseElements": { "_return": true, "requestId": "d8f7f205-d93a-4bee-8f0e-6ba3dd524502" }, "sourceIPAddress": "103.40.79.131", "timestamp": "2025-06-11T09:33:21.144594", "tlsDetails": { "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "ec2.ap-southeast-2.amazonaws.com", "tlsVersion": "TLSv1.3" }, "userAgent": "stratus-red-team_9bccf2c3-1156-4233-b4a9-4a5651db8387", "userIdentity": { "accessKeyId": "AKIAWMFUO5HRKBD6JQ6D", "accountId": "438465128930", "arn": "arn:aws:iam::438465128930:user/soclabs-test", "principalId": "AIDAWMFUO5HRCBESZ467O", "type": "IAMUser", "userName": "soclabs-test" }}
没有找到匹配的字段