Security teams should add runtime monitoring and network filtering at the runner image level so controls apply automatically to every workflow that uses that image. The practical goal is to secure persistent and ephemeral runners without rewriting workflow files. Teams should also define authorized destinations and review alerts from past runs so allowlists stay aligned with real build traffic.
Why self-hosted runners need image-level controls
Self-hosted VM runners are different from hosted runners because they can keep state, reach internal systems and retain the same runtime footprint across many jobs. That means the safest place to enforce guardrails is the runner image itself, so the same monitoring, egress policy and baseline hardening apply whenever the image starts. The GitHub and GitHub Actions Security Guide is a useful starting point for the runner hardening side of that model.
Image-level controls also reduce the need to touch workflow files, which is important when teams want to improve security without breaking existing pipelines. The aim is to make the runner safe by default, then let workflows keep operating inside that safer boundary. If controls depend on every repository owner editing YAML, coverage will usually lag behind risk.
For teams that already manage CI/CD as a security boundary, the key question is not whether the job is trusted, but whether the runner can constrain what the job can reach. That is why the control plane should focus on image build, startup policy and network posture rather than ad hoc changes inside individual workflows. NHIMG’s CI/CD Pipeline Identity Security Guide covers this broader pipeline-control view, including pinned actions and untrusted builds.
What to allow, what to deny, and why it matters
Authorized destinations should be explicit, because self-hosted runners often have far more reach than the workflow actually needs. Restricting outbound access to known package registries, source control endpoints, artifact stores and required internal services lowers the blast radius if a job or action is tampered with. The same allowlist should be reviewed against real build traffic so that legitimate destinations are not blocked and stale entries can be removed.
Monitoring should be tuned to the runner lifecycle, not just to the repository. A persistent runner can accumulate tooling, cached files and residual credentials, while an ephemeral runner can still leak data during execution if its image or bootstrap process is weak. The practical control is to watch for unexpected child processes, abnormal outbound requests, and accesses that do not match the normal build pattern.
Teams should also treat workflow tampering and secret exposure as separate questions. A workflow can remain functionally intact while still being abused to exfiltrate tokens, contact malicious infrastructure or stage a later compromise. That is why a review of past runs matters: it shows whether the allowlist is overbroad, whether alerts are noisy, and whether the runner is already talking to places it should not.
How to keep pipelines working while tightening the runner
The lowest-friction pattern is to standardise hardened runner images and make the control set part of the image lifecycle, not the repository lifecycle. That lets you update telemetry, egress policy and baseline tooling centrally, then roll the new image through jobs without rewriting pipeline logic. Where possible, keep the image generic enough for normal builds, but strict enough that a compromised job has limited room to move.
It also helps to separate blocking controls from detective controls. Blocking should focus on destinations that are clearly out of policy, while alerts should capture unusual but not yet proven-malicious activity. This avoids breaking jobs when teams are still learning what normal looks like, and it gives security teams evidence before they tighten the boundary further.
If a workflow needs broad network reach to function, that is usually a sign to narrow the job design or split responsibilities. A runner that can reach everything is easier to operate in the short term, but it gives attackers a much cleaner path if the workflow, action or dependency chain is compromised.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.AA-05 — Least Privilege | Runner egress and access limits reduce excessive permissions for build jobs. |
| DE.CM-01 — Networks and network services are monitored to detect potential cybersecurity events | The answer depends on runtime monitoring of runner traffic and behavior. | |
| Recommendation — Enforce least privilege for runner network and system access. Monitor runner network and process activity for abnormal behavior. | ||
| NIST SP 800-53 Rev 5 | SC-7 — Boundary Protection | Self-hosted runners need network filtering at the boundary to constrain job reach. |
| SI-4 — System Monitoring | Alerting on unusual runner activity is central to the recommended control model. | |
| CM-7 — Least Functionality | Hardened runner images should include only the services and tools jobs need. | |
| Recommendation — Restrict runner communications to approved destinations. Collect and review runner telemetry for suspicious execution. Minimise runner image functionality to the required baseline. | ||
Practitioner Guidance
What to prioritise: Start with egress control, image hardening and runtime visibility on the runner itself, because those three measures protect every workflow that lands on that image without requiring per-repo changes.
What to verify: Confirm that the runner can only reach the destinations needed for normal builds, that alerts capture unusual outbound traffic, and that image updates do not quietly reintroduce broad network access or leftover tooling.
Decision rule: If a control would force developers to edit workflow files before they can ship, prefer an image-level or platform-level control first; use workflow changes only when the job itself truly needs to change.
Practitioner takeaway: The safest model is to make the runner enforce the boundary, then let workflows run inside it, rather than asking every pipeline author to implement security independently.
Related resources from NHI Mgmt Group
- How should security teams secure self-hosted GitHub Actions runners in Kubernetes without losing delivery speed?
- How should security teams protect GitHub Actions jobs running on AWS CodeBuild-hosted runners?
- What happens when self-hosted GitHub Actions runners are used for untrusted workflows?
- How should security teams secure GitHub Actions runners without exposing internal services to the public internet?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org