EXPLORE
← Back to Explore
elasticlowTTP

GitHub Actions or Integration Secret Created

Identifies the creation of a GitHub Actions, Dependabot, or Codespaces secret at the organization, repository, environment, or user scope. Secrets are injected into CI/CD workflows at runtime, so an actor with write or admin access can create a secret to establish durable access or to stage credentials that workflows will consume, allowing malicious automation to persist even after the initial access path is closed. This technique has been observed in software supply-chain attacks such as Shai-Hulud. Because creating secrets is also routine for platform and deployment teams, this rule works best as a building block correlated with the actor, the token used, and any surrounding workflow changes.

MITRE ATT&CK

persistencecredential-access

Detection Query

from logs-github.audit-* metadata _id, _index, _version
| where
  data_stream.dataset == "github.audit"
    and (github.actor_is_bot is not null and github.actor_is_bot == false)
    and event.action in (
      "org.create_actions_secret",
      "repo.create_actions_secret",
      "environment.create_actions_secret",
      "org.create_integration_secret",
      "repo.create_integration_secret",
      "user.create_integration_secret"
    )
| keep
    _id,
    _index,
    _version,
    @timestamp,
    event.action,
    user.name,
    github.org,
    github.repo,
    github.actor_ip,
    github.hashed_token,
    github.programmatic_access_type,
    github.user_agent,
    github.name,
    github.actor_is_bot

Author

Elastic

Created

2026/09/22

Data Sources

GithubGitHub Audit Logs

Tags

Domain: CloudDomain: SaaSPlatform: GitHubUse Case: Threat DetectionTactic: PersistenceTactic: Credential AccessData Source: GithubData Source: GitHub Audit LogsService: GitHub ActionsRule Type: ES|QLResources: Investigation Guide
Raw Content
[metadata]
creation_date = "2026/09/22"
integration = ["github"]
maturity = "production"
updated_date = "2026/09/22"

[rule]
author = ["Elastic"]
description = """
Identifies the creation of a GitHub Actions, Dependabot, or Codespaces secret at the organization, repository,
environment, or user scope. Secrets are injected into CI/CD workflows at runtime, so an actor with write or admin access
can create a secret to establish durable access or to stage credentials that workflows will consume, allowing malicious
automation to persist even after the initial access path is closed. This technique has been observed in software
supply-chain attacks such as Shai-Hulud. Because creating secrets is also routine for platform and deployment teams, this
rule works best as a building block correlated with the actor, the token used, and any surrounding workflow changes.
"""
false_positives = [
    """
    Onboarding a new deployment environment or rotating CI credentials. Confirm the secret name (`github.key`) and that
    a change ticket exists.
    """,
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "GitHub Actions or Integration Secret Created"
note = """## Triage and analysis

> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

### Investigating GitHub Actions or Integration Secret Created

GitHub records secret creation through `org.create_actions_secret`, `repo.create_actions_secret`, and `environment.create_actions_secret` for Actions secrets, and through `org.create_integration_secret`, `repo.create_integration_secret`, and `user.create_integration_secret` for Codespaces and Dependabot secrets. The audit log records the secret name but never its value. Secrets are made available to workflows at runtime, so a secret created by a compromised or unexpected actor can give malicious automation durable access to cloud or service credentials. Review the actor and token (`user.name`, `github.actor_ip`, `github.hashed_token`, `github.programmatic_access_type`), the scope and name of the secret (`event.action`, `github.org`, `github.repo`, `github.name`), and whether a workflow that consumes the secret was added or changed around the same time to determine whether the creation was legitimate.

### Possible investigation steps

- Identify the actor and the scope of the secret using `user.name`, `event.action`, `github.org`, `github.repo`, and the secret name in `github.name`, and confirm whether the actor normally manages CI secrets.
- Review `github.actor_ip`, `github.hashed_token`, and `github.programmatic_access_type` to determine whether the secret was created interactively or with a PAT or OAuth token, and whether the source is expected for that actor.
- Check whether a workflow file that references the new secret (via `secrets.<NAME>`) was added or modified in the same repository and time window, which can indicate the secret is being wired into attacker-controlled automation.
- Review the actor's recent activity for related persistence actions, such as new PATs, SSH keys, OAuth grants, or outside-collaborator additions.
- Correlate with any surrounding change ticket or rotation schedule to confirm whether the secret creation was planned.

### False positive analysis

- Scheduled credential rotation or first-time environment setup by platform engineering or deployment teams. Confirm the secret name (`github.name`) and that a change ticket exists before dismissing.
- Automation that provisions secrets as part of onboarding a new service or repository. Validate against deployment records and scope exceptions to the specific actor or repository where appropriate.

### Response and remediation

- If the secret was not created by an authorized actor, delete it and rotate any cloud or service credentials it may have referenced.
- Review the repository's workflow files for unexpected `secrets.` usage and remove any malicious or unauthorized workflows.
- Revoke the token identified by `github.hashed_token` and the actor's other tokens if the creation was not approved, and require the user to reauthenticate.
- Review the actor's recent audit activity for additional persistence mechanisms, such as new tokens, SSH keys, or collaborator and permission changes.
- Engage incident response per your organization's playbooks if a supply-chain or account compromise is suspected.
"""
references = [
    "https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack",
    "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
    "https://github.com/SigmaHQ/sigma/blob/master/rules/application/github/audit/github_new_secret_created.yml",
    "https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions",
]
risk_score = 21
rule_id = "85567aa3-04ee-4010-8e27-f6b751c0efd1"
severity = "low"
tags = [
    "Domain: Cloud",
    "Domain: SaaS",
    "Platform: GitHub",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Credential Access",
    "Data Source: Github",
    "Data Source: GitHub Audit Logs",
    "Service: GitHub Actions",
    "Rule Type: ES|QL",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-github.audit-* metadata _id, _index, _version
| where
  data_stream.dataset == "github.audit"
    and (github.actor_is_bot is not null and github.actor_is_bot == false)
    and event.action in (
      "org.create_actions_secret",
      "repo.create_actions_secret",
      "environment.create_actions_secret",
      "org.create_integration_secret",
      "repo.create_integration_secret",
      "user.create_integration_secret"
    )
| keep
    _id,
    _index,
    _version,
    @timestamp,
    event.action,
    user.name,
    github.org,
    github.repo,
    github.actor_ip,
    github.hashed_token,
    github.programmatic_access_type,
    github.user_agent,
    github.name,
    github.actor_is_bot
'''

[rule.alert_suppression]
group_by = ["github.repo", "user.name"]
missing_fields_strategy = "suppress"

[rule.alert_suppression.duration]
unit = "m"
value = 60


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[[rule.threat.technique.subtechnique]]
id = "T1098.001"
name = "Additional Cloud Credentials"
reference = "https://attack.mitre.org/techniques/T1098/001/"



[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"


[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "user.name",
    "github.org",
    "github.repo",
    "github.actor_ip",
    "github.hashed_token",
    "github.programmatic_access_type",
    "github.user_agent",
    "github.name",
    "github.actor_is_bot",
]