Skip to content

Adjust macOS subprocess policy - #23909

Merged
MikeMcQuaid merged 1 commit into
mainfrom
macos-service-policy
Sep 9, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
macos-service-policy

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Keep sandboxed macOS subprocesses focused on command-line work by disabling application launching and cross-application automation.
  • Apply the same policy when network access is enabled and document the behaviour for cask steps.
  • Add profile and application-launch checks, allowing profile checks to run when Homebrew is already inside a sandbox.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex with GPT 6 Astra at High effort, with local review and testing.


Copilot AI balanced review requested due to automatic review settings September 9, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃煛 Changes recommended

LaunchServices control tests incorrectly bypass the nested-sandbox guard and can fail or pass spuriously under the new profile.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Tightens macOS sandbox subprocess permissions and documents the resulting cask behaviour.

Changes:

  • Restricts Mach service lookups, LaunchServices and Apple Events.
  • Adds LaunchServices registration tests.
  • Documents sandbox restrictions for cask steps.
File summaries
File Description
Library/Homebrew/extend/os/mac/sandbox.rb Adds the Mach service allowlist.
Library/Homebrew/test/sandbox_spec.rb Tests profile and application registration restrictions.
docs/Cask-Cookbook.md Documents macOS sandbox behaviour.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/test/sandbox_spec.rb Outdated
- Define the system services available to macOS subprocesses so
  command-line installation tasks have a consistent environment.
- Keep directory, power, network and certificate services available
  and document the macOS-specific behaviour for cask steps.
- Extend native coverage for application registration and verify the
  Core Foundation conversions used by the test queries.
- Skip live service checks in nested sandboxes, where availability
  depends on the outer profile.
- Validate with `brew lgtm --online` and all 21 native sandbox tests.
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 4ef2edc Sep 9, 2026
51 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the macos-service-policy branch September 9, 2026 18:10
@ReenigneArcher

Copy link
Copy Markdown

This change made all my macOS homebrew builds in GitHub workflows hang forever with no output or reason why.

https://github.com/LizardByte/Sunshine/actions/runs/34400297073/job/102630487762#step:9:560

@botantony

Copy link
Copy Markdown
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants