:warning: THIS IS A EXPERIMENTAL DETECTION

This detection has been marked experimental by the Splunk Threat Research team. This means we have not been able to test, simulate, or build datasets for this detection. Use at your own risk. This analytic is NOT supported.

Try in Splunk Security Cloud

Description

This detection rule monitors for the creation of AWS Identity and Access Management (IAM) access keys. An IAM access key consists of an access key ID and secret access key, which are used to sign programmatic requests to AWS services. While IAM access keys can be legitimately used by developers and administrators for API access, their creation can also be indicative of malicious activity. Attackers who have gained unauthorized access to an AWS environment might create access keys as a means to establish persistence or to exfiltrate data through the APIs. Moreover, because access keys can be used to authenticate with AWS services without the need for further interaction, they can be particularly appealing for bad actors looking to operate under the radar. Consequently, it's important to vigilantly monitor and scrutinize access key creation events, especially if they are associated with unusual activity or are created by users who don't typically perform these actions. This hunting query identifies when a potentially compromised user creates a IAM access key for another user who may have higher privilleges, which can be a sign for privilege escalation. Hunting queries are designed to be executed manual during threat hunting.

  • Type: Hunting
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2022-05-23
  • Author: Patrick Bareiss, Splunk
  • ID: ccb3e4af-23d6-407f-9842-a26212816c9e

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1078 Valid Accounts Defense Evasion, Persistence, Privilege Escalation, Initial Access
Kill Chain Phase
  • Exploitation
  • Installation
  • Delivery
NIST
  • DE.AE
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
`amazon_security_lake` api.operation=CreateAccessKey http_request.user_agent!=console.amazonaws.com api.response.error=null 
| rename unmapped{}.key as unmapped_key , unmapped{}.value as unmapped_value 
| eval keyjoin=mvzip(unmapped_key,unmapped_value) 
| mvexpand keyjoin 
| rex field=keyjoin "^(?<key>[^,]+),(?<value>.*)$" 
| eval {key} = value 
| search responseElements.accessKey.userName = * 
| rename identity.user.name as identity_user_name, responseElements.accessKey.userName as responseElements_accessKey_userName 
| eval match=if(identity_user_name=responseElements_accessKey_userName,1,0) 
| search match=0 
| rename identity_user_name as identity.user.name , responseElements_accessKey_userName as responseElements.accessKey.userName 
| stats count min(_time) as firstTime max(_time) as lastTime by responseElements.accessKey.userName api.operation api.service.name identity.user.account_uid identity.user.credential_uid identity.user.name identity.user.type identity.user.uid identity.user.uuid http_request.user_agent src_endpoint.ip 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
|`asl_aws_createaccesskey_filter`

Macros

The SPL above uses the following Macros:

:information_source: asl_aws_createaccesskey_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • api.service.name
  • api.operation
  • identity.user.account_uid
  • identity.user.credential_uid
  • identity.user.name
  • identity.user.type
  • identity.user.uid
  • identity.user.uuid
  • http_request.user_agent
  • src_endpoint.ip
  • unmapped{}.key
  • unmapped{}.value

How To Implement

You must install Splunk Add-On for AWS Version v7.0.0 (https://splunkbase.splunk.com/app/1876) that includes includes a merge of all the capabilities of the Splunk Add-on for Amazon Security Lake. This search works with Amazon Security Lake logs which are parsed in the Open Cybersecurity Schema Framework (OCSF)format.

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.

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
63.0 70 90 User $responseElements.accessKey.userName$ is attempting to create access keys for $responseElements.accessKey.userName$ from this IP $src_endpoint.ip$

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Reference

Test Dataset

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 1