r/iOSProgramming • u/ToddGergey • 49m ago
Article What's left on a self-hosted Mac mini after a few months of CI jobs
Disclosure: I work at Bitrise, and we sell hosted Mac runners. The main points are here so you don't have to click.
If you run GitHub Actions on your own Mac minis, the runner usually keeps its disk between jobs. Over time that means certificates imported into the keychain by signing steps that never removed them, an App Store Connect API key from a TestFlight upload, cloud credentials from a deploy job, and the checkout of every repo that has built there.
In November, hijacked GitHub accounts pushed a script into thousands of repos' workflows that collected whatever credentials it could find on the runner. On a fresh VM it only finds that job's secrets. On a shared Mac it can find the release signing setup of an app that has nothing to do with the repo it came in through.
Things that help without changing your setup:
- Delete the keychain and any key files at the end of every job that creates them
- Keep repos with outside contributors on different Macs from your release builds, using runner groups
- Don't attach self-hosted runners to public repos
- Log in to one runner and look through its home folder
Making Mac runners properly ephemeral means macOS VMs (Tart or Anka) and a base image with your Xcode versions that someone keeps current. The write-up compares that with the other options: https://bitrise.io/blog/post/github-actions-self-hosted-runner-security
Anyone here actually rebuilding their Macs between jobs?
