GitHub Repo Created

Identifies the creation of a GitHub repository by a non-bot actor. Unexpected repository creation can indicate unauthorized infrastructure setup, data staging, or misuse of a compromised GitHub account.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2023/10/11"
  3integration = ["github"]
  4maturity = "production"
  5updated_date = "2026/11/17"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies the creation of a GitHub repository by a non-bot actor. Unexpected repository creation can indicate
 11unauthorized infrastructure setup, data staging, or misuse of a compromised GitHub account.
 12"""
 13false_positives = [
 14    """
 15    Authorized users may create repositories for development, testing, documentation, or migration. Confirm the actor,
 16    organization, repository visibility, and business purpose before escalating.
 17    """,
 18]
 19from = "now-9m"
 20index = ["logs-github.audit-*"]
 21language = "kuery"
 22license = "Elastic License v2"
 23name = "GitHub Repo Created"
 24note = """## Triage and analysis
 25
 26### Investigating GitHub Repo Created
 27
 28This rule detects repository creation by an actor that GitHub does not identify as a bot. Repository creation is common
 29in normal development, but it can also support unauthorized code hosting, data staging, persistence, or resource
 30development after an account is compromised.
 31
 32### Possible investigation steps
 33
 34- Review `user.name`, `github.org`, `github.repo`, and `github.actor_ip` to identify the actor and repository.
 35- Confirm the repository name, visibility, ownership, and creation purpose with the actor or organization owner.
 36- Review nearby audit events for permission changes, collaborator additions, deploy keys, webhooks, secrets, workflow
 37  creation, pushes, transfers, or visibility changes.
 38- Check whether the source IP, user agent, and authentication method are expected for the actor.
 39- Determine whether sensitive code, credentials, or organization data were subsequently added to the repository.
 40
 41### False positive analysis
 42
 43- Developers and administrators routinely create repositories for approved projects, testing, migrations, and
 44  documentation.
 45- Internal automation not identified by GitHub as a bot can still trigger this rule. Scope exceptions to a verified
 46  actor and organization when that behavior is expected.
 47
 48### Response and remediation
 49
 50- If unauthorized, restrict or remove the repository, revoke suspicious sessions or tokens, and review the actor's
 51  recent GitHub activity.
 52- Remove unauthorized collaborators, deploy keys, webhooks, workflows, and secrets.
 53- Preserve relevant audit events and repository contents before deletion when incident-response evidence is required.
 54"""
 55references = [
 56    "https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization",
 57]
 58risk_score = 21
 59rule_id = "6cea88e4-6ce2-4238-9981-a54c140d6336"
 60severity = "low"
 61tags = [
 62    "Domain: Cloud",
 63    "Use Case: Threat Detection",
 64    "Use Case: UEBA",
 65    "Tactic: Execution",
 66    "Tactic: Resource Development",
 67    "Data Source: Github",
 68    "Data Source: GitHub Audit Logs",
 69    "Resources: Investigation Guide",
 70    "Noise: Medium",
 71    "Performance: Fast",
 72    "Rule Type: Custom Query (KQL)",
 73    "Platform: GitHub",
 74    "Domain: SaaS",
 75]
 76timestamp_override = "event.ingested"
 77type = "query"
 78
 79query = '''
 80data_stream.dataset:"github.audit" and event.category:"configuration" and event.action:"repo.create" and
 81not github.actor_is_bot:true
 82'''
 83
 84
 85[[rule.threat]]
 86framework = "MITRE ATT&CK"
 87
 88[[rule.threat.technique]]
 89id = "T1648"
 90name = "Serverless Execution"
 91reference = "https://attack.mitre.org/techniques/T1648/"
 92
 93[rule.threat.tactic]
 94id = "TA0002"
 95name = "Execution"
 96reference = "https://attack.mitre.org/tactics/TA0002/"
 97
 98[[rule.threat]]
 99framework = "MITRE ATT&CK"
100
101[[rule.threat.technique]]
102id = "T1583"
103name = "Acquire Infrastructure"
104reference = "https://attack.mitre.org/techniques/T1583/"
105
106[[rule.threat.technique.subtechnique]]
107id = "T1583.006"
108name = "Web Services"
109reference = "https://attack.mitre.org/techniques/T1583/006/"
110
111[rule.threat.tactic]
112id = "TA0042"
113name = "Resource Development"
114reference = "https://attack.mitre.org/tactics/TA0042/"
115
116[rule.investigation_fields]
117field_names = [
118    "@timestamp",
119    "event.action",
120    "user.name",
121    "github.org",
122    "github.repo",
123    "github.repository_public",
124    "github.actor_ip",
125    "github.user_agent",
126    "github.programmatic_access_type",
127    "github.actor_is_bot",
128]

Triage and analysis

Investigating GitHub Repo Created

This rule detects repository creation by an actor that GitHub does not identify as a bot. Repository creation is common in normal development, but it can also support unauthorized code hosting, data staging, persistence, or resource development after an account is compromised.

Possible investigation steps

  • Review user.name, github.org, github.repo, and github.actor_ip to identify the actor and repository.
  • Confirm the repository name, visibility, ownership, and creation purpose with the actor or organization owner.
  • Review nearby audit events for permission changes, collaborator additions, deploy keys, webhooks, secrets, workflow creation, pushes, transfers, or visibility changes.
  • Check whether the source IP, user agent, and authentication method are expected for the actor.
  • Determine whether sensitive code, credentials, or organization data were subsequently added to the repository.

False positive analysis

  • Developers and administrators routinely create repositories for approved projects, testing, migrations, and documentation.
  • Internal automation not identified by GitHub as a bot can still trigger this rule. Scope exceptions to a verified actor and organization when that behavior is expected.

Response and remediation

  • If unauthorized, restrict or remove the repository, revoke suspicious sessions or tokens, and review the actor's recent GitHub activity.
  • Remove unauthorized collaborators, deploy keys, webhooks, workflows, and secrets.
  • Preserve relevant audit events and repository contents before deletion when incident-response evidence is required.

References

Related rules

to-top