ID | Technique | Tactic |
---|---|---|
T1199 | Trusted Relationship | Initial Access |
Detection: Github Commit In Develop
Description
The following analytic detects commits pushed directly to the 'develop' or 'main' branches in a GitHub repository. It leverages GitHub logs, focusing on commit metadata such as author details, commit messages, and timestamps. This activity is significant as direct commits to these branches can bypass the review process, potentially introducing unvetted changes. If confirmed malicious, this could lead to unauthorized code modifications, introducing vulnerabilities or backdoors into the codebase, and compromising the integrity of the development lifecycle.
Search
1`github` branches{}.name = main OR branches{}.name = develop
2| stats count min(_time) as firstTime max(_time) as lastTime by commit.author.html_url commit.commit.author.email commit.author.login commit.commit.message repository.pushed_at commit.commit.committer.date
3| eval phase="code"
4| `security_content_ctime(firstTime)`
5| `security_content_ctime(lastTime)`
6| `github_commit_in_develop_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
GitHub | AWS | 'aws:firehose:json' |
'github' |
Macros Used
Name | Value |
---|---|
github | sourcetype=aws:firehose:json |
github_commit_in_develop_filter | search * |
github_commit_in_develop_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 Risk Event | True |
Implementation
To successfully implement this search, you need to be ingesting logs related to github logs having the fork, commit, push metadata that can be use to monitor the changes in a github project.
Known False Positives
admin can do changes directly to develop branch
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
Suspicious commit by $commit.commit.author.email$ to develop branch | 9 | 30 | 30 |
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: 3