Google Cloud IAP on macOS, without the terminal
- Environment (0008,1010)
- macOS workstations → Windows VMs on Google Cloud
- Area (0008,1030)
- Developer tools
- Period (0008,0020)
- 2026
- My role (0008,1070)
- Design, development, release
- Stack (0018,1030)
- Go · Google Cloud IAP · RDP · macOS Keychain · MCP
- Status (0040,0252)
- COMPLETED
Background
Identity-Aware Proxy (IAP) is how Google Cloud lets you reach a VM that has no public IP address. With IAP TCP forwarding, your machine opens a tunnel to Google, Google checks who you are and whether you're allowed in, and only then forwards the connection to the VM's port inside the private network. Nothing is exposed to the internet, and access is controlled by IAM, not by firewall holes or a VPN.
Three things have to be in place on the Google Cloud side:
- an account with
roles/iap.tunnelResourceAccessorto open tunnels, plusroles/viewerandroles/compute.viewerto list projects and VMs; - a VPC firewall rule that allows traffic from Google's IAP range
35.235.240.0/20to the VM; - the target port open on the VM,
3389for Windows RDP.
On Windows, Google's IAP Desktop handles the rest. On macOS there is no official client.
Indication
On a Mac, every connection to a Windows server through IAP meant the same routine: open a terminal, run gcloud compute start-iap-tunnel, pick a free local port, keep that terminal open, copy the port into Remote Desktop, type the password. With several servers a day, it gets repetitive fast, and a wrong port or a closed terminal window means starting over.
Technique
The goal was to remove the routine without touching the security model. The app uses the same Application Default Credentials as gcloud: if gcloud auth application-default login works, the app works. No new access paths, nothing to get approved.
On top of that, it does the parts people do by hand. It lists projects and VMs, opens the IAP tunnel on a free local port, keeps it running, and hands the address to the RDP client. Windows passwords are generated or rotated by the app, stored only in macOS Keychain and attached to the RDP profile, so connecting is one click. The same features are also exposed through an MCP server, so an AI agent like Claude or Cursor can open a tunnel or debug a stuck one on request.
flowchart LR
r["RDP client<br/>Windows App / FreeRDP"] -->|localhost| m["macOS app<br/>free local port"] -->|IAP tunnel| i["Cloud IAP<br/>identity check"] -->|3389| v["Windows VM<br/>no public IP"]
k[("Keychain")] -.->|password| r
classDef on stroke:#38bdf8,color:#eef0f2
class m onFindings
- Visual tunnel management. Projects and VMs load automatically, with live search. Pick a VM and a port, and the tunnel starts on a free local port.
- Several tunnels at once. Each one is started, stopped and monitored on its own, with logs in the UI instead of open terminal windows.
- One-click RDP. Windows App bookmarks are created and updated when ports change, or FreeRDP is launched directly with clipboard and sound.
- Credentials in Keychain. The app generates or rotates the Windows password and stores it only in macOS Keychain, attached to the RDP profile.
- AI agents through MCP. 32 MCP tools and 5 skills let an agent list VMs, open tunnels, rotate passwords and debug connections. Destructive actions are marked so the client asks before running them.
- Signed and open source. Code-signed and notarized by Apple, no telemetry, published on GitHub.
Impression
| Tag | Data |
|---|---|
| (0040,A30A) | PlatformmacOS, where Google offers no IAP client |
| (0040,A30A) | Steps to connectTerminal + port + RDP → one click |
| (0040,A30A) | Tunnels at onceMultiple |
| (0040,A30A) | MCP tools32 |
| (0040,A30A) | Bundled agent skills5 |
| (0040,A30A) | DistributionOpen source, signed and notarized |
Lessons
- Wrap the security model, don't replace it. Reusing Application Default Credentials meant the tool needed no new permissions and no security review.
- The pain is in the glue, not the protocol. IAP itself worked fine; free ports, open terminals and retyped passwords were what made it painful.
- Keep secrets where the OS keeps them. Keychain plus the RDP profile gives one-click access without a password file anywhere.
- If you build a tool, give agents the same tool. An MCP server over the same core made the app usable from Claude and Cursor at almost no extra cost.
- Sign what you ship. An unsigned macOS app gets blocked on first launch; signing and notarization remove the most common reason people give up.
References
| Source code | github.com/kvysotskyi/go-iap-mac ↗ |
| Article | Making Google Cloud IAP usable on macOS ↗ |