Skip to main content
Your runner strategy is one of the most important architectural choices for any enterprise using GitHub Actions. The right approach delivers fast, secure, and cost-effective CI/CD. The wrong approach can cause unexpected cloud bills, outages, and on-call incidents when self-hosted runners fail.
Choose a runner strategy that balances security, network access, maintainability, and cost. This guide compares the three compute options and explains how to govern self-hosted runners safely.
Think of the three compute options as transportation choices:
  • GitHub-hosted runners: a managed ride-hailing service (fast and maintenance-free).
  • Self-hosted runners: your company car fleet (full control, full responsibility).
  • Azure Private Networking: managed compute with private network access (the best of both worlds for Azure customers).
Overview comparison For full documentation, see: GitHub-hosted runners (the “Uber” analogy)
  • Launch ephemeral runners on demand.
  • No maintenance, OS patching, or scaling for your team.
  • Limited to the network boundaries GitHub permits — they cannot reach your private, firewalled networks.
Self-hosted runners (the “company car fleet” analogy)
  • You provision and maintain the runner hosts.
  • They can access internal services, on-premise databases, and private networks.
  • You are responsible for security, updates, and incident response — if a runner fails at 3 AM, your team must handle it.
A slide titled "Self-Hosted Runners" showing a garage icon with two cars to represent self-hosted runners. To the right are three rounded labels — "You own them", "You maintain them", "You patch them" — and a small "Your firewall" brick icon with an arrow.
When a self-hosted runner breaks or is compromised, that is your on-call and remediation responsibility. Plan capacity, patching, and monitoring accordingly. Azure Private Networking (managed compute with private network access)
  • GitHub provisions and manages the runners, but they receive private IPs inside your Azure Virtual Network (VNet).
  • This gives you the convenience of managed compute while allowing secure access to internal Azure resources.
A slide titled "Azure Private Networking" with step 3 highlighted and a green outline car illustration labeled "Managed for you, like Uber" and a "Special road access permits" callout. The faded step indicators for "GitHub-Hosted Runners" and "Self-Hosted Runners" appear at the top.
Runner groups and governance If you adopt self-hosted runners, govern access using runner groups. Runner groups control which repositories may use which self-hosted runners. The default behavior is a significant risk: a newly registered self-hosted runner is placed into a default group that permits access from all repositories in the organization.
A slide showing "Runner Groups" with a registered self-hosted runner named "self-hosted-01" set to access "All repositories" (noted as the shipped default) and a small governance risk warning. Below it is a simple diagram showing "Any developer" pointing to "Your self-hosted runner."
How to secure runner groups (UI steps)
  1. Open your organization or repository Settings → Actions → Runners → Runner groups.
  2. Select the runner group to configure.
  3. Change visibility from “All repositories” to “Selected repositories.”
  4. Explicitly check the repositories that are allowed to use that runner group.
  5. Audit and rotate runner hosts and credentials regularly.
A screenshot of a settings screen titled "Restricting Access to Selected Repositories" showing a runner group ("self-hosted-01") with the "Selected repositories" option enabled. Several repositories (payments-api, web-app, mobile-ios) are marked allowed with green checkmarks while others show "not on the list" with red Xs.
Never use self-hosted runners with public repositories. Doing so allows an attacker to fork a public repo, add a malicious workflow, and open a pull request that could run on your self-hosted runner. That gives an attacker remote code execution inside your internal network.
A diagram titled "The Public Repository Rule" illustrating a five-step attack flow. It shows an attacker forking a public repo, adding a malicious workflow, opening a pull request that runs on a self-hosted runner and executes code inside the internal network.
This kind of foothold can enable lateral movement and data exfiltration. Enforce the public-repo rule and use repository-level protections, branch protections, and required reviewers for critical repositories. Governance checklist (quick reference)
  • Never pair self-hosted runners with public repositories.
  • Use runner groups with “Selected repositories” visibility for least privilege.
  • Prefer GitHub-hosted runners when you do not need private network access.
  • If using Azure, evaluate GitHub-hosted runners with Azure Private Networking to combine managed compute and private VNet connectivity.
  • Monitor and alert on runner registration, runner health, and unauthorized access attempts.
A slide titled "Exam Facts" listing three numbered points about GitHub runners and networking/security. It warns that self-hosted runners with public repos are a security risk, says Azure private networking gives runners a private IP, and notes runner groups must use selected repositories.
Further reading and references

Watch Video