Sign sbd with a stable identity so a Full Disk Access grant survives updates

Open
#386 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
macos, swift
Domain
desktop, security

Research direction

Start with bin/build, bin/update, and the launch agent setup for com.haacked.switchboard.sbd; inspect how the app and binaries are signed and how the tmux server starts. The proposal also calls for README changes and possibly SMAppService registration with AssociatedBundleIdentifiers. Done means a Full Disk Access grant remains effective after bin/update, with the restart steps documented.

Written by the indexing model from the issue text.

Description

priority: low

A command run in a Switchboard shell can't read files that macOS protects with Full Disk Access, and there's no lasting way to grant that access.

Example: bin/hogli metabase:login --region eu --browser chrome in a Switchboard shell fails with "chrome cookie data can't be read (the OS is blocking this terminal from it)". The same command works in a terminal app that has Full Disk Access.

Why: Switchboard's shells and sessions run in a tmux server that sbd starts. sbd runs as the launch agent com.haacked.switchboard.sbd, so macOS treats sbd as the process responsible for those shells, not the app or the user's terminal. Both Switchboard.app and Contents/MacOS/sbd are ad-hoc signed (codesign -dv shows Signature=adhoc, no team identifier, and an sbd-<hash> identifier for sbd). macOS ties a privacy grant for an ad-hoc signed binary to that exact build. So a user could add sbd under Full Disk Access, but the next bin/update builds a new binary and the grant stops applying.

Proposal:

  • Sign Switchboard.app, sbd and sb with a stable identity in bin/build and bin/update: an Apple Development or Developer ID certificate when one is in the keychain, or otherwise a self-signed code-signing certificate that the build creates once and reuses. Give sbd a fixed identifier, such as com.haacked.switchboard.sbd.
  • Consider registering sbd with SMAppService and AssociatedBundleIdentifiers, so macOS attributes sbd to Switchboard.app. Then one Full Disk Access grant on the app covers sbd and the shells it starts.
  • Document in the README how to grant Full Disk Access, and that sbd and the tmux server have to restart afterwards.
  • Check that a grant survives a bin/update.
Dominant language
Swift
Stars
0
Forks
0
Avg merge
6h 15m
Merged PRs (30d)
308

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haacked/switchboard

All issues in haacked/switchboard

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.