;;; Copyright (c) 2017 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) (deny default) (deny file-map-executable process-info* nvram*) (import "com.apple.iMessage.shared.sb") ;; Read/write cache access (let ((cache-path-filter (home-subpath "/Library/Caches/com.apple.imtranscoding.IMTranscoderAgent"))) (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 ((cache-path-filter-localspeechrecognition (home-subpath "/Library/Caches/com.apple.speech.localspeechrecognition"))) (allow file-read* file-write* cache-path-filter-localspeechrecognition) (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") cache-path-filter-localspeechrecognition))) ;; Read/write access (allow file-read* file-write* (home-subpath "/Library/Caches/com.apple.MobileSMS") (temp-subpath "/com.apple.messages") (cache-subpath "/com.apple.messages") ) (allow file-read* ;; Allow reading files sent to us by imagent which are in imagent's temp folder (darwin-user-root-subpath "/T/com.apple.imagent") (darwin-user-root-subpath "/T/com.apple.iChat") (subpath "/Library/Video/Plug-Ins") (subpath "/Library/Audio/Plug-Ins") ;; Allow reading files used by GeoServices (required for map previews). (home-literal "/Library/Preferences/com.apple.GEO.plist") (home-subpath "/Library/Caches/GeoServices") ) ;; Allow reading file extensions sent to us by imagent which are in imagent's temp folder (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read" "com.apple.app-sandbox.read-write") (darwin-user-root-subpath "/T/com.apple.imagent") ) ) ;; Read/Write extensions for safe preview generation (with-filter (require-all (extension "com.apple.app-sandbox.read-write") (require-any (darwin-user-root-subpath "/T/com.apple.imagent") (darwin-user-root-subpath "/T/com.apple.imtransferservices.IMTransferAgent"))) (allow file-read* file-write*)) (allow file-write* (darwin-user-root-subpath "/T/com.apple.identityservicesd") ) (allow user-preference-read (preference-domain "com.apple.imtranscoding.IMTranscoderAgent") (preference-domain "com.apple.ImageIO") (preference-domain "com.apple.coremedia") (preference-domain "com.apple.AppleGVA") (preference-domain "com.apple.GVAEncoder") (preference-domain "com.apple.avfoundation") (preference-domain "com.apple.coreaudio") (preference-domain "com.apple.corevideo") (preference-domain "com.apple.gpu") (preference-domain "com.apple.opengl") (preference-domain "com.nvidia.OpenGL") (preference-domain "com.apple.Accessibility") (preference-domain "com.apple.GEO") (preference-domain "com.apple.assistant.support") ) (allow user-preference-write (preference-domain "com.apple.imtranscoding.IMTranscoderAgent") ) (allow mach-lookup (global-name "com.apple.audio.AudioComponentRegistrar" "com.apple.audio.audiohald" "com.apple.cmio.registerassistantservice.system-extensions" "com.apple.frontboard.systemappservices" "com.apple.lsd.mapdb" "com.apple.ocspd" "com.apple.powerlog.plxpclogger.xpc" "com.apple.tccd" "com.apple.tccd.system" "com.apple.windowserver.active")) ;; IMTranscoderAgent should not be able to launch WebKit services (deny mach-lookup (with send-signal SIGKILL)(with telemetry)(with message "Unexpected WebKit Usage") (xpc-service-name-prefix "com.apple.WebKit")) (allow file-map-executable (subpath "/System/Library/Components") (subpath "/System/Library/Extensions") (subpath "/System/Library/Video/Plug-Ins") (subpath "/System/Library/Audio/Plug-Ins") ) (system-graphics) (allow iokit-open (iokit-user-client-class "IGAccelDevice" "IGAccelSharedUserClient" "IGAccelVideoContextMain" "IGAccelVideoContextMedia" "IGAccelVideoContextVEBox" "IOSurfaceRootUserClient" "AppleAVE2UserClient" ;; Makes writing heic work ) ) (allow device-microphone) (deny syscall-unix (with telemetry)(with message "syscall-unix-denied")) (allow syscall-unix (syscall-group-bsdthread) (syscall-group-fcntl) (syscall-group-getfsstat) (syscall-group-kevent) (syscall-group-kqueue) (syscall-group-mach-eventlink) (syscall-group-mkdir) (syscall-group-open-dprotected) (syscall-group-pthread) (syscall-group-read) (syscall-group-rlimit) (syscall-group-select) (syscall-group-send) (syscall-group-signal) (syscall-group-stat) (syscall-group-statfs) (syscall-group-ulock) (syscall-group-write) (syscall-number SYS___disable_threadsignal SYS___mac_syscall SYS___semwait_signal SYS___semwait_signal_nocancel SYS_abort_with_payload SYS_access SYS_access_extended SYS_csrctl SYS_debug_syscall_reject SYS_exit SYS_faccessat SYS_fgetattrlist SYS_fgetxattr SYS_flistxattr SYS_flock SYS_fsetattrlist SYS_fsgetpath SYS_fsync SYS_fpathconf SYS_ftruncate SYS_getattrlist SYS_getattrlistbulk SYS_getaudit_addr SYS_getdirentries64 SYS_getegid SYS_getentropy SYS_geteuid SYS_getgid SYS_getgroups SYS_getpid SYS_getppid SYS_getrusage SYS_gettid SYS_gettimeofday SYS_getuid SYS_getxattr SYS_iopolicysys SYS_issetugid SYS_kdebug_trace SYS_kdebug_trace_string SYS_kdebug_trace64 SYS_kdebug_typefilter SYS_kevent_id SYS_kevent_qos SYS_listxattr SYS_lseek SYS_madvise SYS_mmap SYS_mprotect SYS_mremap_encrypted SYS_msync SYS_munmap SYS_os_fault_with_payload SYS_pathconf SYS_psynch_mutexdrop SYS_psynch_mutexwait SYS_quotactl SYS_readlink SYS_rename SYS_renameatx_np SYS_rmdir SYS_setattrlist SYS_shared_region_check_np SYS_socket SYS_terminate_with_payload SYS_thread_selfid SYS_umask SYS_work_interval_ctl SYS_workq_kernreturn SYS_workq_open SYS_necp_open SYS_necp_client_action SYS_change_fdguard_np) ) ;; Syscall subcommand filtering - fsctl (when (defined? 'system-fsctl) (deny system-fsctl) (allow system-fsctl (fsctl-command APFSIOC_GET_CLONE_INFO APFSIOC_PURGEABLE_LABEL_PURGEABLE)))