]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - doc/help/policies.html
Merge changes from CUPS 1.4svn-r8659
[thirdparty/cups.git] / doc / help / policies.html
index 485a8570524698d38132d7fc02eaca2dd2c8732c..14a5b4b87099be0e76f1624097fe4a67aba85b61 100644 (file)
@@ -8,49 +8,18 @@
 
 <H1 CLASS="title">Managing Operation Policies</H1>
 
-<P>Operation policies are the rules used for each IPP operation
-in CUPS. These rules include things like "user must provide a
-password", "user must be in the system group", "allow only from
-the local system", and so forth. Until CUPS 1.2, these rules were
-largely hardcoded and could only be customized at a very basic
-level.</P>
-
-<P>CUPS 1.2 adds a new fine-grained policy layer which allows you
-to completely redefine the rules for each operation and/or
-printer. Each policy is named and defines access control rules
-for each IPP operation. This document describes how to manage
-policies and their rules.</P>
+<P>Operation policies are the rules used for each IPP operation in CUPS. These rules include things like "user must provide a password", "user must be in the system group", "allow only from the local system", and so forth. Until CUPS 1.2, these rules were largely hardcoded and could only be customized at a very basic level.</P>
+
+<P>CUPS 1.2 and later provides a fine-grained policy layer which allows you to completely redefine the rules for each operation and/or printer. Each policy is named and defines access control rules for each IPP operation. This document describes how to manage policies and their rules.</P>
 
 <H2 CLASS="title"><A NAME="BASICS">The Basics</A></H2>
 
-<P>Operation policies are used for all IPP requests sent to the
-scheduler and are evaluated <em>after</em> the <A
-HREF="ref-cupsd-conf.html#Location"><TT>Location</TT></A> based
-access control rules. This means that operation policies can only
-add additional security restrictions to a request, never relax
-them. Use <TT>Location</TT> based access control rules for
-server-wide limits and operation policies for limits on
-individual printers, tasks, or services.</P>
-
-<P>Policies are stored in the <VAR>cupsd.conf</VAR> file in <A
-HREF="ref-cupsd-conf.html#Policy"><TT>Policy</TT></A> sections.
-Each policy has an alphanumeric name that is used to select it.
-Inside the policy section are one or more <A
-HREF="ref-cupsd-conf.html#LimitIPP"><TT>Limit</TT></A>
-subsections which list the operations that are affected by the
-rules inside it. <A HREF="#LISTING01">Listing 1</A> shows the
-default operation policy, appropriately called "default", that is
-shipped with CUPS.</P>
-
-<P>The easiest way to add a policy to the <VAR>cupsd.conf</VAR>
-file is to use the web interface. Click on the
-<VAR>Administration</VAR> tab and then the <VAR>Edit
-Configuration File</VAR> button to edit the current
-<VAR>cupsd.conf</VAR> file. Click on the <VAR>Save Changes</VAR>
-button to save the changes and restart the scheduler. If you edit
-the <VAR>cupsd.conf</VAR> file from the console, make sure to <A
-HREF="ref-cupsd-conf.html">restart the cupsd process</A> before
-trying to use the new policy.</P>
+<P>Operation policies are used for all IPP requests sent to the scheduler and are evaluated <em>after</em> the <A HREF="ref-cupsd-conf.html#Location"><TT>Location</TT></A> based access control rules. This means that operation policies can only add additional security restrictions to a request, never relax them. Use <TT>Location</TT> based access control rules for server-wide limits and operation policies for limits on individual printers, tasks, or services.</P>
+
+<P>Policies are stored in the <VAR>cupsd.conf</VAR> file in <A HREF="ref-cupsd-conf.html#Policy"><TT>Policy</TT></A> sections. Each policy has an alphanumeric name that is used to select it. Inside the policy section are one or more <A
+HREF="ref-cupsd-conf.html#LimitIPP"><TT>Limit</TT></A> subsections which list the operations that are affected by the rules inside it. <A HREF="#LISTING01">Listing 1</A> shows the default operation policy, appropriately called "default", that is shipped with CUPS.</P>
+
+<P>The easiest way to add a policy to the <VAR>cupsd.conf</VAR> file is to use the web interface. Click on the <VAR>Administration</VAR> tab and then the <VAR>Edit Configuration File</VAR> button to edit the current <VAR>cupsd.conf</VAR> file. Click on the <VAR>Save Changes</VAR> button to save the changes and restart the scheduler. If you edit the <VAR>cupsd.conf</VAR> file from the console, make sure to <A HREF="ref-cupsd-conf.html">restart the cupsd process</A> before trying to use the new policy.</P>
 
 <PRE CLASS="example">
 <EM>Listing 1: <A NAME="LISTING01">Default Operation Policy</A></EM>
