fix: strip keychain-access-groups entitlement in release builds#44
Open
Chefski wants to merge 1 commit intosteipete:mainfrom
Open
fix: strip keychain-access-groups entitlement in release builds#44Chefski wants to merge 1 commit intosteipete:mainfrom
Chefski wants to merge 1 commit intosteipete:mainfrom
Conversation
The release build was being killed by AMFI on macOS 15.7+ because it shipped with a keychain-access-groups entitlement but no provisioning profile to validate it. The dev build already strips this entitlement when no profile is present. This aligns the release build default. Closes steipete#27, closes steipete#29, closes steipete#34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release build is killed by AMFI (Apple Mobile File Integrity) on macOS 15.7+ and Tahoe because it ships with a
keychain-access-groupsentitlement but no provisioning profile to validate it. This affects every user who installs the release binary (issues #27, #29, #34). The local dev build works fine because it already strips this entitlement.One-line fix: Change the default for
REPOBAR_SKIP_KEYCHAIN_GROUPSfrom0to1inScripts/sign-and-notarize.sh, so the release build strips the entitlement by default — matching the dev build behavior.Closes #27, closes #29, closes #34
Root Cause
sign-and-notarize.sh:55defaultedREPOBAR_SKIP_KEYCHAIN_GROUPSto0(keep entitlement)compile_and_run.sh:47-49defaults to1(strip entitlement) when no provisioning profile existskeychain-access-groups: Y5PE65HELJ.com.steipete.repobar.sharedbut noembedded.provisionprofileto satisfy AMFIWhy This Is Safe
TokenStore.swiftalready handles the missing entitlement gracefully:defaultAccessGroup()(line 92-111) returnsnilwhen the entitlement isn't presentaccessGroupsForOperation()(line 169-172) falls back to[nil]— keychain ops work without an access groupshouldRetryWithoutAccessGroup()(line 186-194) retries onerrSecMissingEntitlementThe only trade-off: the app and bundled CLI (
repobarcli) won't use a shared keychain access group. Both use their default group, which means tokens saved by one won't be directly readable by the other. This is the same behavior the dev build has always had.The override is preserved — set
REPOBAR_SKIP_KEYCHAIN_GROUPS=0if a provisioning profile is available.Prompts Used
Plan
Full investigation and fix plan
Context
The release build of RepoBar is killed by AMFI (Apple Mobile File Integrity) on macOS 15.7+ and Tahoe because it includes a
keychain-access-groupsentitlement without a provisioning profile to validate it. This affects every user who installs the release binary (issues #27, #29, #34). The local dev build (pnpm start/compile_and_run.sh) works because it strips this entitlement when no provisioning profile is present.Root Cause
sign-and-notarize.sh:55defaultsREPOBAR_SKIP_KEYCHAIN_GROUPSto0(keep entitlement)compile_and_run.sh:47-49defaults to1(strip entitlement) when no provisioning profile existskeychain-access-groups: Y5PE65HELJ.com.steipete.repobar.sharedbut noembedded.provisionprofileto satisfy AMFIFix
One-line change in
Scripts/sign-and-notarize.sh:Change line 55 from:
To:
Why This Is Safe
TokenStore.swiftalready handles the missing entitlement gracefully:defaultAccessGroup()(line 92-111) returnsnilwhen the entitlement isn't presentaccessGroupsForOperation()(line 169-172) falls back to[nil]— keychain ops work without an access groupshouldRetryWithoutAccessGroup()(line 186-194) retries onerrSecMissingEntitlementVerification
pnpm start— confirm it still works (no change to this path)codesign -d --entitlements :- /Applications/RepoBar.app 2>&1— confirmkeychain-access-groupsis absentTest plan
pnpm start— confirm dev build still workssign-and-notarize.sh— confirm app launches without AMFI rejectioncodesign -d --entitlements :-— confirmkeychain-access-groupsis absent