LoFP LoFP / onboarding a new deployment environment or rotating ci credentials. confirm the secret name (`github.key`) and that a change ticket exists.

Techniques

Sample rules

GitHub Actions or Integration Secret Created

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.

Detection logic

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