Anyone who runs GitLab Runner on Kubernetes eventually meets this problem. A project wants docker build in its pipeline. The usual answer is Docker-in-Docker (docker:dind), and DinD wants privileged: true. A privileged container can load kernel modules, mount host devices and, on most setups, trivially become root on the node. Every job from every project that can reach that runner then has that power.
The previous post was about Windows jobs on throw-away VMs. macOS is the same wish with harder constraints:
macOS may only legally run on Apple hardware, so you cannot just launch a VM from a cloud image on any host. On AWS, that hardware is an EC2 Mac, which is a dedicated host. You pay for the host, not for the instance, and a host cannot be released before 24 hours after it was allocated. A shell executor on a Mac is the easy approach, and it is how most people start. Every job then runs as the same user, in the same filesystem, with the same keychain. State leaks between jobs, and so do secrets. The setup in this post gets one clean VM per job on a small number of Macs, without giving up much of the simplicity.
Most of my GitLab Runner experience is Linux containers on Kubernetes (see the GKE as Gitlab Runner post). Windows jobs are a different story, and the first thing to learn is that “Windows runner” can mean two quite different things: