Detection rules › Splunk

AWS CreateAccessKey

Status
production
Group by
aws::awsRegion, aws::recipientAccountId, aws::userAgent, dest, signature, src, user, vendor_product
Author
Bhavin Patel, Splunk
Source
github.com/splunk/security_content

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.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1136.003 Create Account: Cloud Account

Rules detecting the same action

Other rules on this platform that filter on the same API call or operation.

Rule body splunk

name: AWS CreateAccessKey
id: 2a9b80d3-6340-4345-11ad-212bf3d0d111
version: 11
creation_date: '2021-03-02'
modification_date: '2026-05-13'
author: Bhavin Patel, Splunk
status: production
type: Hunting
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.
data_source:
    - AWS CloudTrail CreateAccessKey
search: |-
    `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`
how_to_implement: 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.
references:
    - https://bishopfox.com/blog/privilege-escalation-in-aws
    - https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation-part-2/
analytic_story:
    - AWS IAM Privilege Escalation
asset_type: AWS Account
mitre_attack_id:
    - T1136.003
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: network
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1078/aws_createaccesskey/aws_cloudtrail_events.json
          sourcetype: aws:cloudtrail
          source: aws_cloudtrail
      test_type: unit

Stages and Predicates

Stage 1: search

`cloudtrail` eventName = CreateAccessKey userAgent !=console.amazonaws.com errorCode = success

Stage 2: eval

| eval match=if(match(userIdentity.userName,requestParameters.userName),1,0)
match =
1.1
-0(default)

Stage 3: search

| search match=0

Stage 4: rename

| rename user_name as user

Stage 5: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY signature dest user
       user_agent src vendor_account
       vendor_region vendor_product

Stage 6: search

| `security_content_ctime(firstTime)`

Stage 7: search

| `security_content_ctime(lastTime)`

Stage 8: search

| `aws_createaccesskey_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
errorCodeeq
  • success
eventNameeq
  • CreateAccessKey
matcheq
  • 0
sourcetypeeq
  • aws:cloudtrail
userAgentne
  • console.amazonaws.com