Self-hosted runners: Write
Why Tier 1
Registers runners, also as one-job just-in-time runners, sets their labels and deletes them. Changes runner groups: which repositories and workflows may use them, whether public repositories may, and which network configuration they use. A runner the attacker controls receives the jobs, and the secrets, of every repository allowed to use it. Opening a group to public repositories lets a pull request from a fork run on its runners.
Can reach T0 when jobs that run in a runner group hold an organization-wide credential, such as an owner's token or a GitHub App private key: a runner registered into that group with the labels those jobs ask for can receive them.
Inferred from: GitHub Docs: use in a workflow, GitHub Docs: self hosted runners
- Target
- Organization
- Plane
- ManagementRunners: Self-hosted runners, runner groups, hosted runner images and their networks.
- Granted by
- Fine-grained PAT, GitHub App
- Available on
- Every setup
What it unlocks
17 REST endpoints need this permission, from GitHub's docs data. Some also need another permission, and a few work with only one kind of token.
- POST /orgs/{org}/actions/runner-groups
- PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}
- DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}
- PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories
- PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}also needs a permission GitHub's data does not name
- DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}also needs a permission GitHub's data does not name
- PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners
- PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}
- DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}
- POST /orgs/{org}/actions/runners/generate-jitconfig
- POST /orgs/{org}/actions/runners/registration-token
- POST /orgs/{org}/actions/runners/remove-token
- DELETE /orgs/{org}/actions/runners/{runner_id}
- POST /orgs/{org}/actions/runners/{runner_id}/labels
- PUT /orgs/{org}/actions/runners/{runner_id}/labels
- DELETE /orgs/{org}/actions/runners/{runner_id}/labels
- DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}
Roles that include it
- T0OwnerThe organization and every repository in it
- T1CI/CD adminThe organization's Actions setup
Custom role permissions that add it
An owner can build a custom role from these on Enterprise Cloud. Nobody holds one until a custom role with it is assigned.
- Manage organization runners and runner groups
write_organization_runners_and_runner_groupsorganization role
Classic scopes that reach it
- T0admin:orgdocumented
- T1manage_runners:enterprisestated by GitHub
Attack paths
Techniques it enables
- Register the attacker's machine as a runner Keep access
Escalations it starts
- Register a self-hosted runner: Every job routed to that runner, with the secrets those jobs receive, and a foothold that outlives the stolen token.
- Bake a backdoor into a custom runner image: Code in every later job on runners that use the image, in every repository allowed to use them, with those jobs' secrets.
Other levels
GitHub Docs: Organization permissions for "Self-hosted runners"