High Number of Closed Pull Requests by User

Last updated a month ago on 2025-12-16
Created a month ago on 2025-12-16

About

Detects a high number of closed pull requests by a single user within a short time frame. Adversaries may close multiple pull requests to disrupt development workflows or hide malicious changes.
Tags
Domain: CloudUse Case: Threat DetectionTactic: ImpactTactic: ExfiltrationData Source: GithubLanguage: esql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Impact (TA0040)(external, opens in a new tab or window)

Exfiltration (TA0010)(external, opens in a new tab or window)

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

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

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

Query
text code block:
from logs-github.audit-* metadata _id, _index, _version | where data_stream.dataset == "github.audit" and github.category == "pull_request" and event.type == "change" and event.action == "pull_request.close" | stats Esql.document_count = COUNT(*), Esql.github_org_values = values(github.org), Esql.github_repo_values = values(github.repo), Esql.github_user_agent_values = values(github.user_agent), Esql.github_pull_request_url_values = values(github.pull_request_url), Esql.user_name_values = values(user.name), Esql.agent_id_values = values(agent.id), Esql.event_dataset_values = values(event.dataset), Esql.data_stream_namespace_values = values(data_stream.namespace) by user.name | keep Esql.* | where Esql.document_count >= 10

Install detection rules in Elastic Security

Detect High Number of Closed Pull Requests by User 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).