Detection: GitHub Actions Disable Security Workflow

Description

The following analytic detects the disabling of a security workflow in GitHub Actions. It leverages GitHub logs to identify when a workflow, excluding those named security-testing, is disabled following a push or pull request event. This activity is significant as it may indicate an attempt by an attacker to conceal malicious code by disabling security checks. If confirmed malicious, this could allow the attacker to introduce and persist undetected malicious code within the repository, potentially compromising the integrity and security of the codebase.

1`github` workflow_run.event=push OR workflow_run.event=pull_request 
2| stats values(workflow_run.name) as workflow_run.name by workflow_run.head_commit.id workflow_run.event workflow_run.head_branch workflow_run.head_commit.author.email workflow_run.head_commit.author.name workflow_run.head_commit.message workflow_run.head_commit.timestamp workflow_run.head_repository.full_name workflow_run.head_repository.owner.id workflow_run.head_repository.owner.login workflow_run.head_repository.owner.type 
3| rename workflow_run.head_commit.author.name as user, workflow_run.head_commit.author.email as user_email, workflow_run.head_repository.full_name as repository, workflow_run.head_branch as branch 
4| search NOT workflow_run.name=*security-testing* 
5| `security_content_ctime(firstTime)` 
6| `security_content_ctime(lastTime)` 
7| `github_actions_disable_security_workflow_filter`

Data Source

Name Platform Sourcetype Source Supported App
GitHub AWS icon AWS 'aws:firehose:json' 'github' N/A

Macros Used

Name Value
github sourcetype=aws:firehose:json
github_actions_disable_security_workflow_filter search *
github_actions_disable_security_workflow_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1195.002 Compromise Software Supply Chain Initial Access
T1195 Supply Chain Compromise Initial Access
KillChainPhase.DELIVERY
NistCategory.DE_AE
Cis18Value.CIS_13
APT41
Cobalt Group
Dragonfly
FIN7
GOLD SOUTHFIELD
Sandworm Team
Threat Group-3390

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 True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

You must index GitHub logs. You can follow the url in reference to onboard GitHub logs. Sometimes GitHub logs are truncated, make sure to disable it in props.conf. Replace security-testing with the name of your security testing workflow in GitHub Actions.

Known False Positives

unknown

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Security Workflow is disabled in branch $branch$ for repository $repository$ 27 30 90
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset github aws:firehose:json
Integration ✅ Passing Dataset github aws:firehose:json

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: 2