A shared runner executes jobs from untrusted forks. What are the risks and mitigations?
AdvancedScenarioGitLab CI
Answer
Situation read → External code on shared infrastructure.
What I'd do →
- Run fork MR pipelines only after maintainer approval, and do not expose protected variables to them.
- Use ephemeral, isolated runners (Kubernetes pods or autoscaled VMs), no Docker socket binding, and no privileged mode.
- Restrict network egress from runners and avoid long-lived credentials on runner hosts.
Why → CI runners execute arbitrary code by design.
Interview tip → Mention "runner is the trust boundary".
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate