Files
2026-11-09 10:13:51 +08:00

135 lines
3.2 KiB
Markdown

---
layout: default
title: Scenarios — runaway
---
# Scenarios
## Before buying a used Mac
Check the serial number before you buy:
```bash
./runaway predict ABC12345678 # check serial against known org prefixes
./runaway check # is this Mac safe to wipe?
```
`predict` looks up the device serial against known MDM org prefixes.
If it matches JAMF, Mosyle, or another org, you know what you're dealing with before you buy.
---
## Recovery after Migration Assistant
1. Fresh install macOS on a new Mac
2. Migration Assistant copies your old data
3. MDM appears within minutes of login
**Fix:** Boot to Recovery and run:
```bash
./runaway suppress
```
Or `bypass` if you need a new admin user. This removes the DEP markers,
user-level artifacts, and MDM preferences that MA transferred over.
*This is the #1 case most other tools miss — Runaway handles it.*
---
## macOS update brought MDM back
1. System update restores enrollment daemons automatically
2. MDM block in `/etc/hosts` is often preserved
**Fix:**
```bash
sudo ./runaway heal
```
Re-disables daemons and re-checks all layers. If you ran `persist`
before the update, this happens automatically on the next boot.
---
## Buying a former office Mac
1. The serial might still be in the company's ABM
2. Even after a clean wipe, connecting to Wi-Fi at Setup Assistant triggers enrollment
**Strategy:**
1. Boot to Recovery **without connecting to Wi-Fi**
2. Run `runaway bypass` before the device ever phones home
3. Run `runaway persist` and `runaway whitelist` so it stays clean
4. Only then connect to the internet
The serial stays in ABM forever — but as long as the device never
connects with full protections removed, it will not re-enroll.
---
## Used Mac that already has a user logged in
```bash
sudo ./runaway audit # check current state
sudo ./runaway harden # kill MDM processes immediately
sudo ./runaway whitelist # block MDM while keeping iCloud
sudo ./runaway persist # survive future updates
```
---
## Setting up a new Mac before first boot
1. Boot to Recovery without Wi-Fi
2. Run `runaway init` — interactive wizard
3. It will: suppress MDM, install persist, install whitelist, run audit
4. Reboot, set up normally, MDM never bothers you
---
## Org-provided Mac (must enroll on VPN only)
Some organizations require the Mac to enroll but only when connected to the corporate VPN.
```bash
sudo ./runaway vpn-kill
```
This installs a pf kill-switch that blocks MDM traffic when the device
is NOT connected to the VPN tunnel. MDM can only communicate through
the encrypted VPN connection.
---
## After a full DFU/IPSW restore
A DFU restore erases everything but doesn't remove ABM assignment.
1. Restore via Apple Configurator 2
2. **Do not connect to Wi-Fi**
3. Boot to Recovery
4. Run `runaway bypass`
5. Run `runaway persist && runaway whitelist`
6. Reboot and connect to the internet safely
---
## Automated deployment (IT admins)
For deploying across multiple machines:
```bash
# Scripted bypass
./runaway suppress --log-file /var/log/runaway-deploy.log
# With persist + monitor
sudo ./runaway persist
sudo ./runaway monitor
# Audit report in JSON
sudo ./runaway report --json
# Discord alerts
sudo ./runaway discord-bot <token> <userId>
```