@@ -63,7 +32,7 @@ trying to use the new policy.</P>
       Create-Job-Subscription Renew-Subscription
       Cancel-Subscription Get-Notifications Reprocess-Job
       Cancel-Current-Job Suspend-Current-Job Resume-Job
-      CUPS-Move-Job>
+      CUPS-Move-Job CUPS-Get-Document>
  4        Require user @OWNER @SYSTEM
  5        Order deny,allow
  6      &lt;/Limit>
@@ -106,15 +75,13 @@ trying to use the new policy.</P>
 
 <H3>The Default CUPS Operation Policy</H3>
 
-<P>The policy definition starts with an opening <TT>Policy</TT>
-directive:</P>
+<P>The policy definition starts with an opening <TT>Policy</TT> directive:</P>
 
 <PRE CLASS="example">
  1    &lt;Policy default>
 </PRE>
 
-<P>The first <TT>Limit</TT> subsection defines the rules for IPP
-job operations:</P>
+<P>The first <TT>Limit</TT> subsection defines the rules for IPP job operations:</P>
 
 <PRE CLASS="example">
  3      &lt;Limit Send-Document Send-URI Hold-Job Release-Job
@@ -122,32 +89,15 @@ job operations:</P>
       Create-Job-Subscription Renew-Subscription
       Cancel-Subscription Get-Notifications Reprocess-Job
       Cancel-Current-Job Suspend-Current-Job Resume-Job
-      CUPS-Move-Job>
+      CUPS-Move-Job CUPS-Get-Document>
  4        Require user @OWNER @SYSTEM
  5        Order deny,allow
  6      &lt;/Limit>
 </PRE>
 
-<P>The operation names are listed on a single line
-with spaces separating them. Each name corresponds to the IPP
-operation described in any of the IETF or PWG standards documents
-for the Internet Printing Protocol. <A HREF="#TABLE01">Table
-1</A> lists all of the operations that have been defined along
-with their usage in CUPS.</P>
-
-<P>The access control rules are listed after the <TT>Limit</TT>
-line and are the same as those used for <A
-HREF="ref-cupsd-conf.html#Location"><TT>Location</TT></A>
-sections. In this case, we require the owner of the job
-("@OWNER") or a member of the <A
-HREF="ref-cupsd-conf.html#SystemGroup"><TT>SystemGroup</TT></A>
-("@SYSTEM") to do the operation. Because we do not include an <A
-HREF="ref-cupsd-conf.html#AuthType"><TT>AuthType</TT></A>
-directive here, the user information can come from the IPP
-request itself or the authenticated username from the HTTP
-request. The administrative operations starting on line 9,
-however, <em>do</em> use the <TT>AuthType</TT> directive, and so
-administrative operations need to be authenticated:</P>
+<P>The operation names are listed on a single line with spaces separating them. Each name corresponds to the IPP operation described in any of the IETF or PWG standards documents for the Internet Printing Protocol. <A HREF="#TABLE01">Table 1</A> lists all of the operations that have been defined along with their usage in CUPS.</P>
+
+<P>The access control rules are listed after the <TT>Limit</TT> line and are the same as those used for <A HREF="ref-cupsd-conf.html#Location"><TT>Location</TT></A> sections. In this case, we require the owner of the job ("@OWNER") or a member of the <A HREF="ref-cupsd-conf.html#SystemGroup"><TT>SystemGroup</TT></A> ("@SYSTEM") to do the operation. Because we do not include an <A HREF="ref-cupsd-conf.html#AuthType"><TT>AuthType</TT></A> directive here, the user information can come from the IPP request itself or the authenticated username from the HTTP request. The administrative operations starting on line 9, however, <em>do</em> use the <TT>AuthType</TT> directive, and so administrative operations need to be authenticated:</P>
 
 <PRE CLASS="example">
  9      &lt;Limit CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class
