Skip to content

screencapture grant: also grant /bin/bash for failure screenshots (RELOPS-2454) - #77

Merged
rcurranmoz merged 1 commit into
mainfrom
relops-2454-screencapture-bash
Sep 23, 2026
Merged

rcurranmoz merged 1 commit into
mainfrom
relops-2454-screencapture-bash

Conversation

@rcurranmoz

Copy link
Copy Markdown
Collaborator

Why

Failure screenshots on SIP-on gecko-t-osx-1500-m4 hosts are always blank (RELOPS-2454). The screenshot LaunchAgent (ronin macos_screenshot_helper, com.mozilla.screencapture) runs a bash script, so TCC attributes the capture to /bin/bash, not to the worker binaries that #76 grants. Nothing grants bash on SIP-on hosts (macos_tcc_perms writes it only with SIP off), so screencapture "succeeds" but returns only the wallpaper and app menus: no windows, and no menu-bar clock.

Measured over 2026-09-09..23 (2,091 failure screenshots, 166 hosts):

hosts /bin/bash ScreenCapture permission-blank
41 SIP-on none 475 / 475
125 SIP-off granted 0 / 1,542

What

  • screencapture-approve.sh now also adds /bin/bash. Bash isn't listed in the Screen Recording pane until it's added, so it goes in via the "+" button, the admin sheet and Go-to-Folder, and lands ticked. If bash is already listed but unticked, it's ticked instead.
  • /bin/bash is required by both the already-granted short-circuit and the final verify, so a missing bash row fails the step instead of passing it.
  • Added a regression test that the packaged payload grants and verifies bash.

Proof

Tested on macmini-m4-118 (SIP on) through the real LaunchAgent trigger, with TextEdit frontmost:

  • Before the grant: 59 KB blank frame.
  • After the grant: 400 KB frame showing the window and the clock. The row reads /bin/bash 2/4/0, and it survives a reboot.

Trade-off

This gives SIP-on hosts the same access SIP-off hosts already have: any bash running as cltbld can capture the screen. A narrower Developer-ID-signed capture helper is the planned follow-up.

🤖 Generated with Claude Code

…LOPS-2454)

The failure-screenshot LaunchAgent (ronin macos_screenshot_helper) runs a bash
script, so TCC attributes its captures to /bin/bash, not the worker binaries.
On SIP-on hosts nothing grants bash (macos_tcc_perms writes it only with SIP
off), so screencapture returns wallpaper + app menus only: 475/475 failure
screenshots from SIP-on hosts were blank over 2026-09-09..23, vs 0/1,542 on
SIP-off hosts.

bash is not listed in the Screen Recording pane until added, so it goes in via
the "+" button + Go-to-Folder. It is now required by both the already-granted
short-circuit and the final verify. Proven on macmini-m4-118: 59KB blank ->
400KB capture with window + clock, row /bin/bash 2/4/0, survives reboot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rcurranmoz
rcurranmoz requested a review from a team as a code owner September 23, 2026 13:43
@rcurranmoz
rcurranmoz merged commit 8d5dd48 into main Sep 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant