GitHub Actions Workflow Run Rapidly Deleted

Detects when a GitHub Actions workflow run is deleted within 30 minutes of its creation. Adversaries who abuse Actions for execution or secret theft may delete short-lived runs afterward to remove job logs that show the malicious steps.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/11/17"
  3integration = ["github"]
  4maturity = "production"
  5updated_date = "2026/11/17"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects when a GitHub Actions workflow run is deleted within 30 minutes of its creation. Adversaries who abuse Actions
 11for execution or secret theft may delete short-lived runs afterward to remove job logs that show the malicious steps.
 12"""
 13false_positives = [
 14    """
 15    Automation that deletes failed or temporary workflow runs shortly after execution. Review whether the workflow,
 16    repository, and actors are expected.
 17    """,
 18]
 19from = "now-39m"
 20language = "esql"
 21license = "Elastic License v2"
 22name = "GitHub Actions Workflow Run Rapidly Deleted"
 23note = """## Triage and analysis
 24
 25### Investigating GitHub Actions Workflow Run Rapidly Deleted
 26
 27`workflows.delete_workflow_run` is recorded when a run is deleted. GitHub does not always emit a separate audit event for deleting only the logs; the run deletion itself is the reliable cover-up signal. This rule correlates workflow-run creation and deletion events for the same organization, repository, and workflow when they occur within 30 minutes.
 28
 29### Possible investigation steps
 30
 31- Review `user.name`, `github.repo`, `github.data.workflow_id`, and the correlated creation and deletion timestamps.
 32- Determine which workflow file ran and whether it was recently added or modified.
 33- Look for `git.push` by `github-actions[bot]` or unexpected `GITHUB_TOKEN` usage around the same time.
 34- Check org/repo secrets access (`api.request` for secrets) from the same actor.
 35
 36### False positive analysis
 37
 38- Admins pruning old CI history.
 39- Tools that delete runs after collecting artifacts.
 40
 41### Response and remediation
 42
 43- If unauthorized, disable the suspect workflow and rotate secrets used by Actions.
 44- Review commits to `.github/workflows/` and restrict `GITHUB_TOKEN` permissions.
 45- Preserve remaining Actions logs and audit events for the incident window.
 46"""
 47references = ["https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run"]
 48risk_score = 21
 49rule_id = "c3767835-ee6d-4523-8d11-3cabeecbb8cf"
 50severity = "low"
 51tags = [
 52    "Domain: Cloud",
 53    "Domain: SaaS",
 54    "Platform: GitHub",
 55    "Use Case: Threat Detection",
 56    "Tactic: Defense Evasion",
 57    "Data Source: Github",
 58    "Data Source: GitHub Audit Logs",
 59    "Service: GitHub Actions",
 60    "Rule Type: ES|QL",
 61    "Resources: Investigation Guide",
 62]
 63timestamp_override = "event.ingested"
 64type = "esql"
 65
 66query = '''
 67FROM logs-github.audit-*
 68| WHERE event.module == "github" AND data_stream.dataset == "github.audit"
 69    AND event.action IN (
 70      "workflows.created_workflow_run",
 71      "workflows.delete_workflow_run"
 72    )
 73| EVAL
 74    Esql.is_workflow_run_created = event.action == "workflows.created_workflow_run",
 75    Esql.is_workflow_run_deleted = event.action == "workflows.delete_workflow_run"
 76| STATS
 77    Esql.workflow_run_created_count = SUM(CASE(Esql.is_workflow_run_created, 1, 0)),
 78    Esql.workflow_run_deleted_count = SUM(CASE(Esql.is_workflow_run_deleted, 1, 0)),
 79    Esql.workflow_run_created_at = MIN(CASE(Esql.is_workflow_run_created, @timestamp, null)),
 80    Esql.workflow_run_deleted_at = MAX(CASE(Esql.is_workflow_run_deleted, @timestamp, null)),
 81    user.name = VALUES(user.name),
 82    github.actor_ip = VALUES(github.actor_ip),
 83    github.hashed_token = VALUES(github.hashed_token),
 84    github.programmatic_access_type = VALUES(github.programmatic_access_type),
 85    github.user_agent = VALUES(github.user_agent),
 86    github.data.workflow_run_id = VALUES(github.data.workflow_run_id)
 87  BY github.org, github.repo, github.data.workflow_id
 88| EVAL Esql.time_diff_seconds = DATE_DIFF(
 89    "second", Esql.workflow_run_created_at, Esql.workflow_run_deleted_at
 90  )
 91| WHERE Esql.workflow_run_created_count > 0
 92    AND Esql.workflow_run_deleted_count > 0
 93    AND Esql.time_diff_seconds >= 0
 94    AND Esql.time_diff_seconds <= 1800
 95    AND DATE_DIFF("minute", Esql.workflow_run_deleted_at, NOW()) <= 10
 96| KEEP
 97    Esql.workflow_run_created_at,
 98    Esql.workflow_run_deleted_at,
 99    Esql.time_diff_seconds,
100    Esql.workflow_run_created_count,
101    Esql.workflow_run_deleted_count,
102    user.name,
103    github.org,
104    github.repo,
105    github.actor_ip,
106    github.hashed_token,
107    github.programmatic_access_type,
108    github.user_agent,
109    github.data.workflow_id,
110    github.data.workflow_run_id
111'''
112
113
114[[rule.threat]]
115framework = "MITRE ATT&CK"
116[[rule.threat.technique]]
117id = "T1070"
118name = "Indicator Removal"
119reference = "https://attack.mitre.org/techniques/T1070/"
120
121
122[rule.threat.tactic]
123id = "TA0005"
124name = "Defense Evasion"
125reference = "https://attack.mitre.org/tactics/TA0005/"
126
127[rule.investigation_fields]
128field_names = [
129    "Esql.workflow_run_created_at",
130    "Esql.workflow_run_deleted_at",
131    "Esql.time_diff_seconds",
132    "user.name",
133    "github.org",
134    "github.repo",
135    "github.actor_ip",
136    "github.hashed_token",
137    "github.programmatic_access_type",
138    "github.user_agent",
139    "github.data.workflow_id",
140    "github.data.workflow_run_id",
141]
142
143[rule.alert_suppression]
144group_by = [
145    "github.org",
146    "github.repo",
147    "github.data.workflow_run_id",
148]
149missing_fields_strategy = "doNotSuppress"
150
151[rule.alert_suppression.duration]
152unit = "h"
153value = 1

Triage and analysis

Investigating GitHub Actions Workflow Run Rapidly Deleted

workflows.delete_workflow_run is recorded when a run is deleted. GitHub does not always emit a separate audit event for deleting only the logs; the run deletion itself is the reliable cover-up signal. This rule correlates workflow-run creation and deletion events for the same organization, repository, and workflow when they occur within 30 minutes.

Possible investigation steps

  • Review user.name, github.repo, github.data.workflow_id, and the correlated creation and deletion timestamps.
  • Determine which workflow file ran and whether it was recently added or modified.
  • Look for git.push by github-actions[bot] or unexpected GITHUB_TOKEN usage around the same time.
  • Check org/repo secrets access (api.request for secrets) from the same actor.

False positive analysis

  • Admins pruning old CI history.
  • Tools that delete runs after collecting artifacts.

Response and remediation

  • If unauthorized, disable the suspect workflow and rotate secrets used by Actions.
  • Review commits to .github/workflows/ and restrict GITHUB_TOKEN permissions.
  • Preserve remaining Actions logs and audit events for the incident window.

References

Related rules

to-top