Circle CI Disable Security Step
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.
Description
The following analytic detects the disablement of security steps in a CircleCI pipeline. It leverages CircleCI logs, using field renaming, joining, and statistical analysis to identify instances where mandatory security steps are not executed. This activity is significant because disabling security steps can introduce vulnerabilities, unauthorized changes, or malicious code into the pipeline. If confirmed malicious, this could lead to potential attacks, data breaches, or compromised infrastructure. Investigate by reviewing job names, commit details, and user information associated with the disablement, and examine any relevant artifacts and concurrent processes.
- Type: Anomaly
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-25
- Author: Patrick Bareiss, Splunk
- ID: 72cb9de9-e98b-4ac9-80b2-5331bba6ea97
Annotations
Kill Chain Phase
- Installation
NIST
- DE.AE
CIS20
- CIS 13
CVE
Search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
`circleci`
| rename workflows.job_id AS job_id
| join job_id [
| search `circleci`
| stats values(name) as step_names count by job_id job_name ]
| stats count by step_names job_id job_name vcs.committer_name vcs.subject vcs.url owners{}
| rename vcs.* as * , owners{} as user
| lookup mandatory_step_for_job job_name OUTPUTNEW step_name AS mandatory_step
| search mandatory_step=*
| eval mandatory_step_executed=if(like(step_names, "%".mandatory_step."%"), 1, 0)
| where mandatory_step_executed=0
| rex field=url "(?<repository>[^\/]*\/[^\/]*)$"
| eval phase="build"
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `circle_ci_disable_security_step_filter`
Macros
The SPL above uses the following Macros:
circle_ci_disable_security_step_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Lookups
The SPL above uses the following Lookups:
Required fields
List of fields required to use this analytic.
- _times
How To Implement
You must index CircleCI logs.
Known False Positives
unknown
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
72.0 | 80 | 90 | Disable security step $mandatory_step$ in job $job_name$ from user $user$ |
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: 2