@@ -172,16 +122,9 @@ administrative operations need to be authenticated:</P>
 20      &lt;/Limit>
 </PRE>
 
-<P>The "Order deny,allow" line at the end of both <TT>Limit</TT>
-subsections allows the request to come from any system allowed by
-the <TT>Location</TT> sections elsewhere in the
-<VAR>cupsd.conf</VAR> file.</P>
+<P>The "Order deny,allow" line at the end of both <TT>Limit</TT> subsections allows the request to come from any system allowed by the <TT>Location</TT> sections elsewhere in the <VAR>cupsd.conf</VAR> file.</P>
 
-<P>The <TT>Cancel-Job</TT> and <TT>CUPS-Authenticate-Job</TT>
-operations are listed separately to allow the web interface to
-more easily edit their policy without disturbing the rest. Like
-the rest of the job operations, we want the job's owner
-("@OWNER") or an administrator ("@SYSTEM") to do it:</P>
+<P>The <TT>Cancel-Job</TT> and <TT>CUPS-Authenticate-Job</TT> operations are listed separately to allow the web interface to more easily edit their policy without disturbing the rest. Like the rest of the job operations, we want the job's owner ("@OWNER") or an administrator ("@SYSTEM") to do it:</P>
 
 <PRE CLASS="example">
 16      &lt;Limit Cancel-Job CUPS-Authenticate-Job>
@@ -190,11 +133,7 @@ the rest of the job operations, we want the job's owner
 19      &lt;/Limit>
 </PRE>
 
-<P>The last <TT>Limit</TT> subsection in any policy uses the
-special operation name <TT>All</TT>. CUPS will use the rules in
-this subsection for any operation you don't list specifically in
-the policy. In this case, all other operations are allowed
-without a username or authentication:</P>
+<P>The last <TT>Limit</TT> subsection in any policy uses the special operation name <TT>All</TT>. CUPS will use the rules in this subsection for any operation you don't list specifically in the policy. In this case, all other operations are allowed without a username or authentication:</P>
 
 <PRE CLASS="example">
 21      &lt;Limit All>
@@ -512,26 +451,24 @@ without a username or authentication:</P>
        <TD>Yes</TD>
        <TD>Authenticates a job for printing.</TD>
 </TR>
+<TR>
+       <TD NOWRAP><TT>CUPS-Get-Document</TT></TD>
+       <TD>Yes</TD>
+       <TD>Retrieves a document file from a job.</TD>
+</TR>
 </TBODY>
 </TABLE></DIV>
 
 
 <H2 CLASS="title"><A NAME="CREATING">Creating Your Own Policies</A></H2>
 
