Skip to content

Commit 6869ca9

Browse files
authored
Merge branch 'develop' into auditd_detection_updates
2 parents 9614dcd + c795cda commit 6869ca9

14 files changed

+540
-204
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Baseline Of Open S3 Bucket Decommissioning
2+
id: 984e9022-b87b-499a-a260-8d0282c46ea2
3+
version: 1
4+
date: '2025-02-12'
5+
author: Jose Hernandez
6+
type: Baseline
7+
status: production
8+
description: |-
9+
The following analytic identifies S3 buckets that were previously exposed to the public and have been subsequently deleted. It leverages AWS CloudTrail logs to track the lifecycle of potentially risky S3 bucket configurations. This activity is crucial for ensuring that public access to sensitive data is properly managed and decommissioned. By monitoring these events, organizations can ensure that exposed buckets are promptly deleted, reducing the risk of unauthorized access. Immediate investigation is recommended to confirm the proper decommissioning of these buckets and to ensure no sensitive data remains exposed. This baseline detection creates a lookup table of decommissioned buckets.csv and their associated events which can be used by detection searches to trigger alerts when decommissioned buckets are detected.
10+
11+
The following detections searches leverage this baseline search and the lookup table.
12+
* Detect DNS Query to Decommissioned S3 Bucket
13+
* Detect Web Access to Decommissioned S3 Bucket
14+
search: '`cloudtrail` eventSource="s3.amazonaws.com" (eventName=DeleteBucket OR eventName=PutBucketPolicy OR eventName=PutBucketWebsite)
15+
| spath input=_raw path=requestParameters.bucketName output=bucketName
16+
| spath input=_raw path=requestParameters.Host output=host
17+
| spath input=_raw path=requestParameters.bucketPolicy.Statement{} output=statements
18+
| spath input=statements output=principal path=Principal
19+
| spath input=statements output=effect path=Effect
20+
| spath input=statements output=action path=Action
21+
| stats values(eventName) as events,
22+
values(requestParameters.bucketPolicy) as policies,
23+
values(principal) as principals,
24+
values(effect) as effects,
25+
values(action) as actions,
26+
min(_time) as firstEvent,
27+
max(_time) as lastEvent,
28+
values(userIdentity.accountId) as accountIds,
29+
values(userIdentity.arn) as userARNs,
30+
values(awsRegion) as awsRegions,
31+
values(host) as hosts
32+
by bucketName
33+
| eval isPublicPolicy = if( (mvfind(principals, "\\*")>=0) AND (mvfind(effects, "Allow")>=0) AND (mvfind(actions, "s3:GetObject")>=0), 1, 0)
34+
| eval isWebsite = if(mvfind(events, "PutBucketWebsite")>=0, 1, 0)
35+
| eval is_open = if(isPublicPolicy==1 OR isWebsite==1, 1, 0)
36+
| where is_open==1 AND (mvfind(events, "DeleteBucket")>=0)
37+
| eval policy_details = if(isPublicPolicy==1, "Policy: Principal=" . mvjoin(principals, ", ") . " Effect=" . mvjoin(effects, ", ") . " Action=" . mvjoin(actions, ", "), "No Public Policy")
38+
| eval website_details = if(isWebsite==1, "Static Website Enabled", "No Website Hosting")
39+
| table bucketName, hosts, firstEvent, lastEvent, events, policy_details, website_details, accountIds, userARNs, awsRegions
40+
| outputlookup append=true decommissioned_buckets | `baseline_of_open_s3_bucket_decommissioning_filter`'
41+
how_to_implement: To implement this baseline, you need to have AWS CloudTrail logs being ingested into Splunk with the AWS Add-on properly configured. The search looks for S3 bucket events related to bucket policies, website hosting configuration, and bucket deletion. The results are stored in a lookup KVStore named decommissioned_buckets which tracks the history of deleted buckets that were previously exposed to the public.
42+
known_false_positives: Some buckets may be intentionally made public for legitimate business purposes before being decommissioned. Review the policy_details and website_details fields to understand the nature of the public access that was configured.
43+
references:
44+
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
45+
- https://labs.watchtowr.com/8-million-requests-later-we-made-the-solarwinds-supply-chain-attack-look-amateur/
46+
- https://aws.amazon.com/premiumsupport/knowledge-center/secure-s3-resources/
47+
tags:
48+
analytic_story:
49+
- AWS S3 Bucket Security Monitoring
50+
- Suspicious AWS S3 Activities
51+
product:
52+
- Splunk Enterprise
53+
- Splunk Enterprise Security
54+
- Splunk Cloud
55+
detections:
56+
- Detect DNS Query to Decommissioned S3 Bucket
57+
- Detect Web Access to Decommissioned S3 Bucket
58+
security_domain: audit
59+
deployment:
60+
scheduling:
61+
cron_schedule: 0 2 * * 0
62+
earliest_time: -30d@d
63+
latest_time: -1d@d
64+
schedule_window: auto

