;;; Copyright (c) 2023 Apple Inc. All Rights reserved. ;;; ;;; WARNING: The sandbox rules in this file currently constitute ;;; Apple System Private Interface and are subject to change at any time and ;;; without notice. ;;; (version 1) ;;; TODO: Change these to deny before finalizing this profile. ;;; (allow (with report) default) ;;; (allow (with report) file-map-executable process-info* nvram*) ;;; (allow (with report) dynamic-code-generation) (deny default) (deny file-map-executable process-info* nvram*) (deny dynamic-code-generation) (deny mach-priv-host-port) (import "system.sb") (import "com.apple.corefoundation.sb") (corefoundation) ;;; Homedir-relative path filters (define (home-regex home-relative-regex) (regex (string-append "^" (regex-quote (param "HOME")) home-relative-regex))) (define (home-subpath home-relative-subpath) (subpath (string-append (param "HOME") home-relative-subpath))) (define (home-prefix home-relative-prefix) (prefix (string-append (param "HOME") home-relative-prefix))) (define (home-literal home-relative-literal) (literal (string-append (param "HOME") home-relative-literal))) (allow process-info* (target self)) ;; For resolving symlinks, realpath(3), and equivalents. (allow file-read-metadata) ;; For validating the entitlements of clients. (allow process-info-codesignature) ;; Your preference domain (allow user-preference-read user-preference-write (preference-domain "com.apple.EnergyKit") (preference-domain "com.apple.Home") (preference-domain "com.apple.wpc.homeservices.energyservices") (preference-domain "com.apple.wpc.energyservices.gridservices") (preference-domain "com.apple.homeenergyd") (preference-domain "kCFPreferencesAnyApplication") (preference-domain "com.apple.CloudKit") (preference-domain "com.apple.wpc.energyservices.utilityservices")) ;; Read/write access to a temporary directory. (allow file-read* file-write* (subpath (param "TMPDIR")) (subpath (param "DARWIN_CACHE_DIR"))) ;; Read/write cache access (let ((cache-path-filter (home-subpath "/Library/Caches/com.apple.homeenergyd"))) (allow file-read* file-write* cache-path-filter) (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") cache-path-filter))) (let ((utilityservices-cache-path-filter (home-subpath "/Library/Caches/com.apple.wpc.energyservices.utilityservices"))) (allow file-read* file-write* utilityservices-cache-path-filter) (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") utilityservices-cache-path-filter))) (let ((homeservices-cache-path-filter (home-subpath "/Library/Caches/com.apple.wpc.homeservices.energyservices"))) (allow file-read* file-write* homeservices-cache-path-filter) (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") homeservices-cache-path-filter))) (let ((energyservices-cache-path-filter (home-subpath "/Library/Caches/com.apple.wpc.energyservices.gridservices"))) (allow file-read* file-write* energyservices-cache-path-filter) (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") energyservices-cache-path-filter))) (allow mach-lookup (global-name "com.apple.alarm") (global-name "com.apple.locationd.registration") (global-name "com.apple.chronoservices") (global-name "com.apple.dnssd.service") (global-name "com.apple.usernotifications.listener") (global-name "com.apple.chrono.widgetcenterconnection") (global-name "com.apple.AppSSO.service-xpc") (global-name "com.apple.symptom_diagnostics") (global-name "com.apple.accountsd.accountmanager") (global-name "com.apple.kvsd") (global-name "com.apple.tccd") (global-name "com.apple.tccd.system") (global-name "com.apple.cloudd") (global-name "com.apple.homed.xpc") (global-name "com.apple.homekitevents.xpc") (global-name "com.apple.private.alloy.home-idswake") (global-name "com.apple.identityservicesd.embedded.auth") (global-name "com.apple.duetactivityscheduler") (global-name "com.apple.containermanagerd") (global-name "com.apple.mobileactivationd") (global-name "com.apple.CoreAuthentication.agent") (global-name "com.apple.ctkd.token-client") (global-name "com.apple.securityd.xpc") (global-name "com.apple.SystemConfiguration.configd") (global-name "com.apple.apsd") (global-name "com.apple.windowserver.active") (global-name "com.apple.locationd.desktop.synchronous") (global-name "com.apple.locationd.desktop.registration") (global-name "com.apple.CoreLocation.agent") (global-name "com.apple.weatherkit.authservice")) (allow file-read-data (literal "/private/var/db/nsurlstoraged/dafsaData.bin") (literal "/Library/Preferences/com.apple.networkd.plist") (literal "/private/var/mobile/Library/Weather/")) (allow file-read* (home-subpath "/Library/Weather/")) (allow file-read* file-write* (home-subpath "/Library/Application Support/homeenergyd/") (home-subpath "/Library/Application Support/homeenergyd/com.apple.homeenergyd/") (home-subpath "/Library/HTTPStorages/com.apple.homeenergyd") (home-subpath "/Library/homeenergyd/") (home-subpath "/Library/homeenergyd/com.apple.homeenergyd/") (home-subpath "/Library/Caches/EnergyKit/") (extension "com.apple.sandbox.application-group")) (allow network-outbound) (allow system-socket (require-all (socket-domain AF_SYSTEM) (socket-protocol 2))) (allow mach-register (global-name "com.apple.aps.homeenergyd")) ;; MobileGestlat requires 'net.link.addr' to derive the UDID (allow system-info (info-type "net.link.addr")) (allow distributed-notification-post)