IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

GitHub Payment Method Removed

edit

Identifies the removal of a payment method from a GitHub organization or enterprise. Billing changes are high-privilege actions, and an adversary with billing-manager or owner access can delete a payment instrument to disrupt the organization’s paid plan, which can lead to downgraded features, suspended private repositories, and loss of access to paid capabilities. The action may also be used to obscure fraudulent plan changes or to pressure the organization during an extortion or takeover scenario.

Rule type: esql

Rule indices: None

Severity: medium

Risk score: 47

Runs every: 5m

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Domain: Cloud
  • Domain: SaaS
  • Platform: GitHub
  • Use Case: Threat Detection
  • Tactic: Impact
  • Data Source: Github
  • Data Source: GitHub Audit Logs
  • Rule Type: ES|QL
  • Resources: Investigation Guide

Version: 1

Rule authors:

  • Elastic

Rule license: Elastic License v2

Investigation guide

edit

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 Payment Method Removed

The payment_method.remove audit action is logged when a billing manager, organization owner, or enterprise owner removes a payment method. Billing operations are high-privilege and rarely performed, so an unexpected removal can be an attempt to disrupt the organization by causing its paid plan to lapse, which downgrades features and can suspend private repositories. Review the actor (user.name, github.actor_ip), the token used (github.hashed_token, github.programmatic_access_type), and the organization or enterprise affected (github.org, github.business), and correlate with any surrounding plan changes or owner modifications to determine whether the action was authorized.

Possible investigation steps

  • Identify the actor and confirm billing-manager or owner privileges using user.name, github.actor_ip, github.hashed_token, and github.programmatic_access_type, and verify the actor is expected to manage billing.
  • Confirm with the finance or billing owners whether a card rotation, expiry replacement, or plan change was planned for the affected organization or enterprise (github.org, github.business).
  • Review the GitHub billing audit log for related events by the same actor, such as additional payment method changes, plan downgrades, or spending-limit modifications.
  • Check for enterprise or organization owner changes and membership modifications around the same time that could indicate account takeover.
  • Review the actor’s recent activity for other high-impact or destructive actions, such as repository deletions or transfers and visibility changes, that suggest a broader disruption or takeover.

False positive analysis

  • Routine finance operations such as replacing an expired card or rotating payment instruments. Confirm with the billing owners and scope exceptions to the specific actor where appropriate.
  • Planned plan or vendor changes during organizational restructuring. Validate against change-management or finance records before dismissing.

Response and remediation

  • If the removal was unauthorized, restore a valid payment method promptly to avoid a lapse that could downgrade the plan or suspend private repositories.
  • Revoke the token identified by github.hashed_token and the actor’s other tokens if the identity is suspected compromised, and require reauthentication.
  • Review the billing managers, organization owners, and enterprise owners, removing any unauthorized members.
  • Audit recent billing and ownership changes for additional unauthorized modifications by the same actor.
  • Engage incident response and your finance team per your organization’s playbooks if account takeover or fraud is suspected.

Rule query

edit
from logs-github.audit-* metadata _id, _index, _version
| where
  event.module == "github" and data_stream.dataset == "github.audit"
    and event.action == "payment_method.remove"
| keep
    _id,
    _index,
    _version,
    @timestamp,
    event.action,
    user.name,
    github.org,
    github.actor_ip,
    github.hashed_token,
    github.programmatic_access_type,
    github.user_agent,
    github.business

Framework: MITRE ATT&CKTM