contentctl.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ apps:
4141
version: 3.0.0
4242
description: description of app
4343
hardcoded_path: https://attack-range-appbinaries.s3.us-west-2.amazonaws.com/splunk-add-on-for-okta-identity-cloud_300.tgz
44+
- uid: 7404
45+
title: Cisco Security Cloud
46+
appid: CiscoSecurityCloud
47+
version: 3.0.1
48+
description: description of app
49+
hardcoded_path: https://attack-range-appbinaries.s3.us-west-2.amazonaws.com/cisco-security-cloud_301.tgz
4450
- uid: 6652
4551
title: Add-on for Linux Sysmon
4652
appid: Splunk_TA_linux_sysmon
@@ -77,9 +83,9 @@ apps:
7783
- uid: 5579
7884
title: Splunk Add-on for CrowdStrike FDR
7985
appid: Splunk_TA_CrowdStrike_FDR
80-
version: 2.0.4
86+
version: 2.0.3
8187
description: description of app
82-
hardcoded_path: https://attack-range-appbinaries.s3.us-west-2.amazonaws.com/splunk-add-on-for-crowdstrike-fdr_204.tgz
88+
hardcoded_path: https://attack-range-appbinaries.s3.us-west-2.amazonaws.com/splunk-add-on-for-crowdstrike-fdr_203.tgz
8389
- uid: 3185
8490
title: Splunk Add-on for Microsoft IIS
8591
appid: SPLUNK_TA_FOR_IIS
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Cisco AI Defense Alerts
2+
id: cbb06880-9dd9-4542-ac60-bd6e1d3c3e4e
3+
version: 1
4+
date: '2024-07-18'
5+
author: Bhavin Patel
6+
description: Data source object for Cisco AI Defense Alerts
7+
source: cisco_ai_defense
8+
sourcetype: cisco:ai:defense
9+
separator:
10+
supported_TA:
11+
- name: Cisco Security Cloud
12+
url: https://splunkbase.splunk.com/app/7404
13+
version: 3.0.1
14+
fields:
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Cisco AI Defense Security Alerts by Application Name
2+
id: 105e4a69-ec55-49fc-be1f-902467435ea8
3+
version: 1
4+
date: '2025-02-14'
5+
author: Bhavin Patel, Splunk
6+
status: experimental
7+
type: Anomaly
8+
description: The search surfaces alerts from the Cisco AI Defense product for potential attacks against the AI models running in your environment. This analytic identifies security events within Cisco AI Defense by examining event messages, actions, and policy names. It focuses on connections and applications associated with specific guardrail entities and ruleset types. By aggregating and analyzing these elements, the search helps detect potential policy violations and security threats, enabling proactive defense measures and ensuring network integrity.
9+
data_source:
10+
- Cisco AI Defense Alerts
11+
search: |-
12+
`cisco_ai_defense`
13+
| rename genai_application.application_name as application_name
14+
| rename connection.connection_name as connection_name
15+
```Aggregating data by model name, connection name, application name, application ID, and user ID```
16+
| stats count
17+
values(user_id) as user_id
18+
values(event_message_type) as event_message_type
19+
values(event_action) as event_action
20+
values(policy.policy_name) as policy_name
21+
values(event_policy_guardrail_assocs{}.policy_guardrail_assoc.guardrail_avail_entity.guardrail_entity_name) as guardrail_entity_name
22+
values(event_policy_guardrail_assocs{}.policy_guardrail_assoc.guardrail_avail_ruleset.guardrail_ruleset_type) as guardrail_ruleset_type
23+
by model.model_name connection_name application_name application_id
24+
```Evaluating severity based on policy name and guardrail ruleset type```
25+
| eval severity=case(
26+
policy_name IN ("AI Runtime Latency Testing - Prompt Injection"), "critical",
27+
policy_name IN ("AI Runtime Latency Testing - Code Detection"), "high",
28+
guardrail_ruleset_type IN ("Toxicity"), "medium",
29+
true(), "low"
30+
)
31+
```Calculating risk score based on severity level```
32+
| eval risk_score=case(
33+
severity="critical", 100,
34+
severity="high", 75,
35+
severity="medium", 50,
36+
severity="low", 25
37+
)
38+
| table model.model_name, user_id, event_action, application_id, application_name, severity, risk_score, policy_name, connection_name, guardrail_ruleset_type, guardrail_entity_name
39+
|`cisco_ai_defense_security_alerts_by_application_name_filter`'
40+
how_to_implement: To enable this detection, you need to ingest alerts from the Cisco AI Defense product. This can be done by using this app from splunkbase - Cisco Security Cloud and ingest alerts into the cisco:ai:defense sourcetype.
41+
known_false_positives: False positives may vary based on Cisco AI Defense configuration; monitor and filter out the alerts that are not relevant to your environment.
42+
references:
43+
- https://www.robustintelligence.com/blog-posts/prompt-injection-attack-on-gpt-4
44+
- https://docs.aws.amazon.com/prescriptive-guidance/latest/llm-prompt-engineering-best-practices/common-attacks.html
45+
drilldown_searches:
46+
- name: View risk events for the last 7 days for - "$application_id$"
47+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$application_id$" ) starthoursago=168 | stats count min(_time)
48+
as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message)
49+
as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all)
50+
as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics"
51+
by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
52+
earliest_offset: $info_min_time$
53+
latest_offset: $info_max_time$
54+
rba:
55+
message: Cisco AI Defense Security Alert has been action - [$event_action$] for the application name - [$application_name$]
56+
risk_objects:
57+
- field: application_name
58+
type: other
59+
score: 10
60+
threat_objects: []
61+
tags:
62+
analytic_story:
63+
- Critical Alerts
64+
asset_type: Web Application
65+
product:
66+
- Splunk Enterprise
67+
- Splunk Enterprise Security
68+
- Splunk Cloud
69+
security_domain: endpoint
70+
tests:
71+
- name: True Positive Test
72+
attack_data:
73+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/suspicious_behaviour/cisco_ai_defense_alerts/cisco_ai_defense.log
74+
source: cisco_ai_defense
75+
sourcetype: cisco:ai:defense