-<P>The easiest way to create a new policy is to start with the
-default policy and then make changes to the copy. The first
-change you'll make is to give the policy a new name. Policy names
-can use the same characters as a printer name, specifically all
-printable characters except space, slash (/), and pound (#):</P>
+<P>The easiest way to create a new policy is to start with the default policy and then make changes to the copy. The first change you'll make is to give the policy a new name. Policy names can use the same characters as a printer name, specifically all printable characters except space, slash (/), and pound (#):</P>
 
 <PRE CLASS="example">
 &lt;Policy mypolicy>
 </PRE>
 
-<P>Then you need to decide exactly what limits you want for the
-policy. For example, if you want to allow any user to cancel any
-other users' jobs, you can change the <TT>Cancel-Job</TT> limits
-to:</P>
+<P>Then you need to decide exactly what limits you want for the policy. For example, if you want to allow any user to cancel any other users' jobs, you can change the <TT>Cancel-Job</TT> limits to:</P>
 
 <PRE CLASS="example">
 &lt;Limit Cancel-Job>
@@ -539,16 +476,7 @@ to:</P>
 &lt;/Limit>
 </PRE>
 
-<P>The directives inside the <TT>Limit</TT> subsection can use
-any of the normal limiting directives: <A
-HREF="ref-cupsd-conf.html#Allow"><TT>Allow</TT></A>, <A
-HREF="ref-cupsd-conf.html#AuthType"><TT>AuthType</TT></A>, <A
-HREF="ref-cupsd-conf.html#Deny"><TT>Deny</TT></A>, <A
-HREF="ref-cupsd-conf.html#Encryption"><TT>Encryption</TT></A>, <A
-HREF="ref-cupsd-conf.html#Require"><TT>Require</TT></A>, and <A
-HREF="ref-cupsd-conf.html#Satisfy"><TT>Satisfy</TT></A>. <A
-HREF="#TABLE02">Table 2</A> lists some basic "recipes" for
-different access control rules.</P>
+<P>The directives inside the <TT>Limit</TT> subsection can use any of the normal limiting directives: <A HREF="ref-cupsd-conf.html#Allow"><TT>Allow</TT></A>, <A HREF="ref-cupsd-conf.html#AuthType"><TT>AuthType</TT></A>, <A HREF="ref-cupsd-conf.html#Deny"><TT>Deny</TT></A>, <A HREF="ref-cupsd-conf.html#Encryption"><TT>Encryption</TT></A>, <A HREF="ref-cupsd-conf.html#Require"><TT>Require</TT></A>, and <A HREF="ref-cupsd-conf.html#Satisfy"><TT>Satisfy</TT></A>. <A HREF="#TABLE02">Table 2</A> lists some basic "recipes" for different access control rules.</P>
 
 <DIV CLASS="table"><TABLE WIDTH="80%" SUMMARY="Access Control Recipes">
 <CAPTION>Table 2: <A NAME="TABLE02">Access Control Recipes</A></CAPTION>
@@ -571,8 +499,7 @@ Allow from @LOCAL</PRE></TD>
 </TR>
 <TR>
        <TD>Deny Everyone/Disable Operation(s)</TD>
-       <TD><PRE>Order allow,deny
-Deny from all</PRE></TD>
+       <TD><PRE>Order deny,allow</PRE></TD>
 </TR>
 <TR>
        <TD>Require Login (System) Password</TD>
@@ -582,6 +509,10 @@ Deny from all</PRE></TD>
        <TD>Require CUPS (lppasswd) Password</TD>
        <TD><PRE>AuthType BasicDigest</PRE></TD>
 </TR>
+<TR>
+       <TD>Require Kerberos</TD>
+       <TD><PRE>AuthType Negotiate</PRE></TD>
+</TR>
 <TR>
        <TD>Require the Owner of a Job or Subscription</TD>
        <TD><PRE>Require user @OWNER</PRE></TD>
@@ -607,14 +538,7 @@ Deny from all</PRE></TD>
 
 <H3>Creating a Policy for a Computer Lab</H3>
 
-<P>One common operating scenario is a computer lab. The lab is
-managed by one or more technicians that assist the users of the
-lab and handle the basic administration tasks. <A
-HREF="#LISTING02">Listing 2</A> shows an operation policy that
-only allows access from the lab's subnet, 10.0.2.x, and allows
-the lab technicians, who are members of a special UNIX group for
-that lab called "lab999", to do job, printer, and subscription
-management operations.</P>
+<P>One common operating scenario is a computer lab. The lab is managed by one or more technicians that assist the users of the lab and handle the basic administration tasks. <A HREF="#LISTING02">Listing 2</A> shows an operation policy that only allows access from the lab's subnet, 10.0.2.x, and allows the lab technicians, who are members of a special UNIX group for that lab called "lab999", to do job, printer, and subscription management operations.</P>
 
 <PRE CLASS="example">
 <EM>Listing 2: <A NAME="LISTING02">Operation Policy for a Lab</A></EM>
@@ -627,7 +551,7 @@ management operations.</P>
       Create-Job-Subscription Renew-Subscription
       Cancel-Subscription Get-Notifications Reprocess-Job
       Cancel-Current-Job Suspend-Current-Job Resume-Job
-      CUPS-Move-Job Cancel-Job CUPS-Authenticate-Job>
+      CUPS-Move-Job Cancel-Job CUPS-Authenticate-Job CUPS-Get-Document>
  4        Require user @OWNER @lab999 @SYSTEM
  5        Order allow,deny
  6        Allow from 10.0.2.0/24
@@ -659,38 +583,19 @@ management operations.</P>
 
 <H2 CLASS="title"><A NAME="SELECT">Using Policies</A></H2>
 
-<P>Once you have created a policy, you can use it in two ways.
-The first way is to assign it as the default policy for the
-system using the <A
-HREF="ref-cupsd-conf.html#DefaultPolicy"><TT>DefaultPolicy</TT></A>
-directive in the <VAR>cupsd.conf</VAR> file. For example, add the
-following line to the <VAR>cupsd.conf</VAR> file to use the
-"lab999" policy from the previous section:</P>
+<P>Once you have created a policy, you can use it in two ways. The first way is to assign it as the default policy for the system using the <A HREF="ref-cupsd-conf.html#DefaultPolicy"><TT>DefaultPolicy</TT></A> directive in the <VAR>cupsd.conf</VAR> file. For example, add the following line to the <VAR>cupsd.conf</VAR> file to use the "lab999" policy from the previous section:</P>
 
 <PRE CLASS="example">
 DefaultPolicy lab999
 </PRE>
 
-<P>To associate the policy with one or more printers, use either
-the <A HREF="man-lpadmin.html">lpadmin(8)</A> command or the web
-interface to change the operation policy for each printer. When
-using the <B>lpadmin</B> command, the <TT>-o
-printer-op-policy=name</TT> option sets the operation policy for
-a printer. For example, enter the following command to use the
-"lab999" policy from the previous section with a printer named
-"LaserJet4000":</P>
+<P>To associate the policy with one or more printers, use either the <A HREF="man-lpadmin.html">lpadmin(8)</A> command or the web interface to change the operation policy for each printer. When using the <B>lpadmin</B> command, the <TT>-o printer-op-policy=name</TT> option sets the operation policy for a printer. For example, enter the following command to use the "lab999" policy from the previous section with a printer named "LaserJet4000":</P>
 
 <PRE CLASS="command">
 lpadmin -p LaserJet4000 -o printer-op-policy=lab999
 </PRE>
 
-<P>To make the same change in the web interface, go to the
-printer's web page, for example
-"http://localhost:631/printers/LaserJet4000", and click on the
-<VAR>Set Printer Options</VAR> button. Scroll down to the bottom
-of the page and choose the desired policy from the pull-down
-list. Click on <VAR>Set Printer Options</VAR> to change the policy for
-the printer.</P>
+<P>To make the same change in the web interface, go to the printer's web page, for example "http://localhost:631/printers/LaserJet4000", and choose <VAR>Set Default Options</VAR> from the <VAR>Administration</VAR> menu button. Click on the <VAR>Policies</VAR> link and choose the desired policy from the pull-down list. Click on <VAR>Set Default Options</VAR> to change the policy for the printer.</P>
 
 </BODY>
 </HTML>