Run self-hosted CI runners with contained risk

8 steps · about 2 h 37 min · Intermediate

  1. Understand the runner trust model (doc, GitHub Docs, 18 min)

    Identify what a runner controls and why repository trust and host isolation matter before installation.

  2. Review workflow attack paths (doc, GitHub Docs, 30 min)

    Connect untrusted inputs, token permissions, third-party actions and runner persistence to concrete controls.

  3. Constrain repository access with runner groups (doc, GitHub Docs, 16 min)

    Keep less-trusted repositories away from sensitive runners instead of exposing one shared worker pool to every build.

  4. Route jobs to intended runner classes (doc, GitHub Docs, 12 min)

    Use labels and groups to prevent sensitive jobs and less-trusted repositories from sharing an undifferentiated pool.

  5. Prefer ephemeral autoscaled runners (doc, GitHub Docs, 25 min)

    Design one-job runners that reduce cross-job persistence and can be replaced from a known image.

  6. Monitor runner health and updates (doc, GitHub Docs, 20 min)

    Collect service, connectivity and update evidence so degraded or stale runners are removed quickly.

  7. Replace stored cloud keys with OIDC (doc, GitHub Docs, 24 min)

    Issue short-lived deployment credentials with narrow claims instead of leaving reusable secrets on runners.

  8. Remove and invalidate a runner safely (doc, GitHub Docs, 12 min)

    Revoke registration, destroy the worker and prove no credentials or workspace state survive the job lifecycle.