detections/application/cisco_secure_application_alerts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tags:
7979
- Splunk Enterprise Security
8080
- Splunk Cloud
8181
security_domain: threat
82-
# manual_test: We are dynamically creating the risk_score field based on the severity of the alert in the SPL and that supersedes the risk score set in the detection. Setting these to manual test since otherwise we fail integration testing. The detection is also failing on unit-testing as some of the fields set in the observables are empty.
82+
manual_test: We are dynamically creating the risk_score field based on the severity of the alert in the SPL and that supersedes the risk score set in the detection. Setting these to manual test since otherwise we fail integration testing. The detection is also failing on unit-testing as some of the fields set in the observables are empty.
8383
tests:
8484
- name: True Positive Test
8585
attack_data:

detections/endpoint/windows_process_execution_in_temp_dir.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data_source:
1414
- CrowdStrike ProcessRollup2
1515
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes
1616
where Processes.process_path IN("*\\temp\\*")
17-
by Processes.parent_process_name Processes.parent_process Processes.process_path Processes.dest Processes.user
17+
by Processes.parent_process_name Processes.process_name Processes.parent_process Processes.process_path Processes.dest Processes.user
1818
| `drop_dm_object_name(Processes)`
1919
| `security_content_ctime(firstTime)`
2020
| `security_content_ctime(lastTime)`

detections/endpoint/windows_security_and_backup_services_stop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ drilldown_searches:
4747
earliest_offset: $info_min_time$
4848
latest_offset: $info_max_time$
4949
rba:
50-
message: Known services $param1$ terminated by a potential ransomware on $dest$
50+
message: Known services $display_name$ terminated by a potential ransomware on $dest$
5151
risk_objects:
5252
- field: dest
5353
type: system

