Detection rules › Splunk

Circle CI Disable Security Job

Status
production
Severity
low
Group by
branch, commit_message, url, user, workflow_id, workflow_name
Author
Patrick Bareiss, Splunk
Source
github.com/splunk/security_content

The following analytic detects the disabling of security jobs in CircleCI pipelines. It leverages CircleCI log data, renaming and extracting fields such as job names, workflow IDs, user information, commit messages, URLs, and branches. The detection identifies mandatory jobs for each workflow and checks if they were executed. This activity is significant because disabling security jobs can allow malicious code to bypass security checks, leading to potential data breaches, system downtime, and reputational damage. If confirmed malicious, this could result in unauthorized code execution and compromised pipeline integrity.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1554 Compromise Host Software Binary

Rule body splunk

name: Circle CI Disable Security Job
id: 4a2fdd41-c578-4cd4-9ef7-980e352517f2
version: 10
creation_date: '2021-09-02'
modification_date: '2026-05-13'
author: Patrick Bareiss, Splunk
status: production
type: Anomaly
description: The following analytic detects the disabling of security jobs in CircleCI pipelines. It leverages CircleCI log data, renaming and extracting fields such as job names, workflow IDs, user information, commit messages, URLs, and branches. The detection identifies mandatory jobs for each workflow and checks if they were executed. This activity is significant because disabling security jobs can allow malicious code to bypass security checks, leading to potential data breaches, system downtime, and reputational damage. If confirmed malicious, this could result in unauthorized code execution and compromised pipeline integrity.
data_source:
    - CircleCI
search: |-
    `circleci`
      | rename vcs.committer_name as user vcs.subject as commit_message vcs.url as url workflows.* as *
      | stats values(job_name) as job_names
        BY workflow_id workflow_name user
           commit_message url branch
      | lookup mandatory_job_for_workflow workflow_name OUTPUTNEW job_name AS mandatory_job
      | search mandatory_job=*
      | eval mandatory_job_executed=if(like(job_names, "%".mandatory_job."%"), 1, 0)
      | where mandatory_job_executed=0
      | eval phase="build"
      | rex field=url "(?<repository>[^\/]*\/[^\/]*)$"
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `circle_ci_disable_security_job_filter`
how_to_implement: You must index CircleCI logs.
known_false_positives: No false positives have been identified at this time.
references: []
drilldown_searches:
    - name: View the detection results for - "$user$"
      search: '%original_detection_search% | search  user = "$user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
intermediate_findings:
    entities:
        - field: user
          type: user
          score: 20
          message: Disable security job $mandatory_job$ in workflow $workflow_name$ from user $user$
analytic_story:
    - Dev Sec Ops
asset_type: CircleCI
mitre_attack_id:
    - T1554
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: network
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1554/circle_ci_disable_security_job/circle_ci_disable_security_job.json
          sourcetype: circleci
          source: circleci
      test_type: unit

Stages and Predicates

Stage 1: search

`circleci`

Stage 2: rename

| rename vcs.committer_name as user vcs.subject as commit_message vcs.url as url workflows.* as *

Stage 3: stats

| stats values(job_name) as job_names
    BY workflow_id workflow_name user
       commit_message url branch

Stage 4: lookup

| lookup mandatory_job_for_workflow workflow_name OUTPUTNEW job_name AS mandatory_job
Lookup table
mandatory_job_for_workflow
Key field
workflow_name
Output columns
['job_name', 'mandatory_job']

Stage 5: search

| search mandatory_job=*

Stage 6: eval

| eval mandatory_job_executed=if(like(job_names, "%".mandatory_job."%"), 1, 0)
mandatory_job_executed =
iflike(job_names, concat("%", mandatory_job, "%"))1
else0

Stage 7: where

| where mandatory_job_executed=0

Stage 8: eval

| eval phase="build"

Stage 9: rex

| rex field=url "(?<repository>[^\/]*\/[^\/]*)$"

Stage 10: search

| `security_content_ctime(firstTime)`

Stage 11: search

| `security_content_ctime(lastTime)`

Stage 12: search

| `circle_ci_disable_security_job_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
mandatory_jobeq
  • *
mandatory_job_executedeq
  • 0
sourcetypeeq
  • circleci