Repository navigation
sandbox: allow Keychain trust evaluation on macOS - #24120
Merged
MikeMcQuaid merged 2 commits intoSep 29, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
馃煝 Approval recommended
The requested sandbox permission and corresponding test updates are complete.
Review effort: Lite
Findings: None
What changed in this PR
Adds macOS sandbox access to com.apple.TrustEvaluationAgent, enabling Git certificate validation for Keychain-trusted CAs.
Changes:
- Adds the service to the macOS
mach-lookupallowlist. - Updates sandbox specs to verify the permission.
| File | Description |
|---|---|
Library/鈥婬omebrew/鈥媡est/鈥媠andbox_spec.rb |
Verifies the service in the generated sandbox profile. |
Library/鈥婬omebrew/鈥媏xtend/鈥媜s/鈥媘ac/鈥媠andbox.rb |
Allows TrustEvaluationAgent lookup. |
馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Git downloads now run in the sandbox. The system Git falls back to `com.apple.TrustEvaluationAgent` to trust certificate authorities that are only trusted in the macOS Keychain (e.g. private or corporate CAs). With that service denied, cloning from such hosts fails with "SSL certificate problem: unable to get local issuer certificate".
- Gate `com.apple.TrustEvaluationAgent` on network access because trust evaluation can fetch certificates and revocation data. - Keep offline sandboxes restricted, including local socket exceptions, and cover both cases with regression tests.
MikeMcQuaid
force-pushed
the
sandbox-trust-evaluation-agent
branch
from
September 29, 2026 15:53
b78c778 to
23b3637
Compare
MikeMcQuaid
approved these changes
Sep 29, 2026
MikeMcQuaid
left a comment
Member
There was a problem hiding this comment.
Thanks! Have adjusted to ensure that this is only allowed when network access permitted rather than unconditionally.
MikeMcQuaid
enabled auto-merge
September 29, 2026 15:56
p-linnane
approved these changes
Sep 29, 2026
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.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?AI was used: Claude Code (Claude Opus 5.5) helped investigate the failure, find the missing service and draft the change and this description. I verified it as described below.
What
Adds
com.apple.TrustEvaluationAgentto themach-lookupallowlist in the macOS sandbox profile, next tocom.apple.trustd.agent.Why
Since #24038 (c9bfdc3, "Extend sandboxing to package processing"), which first shipped in 7.0.7, Git downloads run under
sandbox-exec. The system Git (/usr/bin/git, Apple Git) checks certificates against/etc/ssl/cert.pemfirst. For a certificate authority that's only trusted in the macOS Keychain (private or corporate CAs, TLS-inspecting proxies), it falls back tocom.apple.TrustEvaluationAgent. The sandbox denies that lookup, so cloning from such a host fails:The same
git cloneworks outside the sandbox and on 7.0.6. Hosts with public CAs aren't affected.I found the service by bisecting the
mach-lookupallowlist: with the current profile, adding only(global-name "com.apple.TrustEvaluationAgent")makes the clone succeed;com.apple.trustd,com.apple.securityd.xpcand other Security services alone do not.Reproduction
Requires an HTTPS Git server whose certificate chains to a CA trusted only in the System Keychain (
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.pem).Verification
With the CA trusted in the System Keychain, on macOS 15.7.7 (VM) and macOS 27.0.1:
brew install repro/local/hello-repromain(47b6582)main+ this changebrew lgtmpasses on the macOS 15.7.7 VM. The updated spec fails without thesandbox.rbchange.