detections/endpoint/windows_service_created_with_suspicious_service_name.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ date: '2025-02-07'
55
author: Steven Dick
66
status: production
77
type: Anomaly
8-
description: The following analytic detects the creation of a Windows Service with a known suspicious or malicious name using Windows Event ID 7045. It leverages logs from the `wineventlog_system` to identify these services installations. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.
8+
description: The following analytic detects the creation of a Windows Service with a known suspicious or malicious name using Windows Event ID 7045. It leverages logs from the `wineventlog_system` to identify these services installations. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.
99
data_source:
1010
- Windows Event Log System 7045
1111
search: |-
1212
`wineventlog_system` EventCode=7045
13-
| stats values(user) as user, values(ImagePath) as process, count, min(_time) as firstTime, max(_time) as lastTime values(EventCode) as signature by Computer, ServiceName, StartType, ServiceType, UserID
13+
| stats values(ImagePath) as process, count, min(_time) as firstTime, max(_time) as lastTime values(EventCode) as signature by Computer, ServiceName, StartType, ServiceType, UserID
1414
| eval process_name = mvindex(split(process,"\\"),-1)
15-
| rename Computer as dest, ServiceName as object_name, ServiceType as object_type
15+
| rename Computer as dest, ServiceName as object_name, ServiceType as object_type, UserID as user_id
1616
| lookup windows_suspicious_services service_name as object_name
1717
| where isnotnull(tool_name)
1818
| `security_content_ctime(firstTime)`
@@ -44,9 +44,6 @@ rba:
4444
- field: dest
4545
type: system
4646
score: 75
47-
- field: user
48-
type: user
49-
score: 75
5047
threat_objects:
5148
- field: process
5249
type: process
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Detect DNS Query to Decommissioned S3 Bucket
2+
id: 2f1c5fd1-4b8a-4f5d-a0e9-7d6a8e2f5e1e
3+
version: 1
4+
date: '2025-02-12'
5+
author: Jose Hernandez, Splunk
6+
status: experimental
7+
type: Anomaly
8+
description: This detection identifies DNS queries to domains that match previously decommissioned S3 buckets. This activity is significant because attackers may attempt to recreate deleted S3 buckets that were previously public to hijack them for malicious purposes. If successful, this could allow attackers to host malicious content or exfiltrate data through compromised bucket names that may still be referenced by legitimate applications.
9+
data_source:
10+
- Sysmon EventID 22
11+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Resolution where DNS.message_type=QUERY by DNS.query DNS.src
12+
| `drop_dm_object_name("DNS")`
13+
| `security_content_ctime(firstTime)`
14+
| `security_content_ctime(lastTime)`
15+
| eval bucket_domain = lower(query)
16+
| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
17+
| where isnotnull(match)
18+
| `detect_dns_query_to_decommissioned_s3_bucket_filter`'
19+
how_to_implement: To successfully implement this detection, you need to be ingesting DNS query logs and have them mapped to the Network_Resolution data model. Additionally, ensure that the baseline search "Baseline Of Open S3 Bucket Decommissioning" is running and populating the decommissioned_buckets KVstore lookup.
20+
known_false_positives: Some applications or scripts may continue to reference old S3 bucket names after they have been decommissioned. These should be investigated and updated to prevent potential security risks.
21+
references:
22+
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
23+
- https://labs.watchtowr.com/8-million-requests-later-we-made-the-solarwinds-supply-chain-attack-look-amateur/
24+
drilldown_searches:
25+
- name: DNS Activity for Host
26+
search: '| from datamodel:Network_Resolution | search src="$src$"'
27+
earliest_offset: -7d@d
28+
latest_offset: now
29+
rba:
30+
message: A DNS query to decommissioned S3 bucket $query$ was detected from host $src$
31+
risk_objects:
32+
- field: src
33+
type: system
34+
score: 30
35+
threat_objects:
36+
- field: query
37+
type: domain
38+
tags:
39+
analytic_story:
40+
- AWS S3 Bucket Security Monitoring
41+
- Data Destruction
42+
asset_type: Network
43+
mitre_attack_id:
44+
- T1485
45+
product:
46+
- Splunk Enterprise
47+
- Splunk Enterprise Security
48+
- Splunk Cloud
49+
security_domain: network
50+
tests:
51+
- name: Baseline Dataset Test
52+
attack_data:
53+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1485/decommissioned_buckets/cloudtrail.json
54+
source: cloudtrail
55+
sourcetype: aws:cloudtrail
56+
- name: True Positive Test
57+
attack_data:
58+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1485/decommissioned_buckets/dns.log
59+
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
60+
sourcetype: XmlWinEventLog

0 commit comments

Comments
 (0)