LoFP LoFP / onboarding a contractor or vendor as an outside collaborator, or adding a personal account during a documented inner-source exercise. confirm the collaborator, repository, and permission with the repo owners.

Techniques

Sample rules

GitHub Outside Collaborator Added to Repository

Description

Identifies an outside collaborator being added to a GitHub repository. An outside collaborator is an individual account that is not a member of the organization but is granted direct access to one or more repositories. An attacker who has compromised an account or token can add a collaborator they control to retain access to private source code after the original credential is revoked, bypassing organization SSO and team-based review. This is distinct from adding an organization member (org.add_member), which is covered by a separate rule.

Detection logic

from logs-github.audit-* metadata _id, _index, _version
| where
  data_stream.dataset == "github.audit"
    and event.action == "org.add_outside_collaborator"
| 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.permission