2 ;; Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 ;; Use of this source code is governed by a BSD-style license that can be
4 ;; found in the LICENSE file.
6 ; This configuration file isn't used on it's own, but instead implicitly
7 ; included at the start of all other sandbox configuration files in Chrome.
10 ; Helper function to check if a param is set to true.
11 (define (param-true? str) (string=? (param str) "TRUE"))
13 ; Helper function to determine if a parameter is defined or not.
14 (define (param-defined? str) (string? (param str)))
16 ; Define constants for all of the parameter strings passed in.
17 (define disable-sandbox-denial-logging "DISABLE_SANDBOX_DENIAL_LOGGING")
18 (define enable-logging "ENABLE_LOGGING")
19 (define component-build-workaround "COMPONENT_BUILD_WORKAROUND")
20 (define permitted-dir "PERMITTED_DIR")
21 (define homedir-as-literal "USER_HOMEDIR_AS_LITERAL")
22 (define lion-or-later "LION_OR_LATER")
23 (define elcap-or-later "ELCAP_OR_LATER")
25 ; Consumes a subpath and appends it to the user's homedir path.
26 (define (user-homedir-path subpath) (string-append (param homedir-as-literal) subpath))
28 ; DISABLE_SANDBOX_DENIAL_LOGGING turns off log messages in the system log.
29 (if (param-true? disable-sandbox-denial-logging)
30 (deny default (with no-log))
33 ; Support for programmatically enabling verbose debugging.
34 (if (param-true? enable-logging) (debug deny))
36 ; Allow sending signals to self - https://crbug.com/20370
37 (allow signal (target self))
39 ; Needed for full-page-zoomed controls - https://crbug.com/11325
42 ; Loading System Libraries.
44 (regex #"^/System/Library/Frameworks($|/)")
45 (regex #"^/System/Library/PrivateFrameworks($|/)")
46 (regex #"^/System/Library/CoreServices($|/)"))
50 ; Allow direct access to /dev/urandom, similar to Linux/POSIX, to allow
51 ; third party code (eg: bits of Adobe Flash and NSS) to function properly.
52 (allow file-read-data file-read-metadata (literal "/dev/urandom"))
54 ; Enables reading file metadata for the Chrome bundle and its parent paths.
55 ; https://crbug.com/127465
56 (if (and (param-defined? component-build-workaround)
57 (param-true? component-build-workaround))
58 (allow file-read-metadata ))