Changeset 85409 in webkit


Ignore:
Timestamp:
May 1, 2011 12:45:22 AM (13 years ago)
Author:
ike@apple.com
Message:

2011-05-01 Ivan Krstić <ike@apple.com>

Reviewed by Maciej Stachowiak.

Simplify WebProcess sandbox with homedir-relative path filters.
https://bugs.webkit.org/show_bug.cgi?id=59872

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85408 r85409  
     12011-05-01  Ivan Krstić  <ike@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Simplify WebProcess sandbox with homedir-relative path filters.
     6        https://bugs.webkit.org/show_bug.cgi?id=59872
     7
     8        * WebProcess/com.apple.WebProcess.sb:
     9
    1102011-05-01  Ivan Krstić  <ike@apple.com>
    211
  • trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb

    r85408 r85409  
    88;; Distributed notifications, local pasteboard client
    99(corefoundation)
     10
     11;; Utility functions for home directory relative path filters
     12(define (home-regex home-relative-regex)
     13  (regex (string-append "^" (regex-quote (param "HOME_DIR")) home-relative-regex)))
     14
     15(define (home-subpath home-relative-subpath)
     16  (subpath (string-append (param "HOME_DIR") home-relative-subpath)))
     17
     18(define (home-literal home-relative-literal)
     19  (literal (string-append (param "HOME_DIR") home-relative-literal)))
    1020
    1121;; Read-only preferences and data
     
    2232       ;; Plugins
    2333       (subpath "/Library/Internet Plug-Ins")
    24        (subpath (string-append (param "HOME_DIR") "/Library/Internet Plug-Ins"))
     34       (home-subpath "/Library/Internet Plug-Ins")
    2535
    2636       ;; System and user preferences
     
    3141       (literal "/Library/Preferences/com.apple.security.revocation.plist")
    3242       (regex #"^/Library/Managed Preferences/[^/]+/com\.apple\.networkConnect\.plist$")
    33        (literal (string-append (param "HOME_DIR") "/Library/Preferences/.GlobalPreferences.plist"))
    34        (regex (string-append "^" (param "HOME_DIR") "/Library/Preferences/ByHost/\.GlobalPreferences\."))
    35        (regex (string-append "^" (param "HOME_DIR") "/Library/Preferences/ByHost/com\.apple\.networkConnect\."))
    36        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.ATS.plist"))
    37        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.HIToolbox.plist"))
    38        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.LaunchServices.plist"))
    39        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.WebFoundation.plist"))
    40        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.security.plist"))
    41        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.security.revocation.plist"))
    42        (literal (string-append (param "HOME_DIR") "/Library/Application Support/SyncServices/Local/ClientsWithChanges/com.apple.Keychain"))
    43        (regex (string-append "^" (param "HOME_DIR") "/Library/Preferences/com\.apple\.driver\.(AppleBluetoothMultitouch\.mouse|AppleBluetoothMultitouch\.trackpad|AppleHIDMouse)\.plist$"))
     43       (home-literal "/Library/Preferences/.GlobalPreferences.plist")
     44       (home-regex "/Library/Preferences/ByHost/\.GlobalPreferences\.")
     45       (home-regex "/Library/Preferences/ByHost/com\.apple\.networkConnect\.")
     46       (home-literal "/Library/Preferences/com.apple.ATS.plist")
     47       (home-literal "/Library/Preferences/com.apple.HIToolbox.plist")
     48       (home-literal "/Library/Preferences/com.apple.LaunchServices.plist")
     49       (home-literal "/Library/Preferences/com.apple.WebFoundation.plist")
     50       (home-literal "/Library/Preferences/com.apple.security.plist")
     51       (home-literal "/Library/Preferences/com.apple.security.revocation.plist")
     52       (home-literal "/Library/Application Support/SyncServices/Local/ClientsWithChanges/com.apple.Keychain")
     53       (home-regex "/Library/Preferences/com\.apple\.driver\.(AppleBluetoothMultitouch\.mouse|AppleBluetoothMultitouch\.trackpad|AppleHIDMouse)\.plist$")
    4454
    4555       ;; On-disk WebKit2 framework location, to account for debug installations
     
    4858
    4959       ;; FIXME: This should be removed when <rdar://problem/8957845> is fixed.
    50        (subpath (string-append (param "HOME_DIR") "/Library/Fonts"))
     60       (home-subpath "/Library/Fonts")
    5161
    5262       ;; FIXME: These should be removed when <rdar://problem/9217757> is fixed.
    53        (subpath (string-append (param "HOME_DIR") "/Library/Audio/Plug-Ins/Components"))
    54        (subpath (string-append (param "HOME_DIR") "/Library/Preferences/QuickTime Preferences"))
    55        (literal (string-append (param "HOME_DIR") "/Library/Caches/com.apple.coreaudio.components.plist"))
     63       (home-subpath "/Library/Audio/Plug-Ins/Components")
     64       (home-subpath "/Library/Preferences/QuickTime Preferences")
     65       (home-literal "/Library/Caches/com.apple.coreaudio.components.plist")
    5666       (subpath "/Library/Audio/Plug-Ins/Components")
    5767       (subpath "/Library/Audio/Plug-Ins/HAL")
     
    6070
    6171       ;; FIXME: This should be removed when <rdar://problem/9237619> is fixed.
    62        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.universalaccess.plist"))
     72       (home-literal "/Library/Preferences/com.apple.universalaccess.plist")
    6373
    6474       ;; FIXME: This should be removed when <rdar://problem/9276253> is fixed.
    65        (subpath (string-append (param "HOME_DIR") "/Library/Keyboard Layouts"))
     75       (home-subpath "/Library/Keyboard Layouts")
    6676
    6777       ;; FIXME: This should be removed when <rdar://problem/9276268> is fixed.
    68        (subpath (string-append (param "HOME_DIR") "/Library/Input Methods"))
     78       (home-subpath "/Library/Input Methods")
    6979
    7080       ;; FIXME: This should be removed when <rdar://problem/9276430> is fixed.
    71        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2"))
     81       (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2")
    7282
    73        (subpath (string-append (param "HOME_DIR") "/Library/Dictionaries")))
     83       (home-subpath "/Library/Dictionaries"))
    7484
    7585;; This should be updated when <rdar://problem/9355830> is fixed.
     
    8393;; Writable preferences and temporary files
    8494(allow file*
    85        (subpath (string-append (param "HOME_DIR") "/Library/Caches/com.apple.WebProcess"))
    86        (regex (string-append "^" (param "HOME_DIR") "/Library/Preferences/ByHost/com\.apple\.HIToolbox\."))
    87        (regex (string-append "^" (param "HOME_DIR") "/Library/Preferences/com\.apple\.WebProcess\."))
    88        (subpath (string-append (param "HOME_DIR") "/Library/Keychains")))
     95       (home-subpath "/Library/Caches/com.apple.WebProcess")
     96       (home-regex "/Library/Preferences/ByHost/com\.apple\.HIToolbox\.")
     97       (home-regex "/Library/Preferences/com\.apple\.WebProcess\.")
     98       (home-subpath "/Library/Keychains"))
    8999
    90100;; Darwin temporary files and Security mds caches, if present
     
    166176(allow network-outbound (regex #"^/private/tmp/launch-[^/]+/Render"))
    167177(allow file-read*
    168        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.Safari.RSS.plist"))
    169        (literal (string-append (param "HOME_DIR") "/Library/Preferences/com.apple.Syndication.plist")))
     178       (home-literal "/Library/Preferences/com.apple.Safari.RSS.plist")
     179       (home-literal "/Library/Preferences/com.apple.Syndication.plist"))
    170180
    171181;; Mute violations
    172182(deny file-write*
    173       (literal (string-append (param "HOME_DIR") "/Library/Caches/com.apple.coreaudio.components.plist"))
     183      (home-literal "/Library/Caches/com.apple.coreaudio.components.plist")
    174184      (with no-log))
    175185
Note: See TracChangeset for help on using the changeset viewer.