Detection: GitHub Enterprise Register Self Hosted Runner

Description

The following analytic identifies when a self-hosted runner is created in GitHub Enterprise. The detection monitors GitHub Enterprise audit logs for actions related to creating new self-hosted runners at the organization or enterprise level. his behavior warrants monitoring because self-hosted runners execute workflow jobs on customer-controlled infrastructure, which could be exploited by attackers to execute malicious code, access sensitive data, or pivot to other systems. While self-hosted runners are a legitimate feature, their creation should be carefully controlled as compromised runners pose significant security risks. The impact includes potential remote code execution, data exfiltration, and lateral movement within the environment if a runner is compromised. SOC teams should investigate unexpected runner creation events to verify they are authorized and properly secured, especially if created by unfamiliar users or in unusual contexts.

1`github_enterprise` action=enterprise.register_self_hosted_runner 
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, user_agent, action 
4| eval user=actor 
5| `security_content_ctime(firstTime)` 
6| `security_content_ctime(lastTime)` 
7| `github_enterprise_register_self_hosted_runner_filter`

Data Source

Name Platform Sourcetype Source
GitHub Enterprise Audit Logs N/A 'httpevent' 'http:github'

Macros Used

Name Value
github_enterprise source=http:github sourcetype=httpevent
github_enterprise_register_self_hosted_runner_filter search *
github_enterprise_register_self_hosted_runner_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
T1562.001 Disable or Modify Tools Defense Evasion
T1195 Supply Chain Compromise Initial Access
Delivery
Exploitation
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 Enterprise logs using Audit log streaming as described in this documentation https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#setting-up-streaming-to-splunk using a Splunk HTTP Event Collector.

Known False Positives

unknown

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

$user$ created a self-hosted runner in GitHub Enterprise

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 http:github httpevent
Integration ✅ Passing Dataset http:github httpevent

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