Detection: GitHub Organizations Repository Deleted

Description

The following analytic identifies when a repository is deleted within a GitHub organization. The detection monitors GitHub Organizations audit logs for repository deletion events by tracking actor details, repository information, and associated metadata. This behavior is concerning for SOC teams as malicious actors may attempt to delete repositories to destroy source code, intellectual property, or evidence of compromise. Repository deletion can result in permanent loss of code, documentation, and project history if proper backups are not maintained. Additionally, unauthorized repository deletion could indicate account compromise, insider threats, or attempts to disrupt business operations. The impact of a repository deletion attack includes loss of intellectual property, disruption to development workflows, and potential financial losses from lost work. Early detection of unauthorized repository deletions allows security teams to investigate potential compromises and restore from backups if needed.

1`github_organizations` vendor_action=repo.destroy 
2| fillnull 
3| stats count min(_time) as firstTime max(_time) as lastTime by actor, actor_id, actor_is_bot, actor_location.country_code, business, business_id, org, org_id, repo, repo_id, user_agent, visibility, vendor_action 
4| eval user=actor 
5| `security_content_ctime(firstTime)` 
6| `security_content_ctime(lastTime)` 
7| `github_organizations_repository_deleted_filter`

Data Source

Name Platform Sourcetype Source
GitHub Organizations Audit Logs N/A 'github:cloud:audit' 'github'

Macros Used

Name Value
github_organizations sourcetype=github:cloud:audit
github_organizations_repository_deleted_filter search *
github_organizations_repository_deleted_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
T1485 Data Destruction Impact
T1195 Supply Chain Compromise Initial Access
Actions on Objectives
Delivery
DE.AE
CIS 13

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 ingest GitHub Organizations logs using Splunk Add-on for Github using a Personal Access Token https://docs.splunk.com/Documentation/AddOns/released/GitHub/Configureinputs .

Known False Positives

unknown

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

$user$ deleted a repository in GitHub Organizations

Risk Object Risk Object Type Risk Score Threat Objects
user user 25 user_agent

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset github github:cloud:audit
Integration ✅ Passing Dataset github github:cloud:audit

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