]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add section on OS X sandboxing (STR #4464)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 Aug 2014 18:59:13 +0000 (18:59 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 Aug 2014 18:59:13 +0000 (18:59 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12085 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
cups/api-filter.shtml
doc/help/api-filter.html

index 5acbd89a574d3562b3c02dbfa921345b88d733b9..c164e5e58e78eedd338d4e8b274dd99f83aeb319 100644 (file)
@@ -1,8 +1,9 @@
-CHANGES.txt - 2.0rc1 - 2014-08-04
+CHANGES.txt - 2.0rc1 - 2014-08-06
 ---------------------------------
 
 CHANGES IN CUPS V2.0rc1
 
+       - Documentation updates (STR #4464)
        - The scheduler incorrectly called launch_activate_socket multiple times
          on OS X (<rdar://problem/17523218>)
 
index 4b8372eddad88110de830d8e1a9a983eb0f73483..eb08da3b0469061fe4227c273e70f741f434d321 100644 (file)
@@ -3,7 +3,7 @@
 
   Filter and backend programming introduction for CUPS.
 
-  Copyright 2007-2013 by Apple Inc.
+  Copyright 2007-2014 by Apple Inc.
   Copyright 1997-2006 by Easy Software Products, all rights reserved.
 
   These coded instructions, statements, and computer programs are the
@@ -81,7 +81,7 @@ directory to write to.</p>
 
 <p>In addition, some operating systems provide additional security mechanisms
 that further limit file system access, even for backends running as root. On
-OS X, for example, no backend may write to a user's home directory.</p>
+OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
 </blockquote>
 
 <h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
@@ -852,3 +852,25 @@ void *my_data;
 
 <a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
 </pre>
+
+<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
+
+<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
+
+<ol>
+
+       <li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
+
+       <li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application&nbsp;Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
+
+       <li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
+
+       <li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
+
+       <li>Network: filters and backends can access UNIX domain sockets under the <var>/private/var/run</var> and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
+
+       <li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
+
+</ol>
+
+<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
index 416e2fbab410f8258dae27c095fc06895c99b373..c62b6c84391db51dbe72c5139636a726b7c5ee48 100644 (file)
@@ -408,6 +408,7 @@ div.contents ul.subcontents li {
        <li><a href="#COMMUNICATING_FILTER">Communicating with Filters</a></li>
        <li><a href="#SNMP">Doing SNMP Queries with Network Printers</a></li>
 </ul></li>
+<li><a href="#SANDBOXING">Sandboxing on OS X</a></li>
 <li><a href="#FUNCTIONS">Functions</a><ul class="code">
        <li><a href="#cupsBackChannelRead" title="Read data from the backchannel.">cupsBackChannelRead</a></li>
        <li><a href="#cupsBackChannelWrite" title="Write data to the backchannel.">cupsBackChannelWrite</a></li>
@@ -442,7 +443,7 @@ div.contents ul.subcontents li {
 
   Filter and backend programming introduction for CUPS.
 
-  Copyright 2007-2013 by Apple Inc.
+  Copyright 2007-2014 by Apple Inc.
   Copyright 1997-2006 by Easy Software Products, all rights reserved.
 
   These coded instructions, statements, and computer programs are the
@@ -520,7 +521,7 @@ directory to write to.</p>
 
 <p>In addition, some operating systems provide additional security mechanisms
 that further limit file system access, even for backends running as root. On
-OS X, for example, no backend may write to a user's home directory.</p>
+OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
 </blockquote>
 
 <h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
@@ -1291,6 +1292,28 @@ void *my_data;
 
 <a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
 </pre>
+
+<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
+
+<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
+
+<ol>
+
+       <li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
+
+       <li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application&nbsp;Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
+
+       <li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
+
+       <li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
+
+       <li>Network: filters and backends can access UNIX domain sockets under the <var>/private/var/run</var> and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
+
+       <li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
+
+</ol>
+
+<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
 <h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsBackChannelRead">cupsBackChannelRead</a></h3>
 <p class="description">Read data from the backchannel.</p>