Interview Prep/GitHub Actions/Caching, Artifacts, Runners & ARC

Why should self-hosted runners not be used with public repositories?

AdvancedConceptCaching, Artifacts, Runners & ARC
Answer

Anyone can fork a public repo and open a PR whose workflow (or modified build script) runs on your runner. With a persistent runner, that code can install a backdoor, steal credentials from the host (cloud metadata service, Docker socket, kubeconfig), pivot into your network, or poison the next job. Approval settings for fork PRs reduce but do not remove the risk. If unavoidable: ephemeral runners in an isolated network, no instance role, no secrets on the host, and require approval for all outside contributors.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Runners & ARC