Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/cups-1.3.7/help/ drwxr-xr-x |
Viewing file: policies.html (20.43 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | 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. 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. The BasicsOperation policies are used for all IPP requests sent to the scheduler and are evaluated after the Location based access control rules. This means that operation policies can only add additional security restrictions to a request, never relax them. Use Location based access control rules for server-wide limits and operation policies for limits on individual printers, tasks, or services. Policies are stored in the cupsd.conf file in Policy sections. Each policy has an alphanumeric name that is used to select it. Inside the policy section are one or more Limit subsections which list the operations that are affected by the rules inside it. Listing 1 shows the default operation policy, appropriately called "default", that is shipped with CUPS. The easiest way to add a policy to the cupsd.conf file is to use the web interface. Click on the Administration tab and then the Edit Configuration File button to edit the current cupsd.conf file. Click on the Save Changes button to save the changes and restart the scheduler. If you edit the cupsd.conf file from the console, make sure to restart the cupsd process before trying to use the new policy. Listing 1: Default Operation Policy 1 <Policy default> 2 # Job-related operations must be done by the owner or an administrator... 3 <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job> 4 Require user @OWNER @SYSTEM 5 Order deny,allow 6 </Limit> 7 8 # All administration operations require an administrator to authenticate... 9 <Limit CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Set-Default> 10 AuthType Default 11 Require user @SYSTEM 12 Order deny,allow 13 </Limit> 14 15 # All printer operations require a printer operator to authenticate... 16 <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs> 17 AuthType Default 18 Require user varies by OS 19 Order deny,allow 20 </Limit> 21 22 # Only the owner or an administrator can cancel or authenticate a job... 23 <Limit Cancel-Job CUPS-Authenticate-Job> 24 Require user @OWNER @SYSTEM 25 Order deny,allow 26 </Limit> 27 28 <Limit All> 29 Order deny,allow 30 </Limit> 31 </Policy> The Default CUPS Operation PolicyThe policy definition starts with an opening Policy directive: 1 <Policy default> The first Limit subsection defines the rules for IPP job operations: 3 <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job> 4 Require user @OWNER @SYSTEM 5 Order deny,allow 6 </Limit> 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. Table 1 lists all of the operations that have been defined along with their usage in CUPS. The access control rules are listed after the Limit line and are the same as those used for Location sections. In this case, we require the owner of the job ("@OWNER") or a member of the SystemGroup ("@SYSTEM") to do the operation. Because we do not include an AuthType 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, do use the AuthType directive, and so administrative operations need to be authenticated: 9 <Limit CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Set-Default> 10 AuthType Default 11 Require user @SYSTEM 12 Order deny,allow 13 </Limit> 14 15 # All printer operations require a printer operator to authenticate... 16 <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs> 17 AuthType Default 18 Require user varies by OS 19 Order deny,allow 20 </Limit> The "Order deny,allow" line at the end of both Limit subsections allows the request to come from any system allowed by the Location sections elsewhere in the cupsd.conf file. The Cancel-Job and CUPS-Authenticate-Job 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: 16 <Limit Cancel-Job CUPS-Authenticate-Job> 17 Require user @OWNER @SYSTEM 18 Order deny,allow 19 </Limit> The last Limit subsection in any policy uses the special operation name All. 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: 21 <Limit All> 22 Order deny,allow 23 </Limit> 24 </Policy>
Creating Your Own PoliciesThe 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 (#): <Policy mypolicy> 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 Cancel-Job limits to: <Limit Cancel-Job> Order deny,allow </Limit> The directives inside the Limit subsection can use any of the normal limiting directives: Allow, AuthType, Deny, Encryption, Require, and Satisfy. Table 2 lists some basic "recipes" for different access control rules.
Creating a Policy for a Computer LabOne 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. Listing 2 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. Listing 2: Operation Policy for a Lab 1 <Policy lab999> 2 # Job- and subscription-related operations must be done by the owner, a lab technician, or an administrator... 3 <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes 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> 4 Require user @OWNER @lab999 @SYSTEM 5 Order allow,deny 6 Allow from 10.0.2.0/24 7 </Limit> 8 9 # All administration operations require a lab technician or an administrator to authenticate... 10 <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default> 11 AuthType Default 12 Require user @lab999 @SYSTEM 13 Order allow,deny 14 Allow from 10.0.2.0/24 15 </Limit> 16 17 # All other operations are allowed from the lab network... 18 <Limit All> 19 Order allow,deny 20 Allow from 10.0.2.0/24 21 </Limit> 22 </Policy> Using PoliciesOnce 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 DefaultPolicy directive in the cupsd.conf file. For example, add the following line to the cupsd.conf file to use the "lab999" policy from the previous section: DefaultPolicy lab999 To associate the policy with one or more printers, use either the lpadmin(8) command or the web interface to change the operation policy for each printer. When using the lpadmin command, the -o printer-op-policy=name 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": lpadmin -p LaserJet4000 -o printer-op-policy=lab999 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 Set Printer Options button. Scroll down to the bottom of the page and choose the desired policy from the pull-down list. Click on Save Changes to change the policy for the printer. |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0105 ]-- |