Changeset 141445 in webkit


Ignore:
Timestamp:
Jan 31, 2013, 11:05:30 AM (13 years ago)
Author:
ap@apple.com
Message:

WebProcess sandbox profile overhaul.

Reviewed by Sam Weinig.

Moves some rules together by susbystem for easier maintenance.

Addresses <rdar://problem/9276393>, <rdar://problem/10844321>, <rdar://problem/12408537>,
<rdar://problem/12558524>.

  • WebProcess/com.apple.WebProcess.sb.in:
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r141442 r141445  
     12013-01-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        WebProcess sandbox profile overhaul.
     4
     5        Reviewed by Sam Weinig.
     6
     7        Moves some rules together by susbystem for easier maintenance.
     8
     9        Addresses <rdar://problem/9276393>, <rdar://problem/10844321>, <rdar://problem/12408537>,
     10        <rdar://problem/12558524>.
     11
     12        * WebProcess/com.apple.WebProcess.sb.in:
     13
    1142013-01-31  Simon Hausmann  <simon.hausmann@digia.com>
    215
  • trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in

    r141433 r141445  
    44
    55(import "system.sb")
    6 (import "com.apple.corefoundation.sb")
    7 
    8 ;; Distributed notifications, local pasteboard client
    9 (corefoundation)
    106
    117;; Utility functions for home directory relative path filters
     
    2521            (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") (subpath path))))))
    2622
     23#if __MAC_OS_X_VERSION_MIN_REQUIRED == 1070
     24;; Low level networking. Defined in system.sb on newer OS versions.
     25(define (system-network)
     26  (allow file-read*
     27         (literal "/Library/Preferences/com.apple.networkd.plist"))
     28  (allow mach-lookup
     29         (global-name "com.apple.SystemConfiguration.PPPController") ;; FIXME (13121943): Is this necessary?
     30         (global-name "com.apple.SystemConfiguration.SCNetworkReachability")
     31         (global-name "com.apple.networkd"))
     32  (allow network-outbound
     33         (control-name "com.apple.netsrc")
     34         (control-name "com.apple.network.statistics"))
     35  (allow system-socket
     36         (require-all (socket-domain AF_SYSTEM)
     37                      (socket-protocol 2)) ; SYSPROTO_CONTROL
     38         (socket-domain AF_ROUTE)))
     39#endif
     40
    2741;; Read-only preferences and data
    2842(allow file-read*
     
    3246       (subpath "/Library/Frameworks")
    3347       (subpath "/Library/Managed Preferences")
    34        (subpath "/private/var/db/mds")
    35        (subpath "/private/var/db/DetachedSignatures")
    3648       (regex #"^/private/etc/(hosts|group|passwd)$")
    37 
    38        ;; FIXME: This should be removed when <rdar://problem/10479685> is fixed.
    39        (subpath "/Library/Keychains")
    4049
    4150       ;; System and user preferences
    4251       (literal "/Library/Preferences/.GlobalPreferences.plist")
    43        (literal "/Library/Preferences/com.apple.crypto.plist")
    44        (literal "/Library/Preferences/com.apple.networkd.plist")
    45        (literal "/Library/Preferences/com.apple.security.plist")
    46        (literal "/Library/Preferences/com.apple.security.common.plist")
    47        (literal "/Library/Preferences/com.apple.security.revocation.plist")
    4852       (regex #"^/Library/Managed Preferences/[^/]+/com\.apple\.networkConnect\.plist$")
    4953       (home-literal "/Library/Preferences/.GlobalPreferences.plist")
     
    5963       (home-literal "/Library/Preferences/com.apple.avfoundation.plist")
    6064       (home-literal "/Library/Preferences/com.apple.coremedia.plist")
    61        (home-literal "/Library/Preferences/com.apple.security.plist")
    62        (home-literal "/Library/Preferences/com.apple.security.revocation.plist")
    63        (home-literal "/Library/Preferences/com.apple.speech.recognition.AppleSpeechRecognition.prefs.plist")
    64        (home-literal "/Library/Application Support/SyncServices/Local/ClientsWithChanges/com.apple.Keychain")
    6565       (home-regex #"/Library/Preferences/com\.apple\.driver\.(AppleBluetoothMultitouch\.mouse|AppleBluetoothMultitouch\.trackpad|AppleHIDMouse)\.plist$")
    6666
     
    102102(allow file*
    103103       (home-regex #"/Library/Preferences/ByHost/com\.apple\.HIToolbox\.")
    104        (home-regex #"/Library/Preferences/com\.apple\.WebProcess\.")
    105 
    106        ;; FIXME: This should be removed when <rdar://problem/10479685> is fixed.
    107        (home-subpath "/Library/Keychains"))
    108 
    109 ;; Non-user Security mds caches
    110 (allow file*
    111     (subpath "/private/var/db/mds/system"))
     104       (home-regex #"/Library/Preferences/com\.apple\.WebProcess\."))
    112105
    113106#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     
    140133;; Various services required by AppKit and other frameworks
    141134(allow mach-lookup
    142        (global-name "com.apple.CoreServices.coreservicesd")
    143135       (global-name "com.apple.DiskArbitration.diskarbitrationd")
    144136       (global-name "com.apple.FileCoordination")
    145137       (global-name "com.apple.FontObjectsServer")
    146138       (global-name "com.apple.FontServer")
    147        (global-name "com.apple.SecurityServer")
    148139       (global-name "com.apple.SystemConfiguration.configd")
    149140       (global-name "com.apple.SystemConfiguration.PPPController") ;; FIXME (13121943): Is this necessary?
    150        (global-name "com.apple.SystemConfiguration.SCNetworkReachability")
    151141       (global-name "com.apple.audio.VDCAssistant")
    152142       (global-name "com.apple.audio.audiohald")
     
    154144       (global-name "com.apple.cookied")
    155145       (global-name "com.apple.cvmsServ")
    156        (global-name "com.apple.networkd")
    157146       (global-name "com.apple.dock.server")
    158        (global-name "com.apple.ocspd")
    159        (global-name "com.apple.pasteboard.1")
    160147       (global-name "com.apple.system.opendirectoryd.api")
    161148       (global-name "com.apple.tccd")
     
    165152       (global-name "com.apple.cfnetwork.AuthBrokerAgent")
    166153       (global-name "com.apple.PowerManagement.control")
    167        (global-name "com.apple.speech.recognitionserver")
    168154
    169155#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
    170156       (global-name "com.apple.coreservices.launchservicesd")
    171157#endif
    172 
    173        ;; FIXME: This should be removed when <rdar://problem/9276393> is fixed.
    174        (global-name "com.apple.metadata.mds"))
    175 
    176 (allow system-socket (socket-domain AF_ROUTE))
    177 (allow system-socket (require-all (socket-domain AF_SYSTEM) (socket-protocol 2))) ; SYSPROTO_CONTROL
     158)
     159
     160;; Security framework
     161(allow mach-lookup
     162       (global-name "com.apple.ocspd")
     163       (global-name "com.apple.SecurityServer"))
     164(allow file-read* file-write* (home-subpath "/Library/Keychains")) ;; FIXME: This should be removed when <rdar://problem/10479685> is fixed.
     165(allow file-read*
     166       (subpath "/Library/Keychains")
     167       (subpath "/private/var/db/mds")
     168       (literal "/private/var/db/DetachedSignatures")
     169       (literal "/Library/Preferences/com.apple.crypto.plist")
     170       (literal "/Library/Preferences/com.apple.security.plist")
     171       (literal "/Library/Preferences/com.apple.security.common.plist")
     172       (literal "/Library/Preferences/com.apple.security.revocation.plist")
     173       (home-literal "/Library/Application Support/SyncServices/Local/ClientsWithChanges/com.apple.Keychain")
     174       (home-literal "/Library/Preferences/com.apple.security.plist")
     175       (home-literal "/Library/Preferences/com.apple.security.revocation.plist"))
     176
     177;; CoreFoundation. We don't import com.apple.corefoundation.sb, because it allows unnecessary access to pasteboard.
     178(allow mach-lookup
     179    (global-name-regex #"^com.apple.distributed_notifications")                                                       
     180    (global-name "com.apple.CoreServices.coreservicesd"))
     181(allow file-read-data
     182     (literal "/dev/autofs_nowait")) ; Used by CF to circumvent automount triggers
     183
     184;; Networking
     185(system-network)
    178186(allow network-outbound
    179        ;; Kernel controls
    180        (control-name "com.apple.network.statistics")
    181        (control-name "com.apple.netsrc")
    182 
    183187       ;; Local mDNSResponder for DNS, arbitrary outbound TCP
    184188       (literal "/private/var/run/mDNSResponder")
    185189       (remote tcp))
     190
     191;; Needed for NSAttributedString, <rdar://problem/10844321>.
     192(allow file-read*
     193       (home-literal "/Library/Preferences/pbs.plist")
     194       (home-literal "/Library/Preferences/com.apple.ServicesMenu.Services.plist"))
     195(allow mach-lookup
     196       (global-name "com.apple.pbs.fetch_services"))
    186197
    187198;; FIXME should be removed when <rdar://problem/9347205> + related radar in Safari is fixed
     
    203214        (literal "/private/etc/host"))
    204215
     216#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     217(deny file-write-create (vnode-type SYMLINK))
     218#endif
     219
    205220(deny file-read* file-write* (with no-log)
    206        ;; FIXME: Should be removed after <rdar://problem/9422957> is fixed.
    207        (home-literal "/Library/Caches/Cache.db")
     221#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080
     222       (home-literal "/Library/Caches/Cache.db") ;; <rdar://problem/9422957>
     223#endif
    208224
    209225       ;; FIXME: Should be removed after <rdar://problem/10463881> is fixed.
     
    211227       (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2-journal"))
    212228
     229;; Deny access needed for unnecessary NSApplication initialization.
     230;; FIXME: This can be removed once <rdar://problem/13011633> is fixed.
    213231(deny file-read* (with no-log)
    214        ;; FIXME: This should not be necessary once <rdar://problem/13011633> is fixed.
     232       (home-literal "/Library/Preferences/com.apple.speech.recognition.AppleSpeechRecognition.prefs.plist")
    215233       (subpath "/Library/Components")
    216234       (subpath "/Library/Keyboard Layouts")
     
    224242#endif
    225243       )
    226 
    227244(deny mach-lookup (with no-log)
    228        (global-name "com.apple.coreservices.appleevents"))
     245       (global-name "com.apple.coreservices.appleevents")
     246       (global-name "com.apple.pasteboard.1")
     247       (global-name "com.apple.speech.recognitionserver"))
    229248
    230249#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
Note: See TracChangeset for help on using the changeset viewer.