Restrict macOS preference reads to full-disk policies (#39811)

## Why

The macOS preferences service can expose data outside a sandbox's allowed
filesystem read roots.

## What changed

- Move the Seatbelt preference and `cfprefsd` grants into a separate policy
  section that is included only when filesystem reads are unrestricted.
- Remove the equivalent grants from the restricted platform defaults.

## Testing

- Verify both Seatbelt profiles include preference grants only for full-disk
  read policies, including policies with denied paths or globs.
- Verify a restricted sandbox cannot retrieve a preference whose plist is
  denied, while an unrestricted read policy can.

GitOrigin-RevId: 90388366a7302bca1830ad0439544be8babc7321
This commit is contained in:
Jeremy Rose authored and copyberry committed 2026-08-20 23:18:55 +00:00
1 parent 3cde5d4ccd
commit 21facf2273
6 files changed
+238 -24

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ codex_rust_crate(
"src/restricted_read_only_platform_defaults.sbpl",
"src/seatbelt_base_policy.sbpl",
"src/seatbelt_network_policy.sbpl",
"src/seatbelt_preferences_policy.sbpl",
],
crate_name = "codex_sandboxing",
test_tags = ["no-sandbox"],