AWS CreateAccessKey
Description
The following analytic identifies the creation of AWS IAM access keys by a user for another user, which can indicate privilege escalation. It leverages AWS CloudTrail logs to detect instances where the user creating the access key is different from the user for whom the key is created. This activity is significant because unauthorized access key creation can allow attackers to establish persistence or exfiltrate data via AWS APIs. If confirmed malicious, this could lead to unauthorized access to AWS services, data exfiltration, and long-term persistence in the environment.
Query · spl
`cloudtrail` eventName = CreateAccessKey userAgent !=console.amazonaws.com errorCode = success
| eval match=if(match(userIdentity.userName,requestParameters.userName),1,0)
| search match=0
| rename user_name as user
| stats count min(_time) as firstTime max(_time) as lastTime
BY signature dest user
user_agent src vendor_account
vendor_region vendor_product
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `aws_createaccesskey_filter`
Implementation guide
You must install splunk AWS add on and Splunk App for AWS. This search works with AWS CloudTrail logs.
Known false positives
- While this search has no known false positives, it is possible that an AWS admin has legitimately created keys for another user.
Analyst notes
Known false positives: While this search has no known false positives, it is possible that an AWS admin has legitimately created keys for another user.