| ID | Technique | Tactic |
|---|---|---|
| T1078.004 | Cloud Accounts | Initial Access |
Detection: ASL AWS Create Policy Version to allow all resources
Description
The following analytic identifies successful AWS IAM CreatePolicy events containing an Allow statement specifying all actions and all resources. It analyzes Amazon Security Lake CloudTrail events and checks Effect="Allow", Action="", and Resource="" within the same policy statement. This behavior is significant because it may violate the principle of least privilege, potentially exposing the environment to misuse or abuse. Policy creation alone does not establish that the policy was attached or that the caller gained its permissions.
Search
1`amazon_security_lake`
2api.operation=CreatePolicy
3api.service.name=iam.amazonaws.com
4status=Success
5
6
7| spath input=api.request.data output=policy_document path=policyDocument
8
9| spath input=policy_document output=matching_statement path=Statement{}
10
11
12| mvexpand matching_statement
13
14
15| spath input=matching_statement output=statement_effect path=Effect
16
17
18| where statement_effect="Allow"
19
20
21| spath input=matching_statement output=statement_action path=Action
22
23| spath input=matching_statement output=statement_resource path=Resource
24
25| spath input=matching_statement output=action_array_values path=Action{}
26
27| spath input=matching_statement output=resource_array_values path=Resource{}
28
29
30| eval action_values=coalesce(action_array_values, statement_action),
31 resource_values=coalesce(resource_array_values, statement_resource)
32
33
34| where isnotnull(mvfind(action_values, "^\*$"))
35 AND isnotnull(mvfind(resource_values, "^\*$"))
36
37
38| spath input=api.response.data output=policy_arn path=policy.arn
39
40| spath input=api.response.data output=version_id path=policy.defaultVersionId
41
42
43| rename actor.user.uid as user,
44 actor.user.account.uid as vendor_account,
45 api.operation as action,
46 api.service.name as dest,
47 cloud.provider as vendor_product,
48 cloud.region as vendor_region,
49 http_request.user_agent as user_agent,
50 metadata.uid as event_id,
51 src_endpoint.ip as src
52
53
54| fillnull value=unknown user dest src user_agent vendor_account vendor_region vendor_product
55
56
57| stats count AS matching_row_count
58 dc(event_id) AS distinct_event_count
59 min(_time) AS firstTime
60 max(_time) AS lastTime
61 values(event_id) AS event_id
62 values(status) AS status
63 values(matching_statement) AS matching_statement
64
65 BY action user src user_agent
66 dest vendor_account vendor_region vendor_product
67 policy_arn version_id
68
69
70| `security_content_ctime(firstTime)`
71
72| `security_content_ctime(lastTime)`
73
74| `asl_aws_create_policy_version_to_allow_all_resources_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| ASL AWS CloudTrail | 'aws:asl' |
'aws_asl' |
Macros Used
| Name | Value |
|---|---|
| amazon_security_lake | sourcetype=aws:asl |
| asl_aws_create_policy_version_to_allow_all_resources_filter | search * |
asl_aws_create_policy_version_to_allow_all_resources_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 Finding (Notable) | Yes |
| Rule Title | %name% |
| Rule Description | %description% |
| Notable Event Fields | user, dest |
| Creates Intermediate Finding (Risk Event) | No |
Implementation
The detection is based on Amazon Security Lake events from Amazon Web Services (AWS), which is a centralized data lake that provides security-related data from AWS services. To use this detection, you must ingest CloudTrail logs from Amazon Security Lake into Splunk. To run this search, ensure that you ingest events using the latest version of Splunk Add-on for Amazon Web Services (https://splunkbase.splunk.com/app/1876) or the Federated Analytics App.
Known False Positives
Administrators may legitimately create policies containing wildcard Allow statements. Matching policies may be unattached or constrained by conditions and other authorization controls.
Associated Analytic Story
Finding
| Title | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| User [$user$] created policy [$policy_arn$] with an Allow statement specifying all actions and all resources. | user | user | 50 |
References
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | 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: 10