GitHub Protected Branch Settings Changed

Last updated a day ago on 2026-11-02
Created 3 years ago on 2023-08-29

About

This rule detects protected branch setting changes on a GitHub repository originating from a user agent not previously seen performing protected branch changes in the last 7 days. Branch protection rules enforce workflows and requirements before a contributor can push changes to a branch. Unauthorized changes could be used to lower your organization's security posture and leave you exposed for future attacks. Both push-time enforcement events (`protected_branch.rejected_ref_update`, a push blocked by branch protection) and administrative bypasses (`protected_branch.policy_override`) are retained, because a failed modification attempt and an admin override are each security-relevant indicators, particularly during CI/CD compromise once administrative access is obtained. Keying on a new user agent suppresses the recurring, expected automation that drives most of the event volume while surfacing changes from unfamiliar tooling or clients. If a specific user agent is noisy in a given environment, scope it with an exception rather than removing the action from the query.
Tags
Domain: CloudUse Case: Threat DetectionTactic: Defense EvasionData Source: GithubData Source: GitHub Audit LogsNoise: HighPerformance: FastProfile: AggressiveRule Type: New TermsPlatform: GitHubDomain: SaaSLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

Defense Evasion (TA0005)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
New Terms Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-github.audit-*
Related Integrations

github(external, opens in a new tab or window)

Query
text code block:
data_stream.dataset: "github.audit" and github.category: "protected_branch" and event.type: "change"

Install detection rules in Elastic Security

Detect GitHub Protected Branch Settings Changed in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).