;;; Copyright © 2019-2021 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) ;;; log stream --info --debug --style compact --predicate '((message contains "remotemanagementd") and (not message contains "DTServiceHub")) AND (((processID == 0) AND (senderImagePath CONTAINS "/Sandbox")) OR (subsystem == "com.apple.sandbox.reporting"))' ;;; Training wheels on: ;; (allow (with report) default) ;; (allow (with report) file-map-executable process-info* nvram*) ;; (allow (with report) dynamic-code-generation) ;;; Training wheels off: (deny default) (deny file-map-executable iokit-get-properties 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) ;; Read/write preference domain (allow user-preference-read user-preference-write (preference-domain "com.apple.remotemanagementd") ) (allow user-preference-read (preference-domain "kCFPreferencesAnyApplication") ) ;; Read/write access to a temporary directory. (allow file-read* file-write* (subpath (param "TMPDIR")) (subpath (param "DARWIN_CACHE_DIR")) ) ;; Full access to role account HOME (allow file-read* file-write* (home-subpath "") ) ;; Allow network access (system-network) (allow network-outbound (literal "/private/var/run/mDNSResponder") (remote tcp) ) ;; Device Properties (allow iokit-get-properties) ;; Launch Services (allow file-read* (literal "/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist") (regex "^/private/var/folders/.*/com\.apple\.LaunchServices-.*\.csstore$") ) (allow mach-lookup (global-name "com.apple.coreservices.quarantine-resolver") (global-name "com.apple.lsd.mapdb") (global-name "com.apple.lsd.modifydb") ) ;; Push Notifications (allow mach-lookup (global-name "com.apple.apsd") (global-name "com.apple.SystemConfiguration.configd") (global-name "com.apple.windowserver.active") ) ;; AuthKit OTP Headers (allow mach-lookup (global-name "com.apple.ak.anisette.xpc") ) ;; CFNetwork access (allow mach-lookup (global-name "com.apple.cookied") ) (allow user-preference-read (preference-domain "com.apple.CFNetwork") (preference-domain "com.apple.nsurlcache") (preference-domain "com.apple.security") ) (allow file-read* (literal "/private/var/db/mds/messages/se_SecurityMessages") (literal "/private/var/db/mds/system/mdsDirectory.db") ) (allow ipc-posix-shm-read-data (ipc-posix-name "FNetwork.defaultStorageSession") ) ;; Consuming Sandbox Extensions (allow file-read* (extension "com.apple.app-sandbox.read")) (allow file-read* file-write* (extension "com.apple.app-sandbox.read-write")) ;; Security - keychain (allow mach-lookup (global-name "com.apple.ctkd.token-client") (global-name "com.apple.SecurityServer") (global-name "com.apple.securityd") (global-name "com.apple.securityd.systemkeychain") (global-name "com.apple.securityd.xpc") ) (allow ipc-posix-shm-read-data ipc-posix-shm-write-create ipc-posix-shm-write-data (ipc-posix-name "com.apple.AppleDatabaseChanged") ) ;; Keychain (allow file-read* file-write* (home-regex #"/Library/Keychains/\.[\w]*") (home-literal "/Library/Keychains/login.keychain") (home-literal "/Library/Keychains/login.keychain-db") (home-regex #"/Library/Keychains/login\.keychain-db\.sb-[-\w]*") ) ;; For validating client authorization to modify trust settings (allow authorization-right-obtain (right-name "com.apple.trust-settings.admin")) ;; MCX (allow file-map-executable (literal "/System/Library/CoreServices/ManagedClient.app/Contents/PlugIns/MCXToolsInterface.bundle/Contents/MacOS/MCXToolsInterface") ) (allow mach-lookup (global-name "com.apple.ManagedClient.agent") (global-name "com.apple.ManagedClient.cloudconfigurationd") (global-name "com.apple.managedconfiguration.teslad") (global-name "com.apple.mdmclient.daemon.unrestricted") ) (allow file-read* (literal "/Library/Application Support/CrashReporter/SubmitDiagInfo.domains") ; for CrashReporter (literal "/private/var/db/DEP.plist") ; for simulated DEP data - AppleInternal only ) (allow file-read* file-write* (subpath "/private/var/db/ConfigurationProfiles/Settings") ; for DEP files (literal "/private/var/tmp/_Error_Occurrences.plist") ; logging - AppleInternal only ) (allow user-preference-read (preference-domain "com.apple.mdmclient") ) ;; Sandbox extension for cfprefsd when running as role user (with-filter (extension-class "com.apple.cfprefsd.read" "com.apple.cfprefsd.read-write") (allow file-issue-extension (home-literal "/Library/Preferences/com.apple.remotemanagementd.plist") ) ) ;; Miscellaneous (allow mach-lookup (global-name "com.apple.accountsd.accountmanager") ;; Accounts.framework ) ;; DeviceIdentity (allow mach-lookup (global-name "com.apple.CoreAuthentication.daemon") (global-name "com.apple.mobileactivationd") (global-name "com.apple.remoted") ) (allow iokit-open (iokit-user-client-class "AppleCredentialManagerUserClient") (iokit-user-client-class "AppleKeyStoreUserClient") ) ;; Read/write access to /tmp/rmd_test for making use of the file conduit (allow file-read* file-write* (subpath "/private/tmp/rmd_test") ) ;; Background Tasks (allow mach-lookup (global-name "com.apple.duetactivityscheduler") )