ID | Technique | Tactic |
---|---|---|
T1078 | Valid Accounts | Defense Evasion |
Detection: ASL AWS CreateAccessKey
DEPRECATED DETECTION
This detection has been marked as deprecated by the Splunk Threat Research team. This means that it will no longer be maintained or supported. If you have any questions or concerns, please reach out to us at research@splunk.com.
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.
Search
1`amazon_security_lake` api.operation=CreateAccessKey http_request.user_agent!=console.amazonaws.com api.response.error=null
2| rename unmapped{}.key as unmapped_key , unmapped{}.value as unmapped_value
3| eval keyjoin=mvzip(unmapped_key,unmapped_value)
4| mvexpand keyjoin
5| rex field=keyjoin "^(?<key>[^,]+),(?<value>.*)$"
6| eval {key} = value
7| search responseElements.accessKey.userName = *
8| rename identity.user.name as identity_user_name, responseElements.accessKey.userName as responseElements_accessKey_userName
9| eval match=if(identity_user_name=responseElements_accessKey_userName,1,0)
10| search match=0
11| rename identity_user_name as identity.user.name , responseElements_accessKey_userName as responseElements.accessKey.userName
12| 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
13| `security_content_ctime(firstTime)`
14| `security_content_ctime(lastTime)`
15|`asl_aws_createaccesskey_filter`
Data Source
Name | Platform | Sourcetype | Source | Supported App |
---|---|---|---|---|
N/A | N/A | N/A | N/A | N/A |
Macros Used
Name | Value |
---|---|
amazon_security_lake | sourcetype=aws:cloudtrail:lake |
asl_aws_createaccesskey_filter | search * |
asl_aws_createaccesskey_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Risk Event | False |
Implementation
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
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
User $responseElements.accessKey.userName$ is attempting to create access keys for $responseElements.accessKey.userName$ from this IP $src_endpoint.ip$ | 63 | 70 | 90 |
References
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | Not Applicable | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | aws_asl |
aws:asl |
Integration | ✅ Passing | Dataset | aws_asl |
aws:asl |
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: GitHub | Version: 1