Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /tags/htdocs/index.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide annotations) (download) (as text)
Sat Apr 7 15:39:59 2012 UTC (12 years ago) by kumaneko
File MIME type: text/html
File size: 117604 byte(s)


1 kumaneko 10 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2     <html lang="en-US">
3     <head>
4     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 kumaneko 15 <meta http-equiv="content-style-type" content="text/css">
6     <link rel="stylesheet" href="media/caitsith.css" media="all" type="text/css">
7 kumaneko 10 <title>CaitSith Documentation</title>
8     </head>
9     <body>
10    
11     <h1>CaitSith -- A simplified access restriction module for system protection.</h1>
12    
13     <p>CaitSith is an access restriction module for Linux systems. This module gives you ability to restrict access (e.g. opening files, executing programs) at the kernel level. This module is designed for ease of use.</p>
14    
15     <p>Below is documentation and policy syntax but is under construction. Sorry.</p>
16    
17     <hr>
18    
19     <h1><a href="#how_to_use">How to use</a></h1>
20    
21 kumaneko 15 <p><a href="#difference_with_tomoyo">1. Difference with TOMOYO (for existing TOMOYO users)</a></p>
22    
23 kumaneko 10 <ul>
24 kumaneko 15 <li><a href="#1.1">1.1. About pathnames and management programs</a></li>
25     <li><a href="#1.2">1.2. About policy syntax</a></li>
26 kumaneko 10 </ul>
27    
28 kumaneko 15 <p><a href="#how_to_install">2. How to install</a></p>
29    
30     <ul>
31     <li><a href="#2.1">2.1. Install dependencies</a></li>
32     <li><a href="#2.2">2.2. Download and patch the kernel</a></li>
33     <li><a href="#2.3">2.3. Configure the kernel</a></li>
34     <li><a href="#2.4">2.4. Compile and install the kernel</a></li>
35     <li><a href="#2.5">2.5. Install the userspace tools</a></li>
36     <li><a href="#2.6">2.6. Initializing configuration</a></li>
37     <li><a href="#2.7">2.7. Configuring your bootloader</a></li>
38     <li><a href="#2.8">2.8. Rebooting your system</a></li>
39     <li><a href="#2.9">2.9. How can I disable/uninstall CaitSith?</a></li>
40     </ul>
41    
42     <p><a href="#how_to_develop_policy">3. How to develop policy</a></p>
43    
44 kumaneko 16 <ul>
45     <li><a href="#3.1">3.1. Policy file structure</a></li>
46     <li><a href="#3.2">3.2. Updating policy configuration</a></li>
47     <li><a href="#3.3">3.3. Example of simple access restriction rule</a></li>
48     </ul>
49    
50 kumaneko 10 <h1><a href="#policy_specification">Policy Specification</a></h1>
51    
52     <ul>
53     <li><a href="#available_parameters">1. About parameters which can be handled via policy</a></li>
54     <li><a href="#string_expression">1.1. String parameters representation rule</a></li>
55     <li><a href="#numeric_expression">1.2. Numeric parameters representation rule</a></li>
56     <li><a href="#ipaddress_expression">1.3. IP address parameters representation rule</a></li>
57     <li><a href="#conditions">2. About conditional expressions</a></li>
58     <li><a href="#string_comparison">2.1. Conditional expressions which handle string parameters</a></li>
59     <li><a href="#integer_comparison">2.2. Conditional expressions which handle numeric parameters</a></li>
60     <li><a href="#ipaddr_comparison">2.3. Conditional expressions which handle IP address parameters</a></li>
61     <li><a href="#task_attributes_comparison">2.4. Conditional expressions which handle current thread's attributes</a></li>
62     <li><a href="#argv_comparison">2.5. Conditional expressions which handle command line arguments</a></li>
63     <li><a href="#envp_comparison">2.6. Conditional expressions which handle environment variable arguments</a></li>
64     <li><a href="#dac_permission_comparison">2.7. Conditional expressions which handle file's DAC permissions</a></li>
65     <li><a href="#file_type_comparison">2.8. Conditional expressions which handle file's type</a></li>
66     <li><a href="#file_attributes_comparison">2.9. Conditional expressions which handle file's attributes</a></li>
67     <li><a href="#syntax_list">3. List of syntaxes sorted by operations</a></li>
68     <li><a href="#policy_syntaxes">4. Policy syntaxes</a></li>
69     <li><a href="#policy_structure_definition">4.1. Definition</a></li>
70     <li><a href="#policy_examples">4.2. Examples</a></li>
71     </ul>
72    
73     <hr>
74    
75     <h1><a name="how_to_use">How to use</a></h1>
76    
77     <h2><a name="difference_with_tomoyo">1. Difference with TOMOYO (for existing TOMOYO users)</a></h2>
78    
79 kumaneko 15 <p>CaitSith was derived from TOMOYO Linux, but usage of CaitSith would be too different to imagine that CaitSith was derived from TOMOYO Linux. If you are already using TOMOYO Linux, please read the difference described below.</p>
80 kumaneko 10
81 kumaneko 15 <h3><a name="1.1">1.1. About pathnames and management programs</a></h3>
82 kumaneko 10
83     <p>/proc/ccs/domain_policy /proc/ccs/exception_policy /proc/ccs/profile /proc/ccs/manager /proc/ccs/stat has been aggregated into /proc/caitsith/policy</p>
84    
85     <p>/etc/ccs/policy/current/domain_policy.conf /etc/ccs/policy/current/exception_policy.conf /etc/ccs/policy/current/profile.conf /etc/ccs/policy/current/manager.conf /etc/ccs/policy/current/stat.conf has been aggregated into /etc/caitsith/policy/current</p>
86    
87     <p>Built-in policy files which are located in security/ccsecurity/policy/domain_policy.conf security/ccsecurity/policy/exception_policy.conf security/ccsecurity/policy/profile.conf security/ccsecurity/policy/manager.conf security/ccsecurity/policy/stat.conf under kernel source directory have been aggregated into security/caitsith/policy/policy.conf</p>
88    
89     <p>Only /sbin/caitsith-init /usr/sbin/caitsith-auditd /usr/sbin/caitsith-loadpolicy /usr/sbin/caitsith-notifyd /usr/sbin/caitsith-pstree /usr/sbin/caitsith-queryd /usr/sbin/caitsith-savepolicy /usr/lib/caitsith/audit-exec-param /usr/lib/caitsith/caitsith-agent /usr/lib/caitsith/init_policy are provided for managing policy. (In other words, programs such as /usr/sbin/ccs-editpolicy and /usr/sbin/ccs-setprofile have been removed.)</p>
90    
91     <p>Command line arguments for specifying type of policy to load/save has been removed from /usr/sbin/caitsith-loadpolicy and /usr/sbin/caitsith-savepolicy</p>
92    
93     <p>Command line arguments for specifying profile type has been removed from /usr/lib/caitsith/init_policy</p>
94    
95 kumaneko 15 <h3><a name="1.2">1.2. About policy syntax</a></h3>
96 kumaneko 10
97     <p>Policy syntax has been drastically changed. TOMOYO Linux used process's domainname as a key for grouping permissions to do some operations. In other words, TOMOYO Linux's policy is collection of "which domain can do ..." rules. On the other hand, this version uses operation as a key for checking permission. In other words, this version's policy is collection of "which operation can be done by ..." rules. This change is intended for allowing users to protect resources using blacklisting approach. In this version, process's domainname is nothing but one of optional parameters that can be used for controlling whether to grant or deny specific operations. Users can write rules without managing domainnames unless needed.</p>
98    
99     <p>Process's domainname representation has changed from space delimited multiple words (e.g. "&lt;kernel&gt; /sbin/init /etc/rc.d/rc.sysinit") to a single word (e.g. "/sbin/init").</p>
100    
101     <p>Domain transitions no longer happen unless explicitly specified by policy.</p>
102    
103     <p>Distinction of disabled/learning/permissive/enforcing mode has been removed.</p>
104    
105     <p>"path_group" keyword has been renamed to "string_group", and "address_group" keyword has been renamed to "ip_group".</p>
106    
107     <p>Representation of \ character has been changed from \\ to \134.</p>
108    
109     <p>Distinction between directory's pathname and non-directory's pathname has been removed by removing / character from directory's pathname.</p>
110    
111     <p>A new wildcard /\(dir\)/ has been introduced for helping converting from (e.g.) "/tmp/\{\*\}/" to "/tmp/\(\*\)/\*", for directory's pathname (except the root directory itself) no longer ends with / character which previously matched /\{\*\}/ wildcard.</p>
112    
113     <p>Category keywords (i.e. "file", "network", "ipc", "misc", "capability", "task") have been removed because access control levels which was specified using profile has been removed. Some of operation keywords have been renamed (e.g. "network inet stream connect" became "inet_stream_connect", "misc env" became "environ").</p>
114    
115     <p>"task auto_execute_handler" keyword has been renamed to "handler=" argument of "execute" keyword. This is intended for using execute handler for preprocessing purpose when executing specific programs rather than when executing from specific domains. "task denied_execute_handler" keyword has been removed.</p>
116    
117     <p>Domain argument has been removed from permission to send signals (i.e. "signal" directive), for kill() system call accepts negative number for specifying multiple processes. It is impossible to selectively deny sending signals because it is not permitted to sleep while sending signals.</p>
118    
119     <p>Restriction granularity for ptrace operation has changed from boolean (i.e. "capability SYS_PTRACE") to command number + domainname.</p>
120    
121     <p>Restriction granularity for environment variables has changed from name only to both name and values.</p>
122    
123     <p>Several variables for referencing file's attributes have been added.</p>
124    
125     <p>Local port reserve functionality (i.e. "deny_autobind" keyword) has been removed.</p>
126    
127     <h2><a name="how_to_install">2. How to install</a></h2>
128    
129 kumaneko 15 <p>Since CaitSith is a kernel component, you will have to compile your own kernel.</p>
130 kumaneko 10
131 kumaneko 15 <h3><a name="2.1">2.1. Install dependencies</a></h3>
132 kumaneko 10
133 kumaneko 15 <p>These packages are required for compiling the kernel and the userspace tools:</p>
134 kumaneko 10
135 kumaneko 15 <ul>
136     <li><strong>wget</strong>: to download sources</li>
137     <li><strong>patch</strong>: to patch the kernel</li>
138     <li><strong>gcc</strong>: to build the kernel and tools</li>
139     <li><strong>make</strong>: to build the kernel and tools</li>
140     <li><strong>ncurses-devel</strong> or <strong>libncurses-dev</strong>: to build the tools</li>
141     </ul>
142    
143     <p>These can be installed with the following commands:</p>
144    
145     <p><strong>RedHat distributions</strong></p>
146     <pre class="command">
147     # yum -y install wget patch gcc make ncurses-devel
148     </pre>
149     <p><strong>Debian distributions</strong></p>
150     <pre class="command">
151     # apt-get -y install wget patch gcc make libncurses-dev
152     </pre>
153     <p><strong>SUSE distributions</strong></p>
154     <pre class="command">
155     # yast -i wget patch gcc make ncurses-devel
156     </pre>
157    
158     <h3><a name="2.2">2.2. Download and patch the kernel</a></h3>
159    
160     <p>Download the kernel source from <a href="http://www.kernel.org/pub/linux/kernel/v2.6/">linux-2.6</a> or <a href="http://www.kernel.org/pub/linux/kernel/v3.0/">linux-3</a>.<br>
161     Linux kernel 2.6.27 and later are supported from the linux-2.6 tree.<br>
162     Linux kernel 3.0 and later are supported from the linux-3 tree.</p>
163    
164     <p>Extract the kernel source and go to the extracted directory.<br>
165     In the operations below, "$VERSION.$PATCHLEVEL.diff" should for example be replaced with "3.3.diff" if using Linux kernel 3.3.1 :</p>
166    
167     <pre class="command">
168     $ wget -O caitsith-patch-0.1-20120401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&amp;f=/caitsith/55464/caitsith-patch-0.1-20120401.tar.gz'
169     $ wget -O caitsith-patch-0.1-20120401.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&amp;f=/caitsith/55464/caitsith-patch-0.1-20120401.tar.gz.asc'
170     $ wget http://I-love.SAKURA.ne.jp/kumaneko-key
171     $ gpg --import kumaneko-key
172     $ gpg caitsith-patch-0.1-20120401.tar.gz.asc
173     $ tar -zxf caitsith-patch-0.1-20120401.tar.gz
174 kumaneko 10 $ cat patches/ccs-patch-$VERSION.$PATCHLEVEL.diff | sed -e 's/CCSECURITY/CAITSITH/g' -e 's/ccsecurity/caitsith/g' | patch -sp1
175 kumaneko 15 </pre>
176 kumaneko 10
177 kumaneko 15 <h3><a name="2.3">2.3. Configure the kernel</a></h3>
178 kumaneko 10
179 kumaneko 15 <pre class="command">
180     $ make -s menuconfig
181     </pre>
182 kumaneko 10
183 kumaneko 15 <p>Choose the following options in "Security options" section:</p>
184 kumaneko 10
185 kumaneko 15 <ul>
186     <li>[*] CaitSith support</li>
187     <li>[ ] &nbsp;&nbsp;Compile as loadable kernel module</li>
188     <li>[ ] &nbsp;&nbsp;Disable by default</li>
189     <li>[ ] &nbsp;&nbsp;Do not modify 'struct task_struct' in order to keep KABI</li>
190     <li>[ ] &nbsp;&nbsp;Activate without calling userspace policy loader.</li>
191     <li>(/sbin/caitsith-init) Location of userspace policy loader</li>
192     <li>(/sbin/init) Trigger for calling userspace policy loader</li>
193     <li>[*] &nbsp;&nbsp;Enable readdir operation restriction.</li>
194     <li>[*] &nbsp;&nbsp;Enable getattr operation restriction.</li>
195     <li>[*] &nbsp;&nbsp;Enable socket operation restriction.</li>
196     <li>[*] &nbsp;&nbsp;Enable non-POSIX capability operation restriction.</li>
197     <li>[*] &nbsp;&nbsp;Enable ptrace operation restriction.</li>
198     <li>[*] &nbsp;&nbsp;Enable kill operation restriction.</li>
199     <li>[*] &nbsp;&nbsp;Enable environment variable names/values restriction.</li>
200     <li>[*] &nbsp;&nbsp;Enable execute handler functionality.</li>
201     <li>[*] &nbsp;&nbsp;Enable domain transition without program execution request.</li>
202     <li>[*] &nbsp;&nbsp;Enable automatic domain transition.</li>
203     </ul>
204    
205     <p><em>"Compile as loadable kernel module"</em> is useful when there is a file size limitation for vmlinux (e.g. embedded systems).</p>
206    
207     <p><em>"Disable by default"</em> will enable CaitSith only when "caitsith=on" is passed to the kernel's command line options. If this option is not selected, "caitsith=off" will disable CaitSith.</p>
208    
209     <p><em>"Do not modify 'struct task_struct' in order to keep KABI"</em> will manage "struct task_struct" variables outside "struct task_struct" in order to avoid Kernel Application Binary Interface (KABI) breakage. Choose this option if wanting to patch against distributor's kernels without breaking KABI. However, since "struct caitsith_operations" must be exported to loadable kernel modules (LKMs) in order to allow them to call CaitSith's functions, build scripts may still print warning messages.</p>
210    
211     <p>There are two types of CaitSith's policy configuration. The former is embedded into the kernel and the latter is saved as files on the filesystems (e.g. /etc/caitsith/ directory). You will need to rebuild the kernel whenever updating the former, but allows you to load policy without using userspace policy loader (e.g. /sbin/caitsith-init ). The latter is loaded by executing userspace policy loader when the access control by CaitSith is about to be activated (e.g. when /sbin/init starts). <em>Activate without calling userspace policy loader.</em> allows you to activate access control by CaitSith as soon as the former is loaded. This option is useful when it is difficult to call policy loader (e.g. embedded systems).</p>
212    
213     <p><em>Location of userspace policy loader</em> is available only when <em>Activate without calling userspace policy loader.</em> is not selected. This option specifies the default pathname of the userspace policy loader. You can override this setting via the "CCS_loader=" kernel command-line option.</p>
214    
215     <p><em>Trigger for calling userspace policy loader</em> is available only when <em>Activate without calling userspace policy loader.</em> is not selected. This option specifies the default pathname of the activation trigger. You can override this setting via the "CCS_trigger=" kernel command-line option. For example, if you pass "init=/bin/systemd" option, you may also want to pass "CCS_trigger=/bin/systemd" option.</p>
216    
217     <h3><a name="2.4">2.4. Compile and install the kernel</a></h3>
218    
219     <p>The policy configuration which will be embedded into the kernel needs to exist as security/caitsith/policy/policy.conf . But you can proceed without creating that file because you don't have the policy configuration to embed as of this step. (You may come back here after you developed policy configuration to embed.)</p>
220    
221     <p>Once the kernel has been configured, compile and install the kernel with the following commands:</p>
222    
223     <pre class="command">
224     $ make -s
225     $ su
226     # make -s modules_install install
227     </pre>
228    
229     <p>Create initrd/initramfs if required.</p>
230    
231     <h3><a name="2.5">2.5. Install the userspace tools</a></h3>
232    
233     <p>Make sure the dependencies described above have been installed. Compile and install the tools with the following commands:</p>
234    
235     <pre class="command">
236     $ wget -O caitsith-tools-0.1-20120401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&amp;f=/caitsith/55465/caitsith-tools-0.1-20120401.tar.gz'
237     $ wget -O caitsith-tools-0.1-20120401.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&amp;f=/caitsith/55465/caitsith-tools-0.1-20120401.tar.gz.asc'
238     $ gpg caitsith-tools-0.1-20120401.tar.gz.asc
239     $ tar -zxf caitsith-tools-0.1-20120401.tar.gz
240 kumaneko 10 $ cd caitsith-tools/
241 kumaneko 15 $ make -s USRLIBDIR=/usr/lib
242     $ su
243     # make -s USRLIBDIR=/usr/lib install
244     </pre>
245 kumaneko 10
246 kumaneko 15 <p>Please change USRLIBDIR=/usr/lib to USRLIBDIR=/usr/lib64 (for 64bits userspace) or USRLIBDIR=/usr/lib32 (for 32bits userspace) if needed.</p>
247 kumaneko 10
248 kumaneko 15 <p>Programs listed below are main userspace tools used for administrating CaitSith.</p>
249 kumaneko 10
250 kumaneko 15 <ul>
251     <li>/sbin/caitsith-init</li>
252     <li>/usr/sbin/caitsith-auditd</li>
253     <li>/usr/sbin/caitsith-loadpolicy</li>
254     <li>/usr/sbin/caitsith-notifyd</li>
255     <li>/usr/sbin/caitsith-pstree</li>
256     <li>/usr/sbin/caitsith-queryd</li>
257     <li>/usr/sbin/caitsith-savepolicy</li>
258     </ul>
259    
260     <p>You will probably want to add /usr/sbin to your PATH so that the commands can be run easily. If you are using <code>/bin/bash</code>, append the following line to ~/.bashrc:</p>
261    
262     <pre>
263     export PATH=$PATH:/usr/sbin
264     </pre>
265    
266     <h3><a name="2.6">2.6. Initializing configuration</a></h3>
267    
268     <p>Before you can make use of CaitSith, an initialization procedure must take place. This prepares the files in which policy information will be stored. All policy files are <strong>stored in the "/etc/caitsith/" directory</strong>.</p>
269    
270     <p>Run the following command as root user to initialize:</p>
271    
272     <pre class="command">
273     # /usr/lib/caitsith/init_policy
274     </pre>
275     <pre class="output">
276     Creating policy directory... OK
277     Creating configuration directory... OK
278     Creating default policy... OK.
279     Creating module loader... OK.
280     Creating configuration file for caitsith-auditd ... OK.
281     Creating configuration file for caitsith-notifyd ... OK.
282     </pre>
283    
284     <p>CaitSith can generate audit logs and allows you to read them via /proc/caitsith/audit interface. To save /proc/caitsith/audit automatically, start /usr/sbin/caitsith-auditd from somewhere. Default setting (specified in /etc/caitsith/tools/auditd.conf) sends access matched logs to /dev/null, access unmatched logs to /var/log/caitsith/unmatched.log, access denied logs to /var/log/caitsith/denied.log. (The meaning of matched/unmatched/denied are explained later.)</p>
285    
286     <p>CaitSith can ask for your decision about access requests which will be denied unless you grant them via /proc/caitsith/query interface. To notify immediately the occurrence of access requests which CaitSith is about to deny, start /usr/sbin/caitsith-notifyd from somewhere. Default setting (specified in /etc/caitsith/tools/notifyd.conf) sends mails to root@localhost with subject "Notification from caitsith-notifyd" up to once per a minute.</p>
287    
288     <p>Below example launches /usr/sbin/caitsith-auditd and /usr/sbin/caitsith-notifyd from /etc/rc.local script:</p>
289    
290     <pre>
291     #!/bin/sh
292     #
293     # This script will be executed *after* all the other init scripts.
294     # You can put your own initialization stuff in here if you don't
295     # want to do the full Sys V style init stuff.
296    
297     touch /var/lock/subsys/local
298     /usr/sbin/caitsith-auditd
299     /usr/sbin/caitsith-notifyd
300     </pre>
301    
302     <h3><a name="2.7">2.7. Configuring your bootloader</a></h3>
303    
304     <p>Now edit your bootloader (e.g. GRUB) to include the kernel you have just compiled. If the <em>"Disable by default"</em> option was selected during kernel configuration, remember to include "caitsith=on" in the kernel boot options. Consult the documentation for your distribution and bootloader to find out how to boot your CaitSith kernel.</p>
305    
306     <p>CaitSith supports the kernel boot option "CCS_trigger". This is useful for systems that run a program other than <code>/sbin/init</code> on startup, for example when booting using systemd which uses <code>/bin/systemd</code>. In this case, you should include "CCS_trigger=/bin/systemd" in the kernel boot options.</p>
307    
308 kumaneko 16 <pre>
309     # grub.conf generated by anaconda
310     #
311     # Note that you do not have to rerun grub after making changes to this file
312     # NOTICE: You do not have a /boot partition. This means that
313     # all kernel and initrd paths are relative to /, eg.
314     # root (hd0,0)
315     # kernel /boot/vmlinuz-version ro root=/dev/sda1
316     # initrd /boot/initrd-[generic-]version.img
317     #boot=/dev/sda
318     default=1
319     timeout=5
320     splashimage=(hd0,0)/boot/grub/splash.xpm.gz
321     #hiddenmenu
322     title CentOS (3.2.14-caitsith)
323     root (hd0,0)
324     kernel /boot/vmlinuz-3.2.14-caitsith ro root=UUID=cc8371f3-bb2c-47b4-bd8f-318124f523df rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=jp106 crashkernel=auto
325     initrd /boot/initramfs-3.2.14-caitsith.img
326     title CentOS (2.6.32-220.7.1.el6.i686)
327     root (hd0,0)
328     kernel /boot/vmlinuz-2.6.32-220.7.1.el6.i686 ro root=UUID=cc8371f3-bb2c-47b4-bd8f-318124f523df rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=jp106 crashkernel=auto
329     initrd /boot/initramfs-2.6.32-220.7.1.el6.i686.img
330     </pre>
331    
332 kumaneko 15 <h3><a name="2.8">2.8. Rebooting your system</a></h3>
333    
334 kumaneko 16 <p>Now you have finished all preparation. Reboot your system and choose the entry with CaitSith kernel at the GRUB screen, or at whatever other bootloader you have installed:</p>
335 kumaneko 15
336 kumaneko 16 <img src="media/grub-screen.png" alt="grub-screen.png" title="Select CaitSith enabled kernel" width="640" height="480">
337 kumaneko 15
338     <p>If everything was installed properly and the bootloader was correctly configured, the kernel should boot as normal and CaitSith should be activated:</p>
339    
340 kumaneko 16 <img src="media/caitsith-activated.png" alt="caitsith-activated.png" title="CaitSith activated" width="720" height="400">
341 kumaneko 15
342     <h3><a name="2.9">2.9. How can I disable/uninstall CaitSith?</a></h3>
343    
344     <p>If your system becomes unable to boot during the course of this guide or any time in the future, it may be due to policy configuration or something related to CaitSith. If this is the case, it is possible that the kernel can still be booted by disabling CaitSith. This can be done by appending "caitsith=off" at the kernel command-line parameters.</p>
345    
346     <p>CaitSith fortunately does not require the modification of any existing Linux binaries, libraries or applications. Thus, uninstalling CaitSith is very easy. It is simply a matter of uninstalling the kernel and userspace tools that you installed above. You can reboot with the kernel provided by your distribution and then remove the entry from your bootloader.</p>
347    
348 kumaneko 10 <h2><a name="how_to_develop_policy">3. How to develop policy</a></h2>
349    
350 kumaneko 16 <h3><a name="3.1">3.1. Policy file structure</a></h3>
351 kumaneko 10
352 kumaneko 16 <p>CaitSith's policy file consists with "Header part" and "ACL part".</p>
353 kumaneko 10
354 kumaneko 16 <p>Header part consists with below lines.</p>
355 kumaneko 10
356 kumaneko 16 <pre>
357     POLICY_VERSION=20120401
358     quota memory policy $max_byte_for_policy
359     quota memory audit $max_byte_for_audit_logs
360     quota memory query $max_byte_for_query
361     quota audit[$audit_index] allowed=$max_logs_for_allowed_request unmatched=$max_logs_for_unmatched_request denied=$max_logs_for_denied_request
362     string_group $string_group_name $string_group_member
363     number_group $number_group_name $number_group_member
364     ip_group $ip_group_name $ip_group_member
365     </pre>
366 kumaneko 10
367 kumaneko 16 <ul>
368     <li>POLICY_VERSION line defines policy version.</li>
369     <li>$max_byte_for_policy is max amount of memory in byte which can be allocated for policy. Default is unlimited.</li>
370     <li>$max_byte_for_audit_logs is max amount of memory in byte which can be allocated for audit logs. Default is unlimited. $max_byte_for_audit_logs=16777216 should be sufficient.</li>
371     <li>$max_byte_for_query is max amount of memory in byte which can be allocated for interactive enforcement. Default is unlimited. $max_byte_for_audit_logs=1048576 should be sufficient.</li>
372     <li>quota audit[$audit_index] lines (0 &lt;= $audit_index &lt;= 255) are max number of audit logs which can be held in the kernel space. $max_logs_for_allowed_request is for allowed requests. $max_logs_for_unmatched_request is for unmatched requests. $max_logs_for_denied_request is for denied requests. Default is 0. Unless you have special reasons, you should set 0 to $max_logs_for_allowed_request. Regarding $max_logs_for_unmatched_request and $max_logs_for_denied_request, 1024 should be sufficient.</li>
373     <li>string_group $string_group_name lines define group of strings. $string_group_member is a member for $string_group_name group.</li>
374     <li>number_group $number_group_name lines define group of numbers. $number_group_member is a member for $number_group_name group.</li>
375     <li>ip_group $ip_group_name lines define group of IP addresses. $ip_group_member is a member for $ip_group_name group.</li>
376     </ul>
377 kumaneko 10
378 kumaneko 16 <p>ACL part consists with 0 or more repetitions of below block. In the example above, 2 blocks are defined.</p>
379    
380     <pre>
381     $acl_priority acl $operation $conditions_to_filter
382     audit $audit_index
383     $cond_priority $decision $conditions_to_allow_or_deny
384     </pre>
385    
386     <ul>
387     <li>A block which starts with $acl_priority determines whether to evaluate rules in this block or not.</li>
388     <li>Blocks which start with $acl_priority can be defined as many as you need.</li>
389     <li>$acl_priority is a priority (an integer between 0 and 65535) which controls which block should be evaluated first (among all blocks defined in the policy).</li>
390     <li>Blocks are evaluated from smaller $acl_priority values to larger $acl_priority values.</li>
391     <li>If two blocks have same $acl_priority value, the block which is defined first is evaluated first.</li>
392     <li>$operation is "operation".</li>
393     <li>$conditions_to_filter is "conditional expressions" which can be applied to "operation". Omit $conditions_to_filter to evaluate this block unconditionally.</li>
394     <li>Access requests will be denied if one of deny lines (among all blocks defined in the policy) matches.</li>
395     </ul>
396    
397     <p>$decision lines in a block is evaluated only when the block's $acl_priority line matched.</p>
398    
399     <ul>
400     <li>A line which starts with $cond_priority determines whether to grant the access request or not.</li>
401     <li>Lines which start with $cond_priority can be defined as many as you need.</li>
402     <li>$cond_priority is a priority (an integer between 0 and 65535) which controls which line should be checked first (among all lines defined in the block).</li>
403     <li>Lines are checked from smaller $cond_priority values to larger priority values.</li>
404     <li>If two lines have same $cond_priority value, the line which is defined first is checked first.</li>
405     <li>$decision is either allow or deny.</li>
406     <li>$conditions_to_allow_or_deny is "conditional expressions" which can be applied to "operation". Omit $conditions_to_allow_or_deny to match this line unconditionally.</li>
407     </ul>
408    
409     <p>Checking of $decision lines in a block lasts until it matches a $decision line or it reaches to the end of block.</p>
410    
411     <ul>
412     <li>If $conditions_to_allow_or_deny of a deny line matches, the access request is denied. At the same time, access denied log is generated if memory used for audit logs is smaller than $max_byte_for_audit_logs bytes and number of denied logs which is in the kernel is smaller than $max_logs_for_denied_request of quota audit[$audit_index] line where $audit_index is specified by audit line of this block.</li>
413     <li>If $conditions_to_allow_or_deny of an allow line matches, the evaluation of this block ends and proceeds to next block. At the same time, access allowed log is generated if memory used for audit logs is smaller than $max_byte_for_audit_logs bytes and number of allowed logs which is in the kernel is smaller than $max_logs_for_allowed_request of quota audit[$audit_index] line where $audit_index is specified by audit line of this block.</li>
414     <li>If none of $conditions_to_allow_or_deny matches, the evaluation of this block ends and proceeds to next block. At the same time, access unmatched log is generated if memory used for audit logs is smaller than $max_byte_for_audit_logs bytes and number of unmatched logs which is in the kernel is smaller than $max_logs_for_unmatched_request of quota audit[$audit_index] line where $audit_index is specified by audit line of this block.</li>
415     </ul>
416    
417     <p>Access requests will be denied only when "deny" line of "acl" block matched. (There are two exceptions which will be explained later.)</p>
418    
419     <p>$acl_priority and $cond_priority values are used for two purposes. One is for selectively deny operations using "deny" lines. For example,</p>
420    
421     <pre>
422     10 acl read path.fsmagic=0x9FA0
423     audit 0
424     10 deny path="proc:/cmdline"
425     20 allow
426     </pre>
427    
428     <p>denies opening /proc/cmdline on the proc filesystem (proc filesystem's magic number is 0x9FA0) for reading while allowing opening all other files.</p>
429    
430     <p>The other is for controlling which "transition=" and "handler=" arguments should be used when these arguments matched more than once. This will be explained later.</p>
431    
432     <p>Below is an example of /etc/caitsith/policy/current file on CentOS. The content of this file varies depending on environments you are using, and will be updated as you develop policy.</p>
433    
434     <pre>
435     POLICY_VERSION=20120401
436    
437     quota memory audit 16777216
438     quota memory query 1048576
439     quota audit[1] allowed=0 denied=1024 unmatched=1024
440    
441     10000 acl execute
442     audit 0
443     10 allow path="/sbin/modprobe" transition="/sbin/modprobe"
444     10 allow path="/sbin/init" transition="/sbin/init"
445     10 allow path="/sbin/mingetty" transition="/sbin/mingetty"
446     10 allow path="/sbin/udevd" transition="/sbin/udevd"
447     10 allow path="/usr/sbin/anacron" transition="/usr/sbin/anacron"
448     10 allow path="/usr/sbin/crond" transition="/usr/sbin/crond"
449     10 allow path="/usr/sbin/httpd" transition="/usr/sbin/httpd"
450     10 allow path="/usr/sbin/logrotate" transition="/usr/sbin/logrotate"
451     10 allow path="/usr/sbin/nmbd" transition="/usr/sbin/nmbd"
452     10 allow path="/usr/sbin/smbd" transition="/usr/sbin/smbd"
453     10 allow path="/usr/sbin/sshd" transition="/usr/sbin/sshd"
454     10 allow path="/etc/rc.d/init.d/ntpd" transition="/etc/rc.d/init.d/ntpd"
455     10 allow path="/etc/rc.d/init.d/single" transition="/etc/rc.d/init.d/single"
456     10 allow path="/etc/rc.d/init.d/killall" transition="/etc/rc.d/init.d/killall"
457     10 allow path="/etc/rc.d/init.d/ip6tables" transition="/etc/rc.d/init.d/ip6tables"
458     10 allow path="/etc/rc.d/init.d/halt" transition="/etc/rc.d/init.d/halt"
459     10 allow path="/etc/rc.d/init.d/netfs" transition="/etc/rc.d/init.d/netfs"
460     10 allow path="/etc/rc.d/init.d/messagebus" transition="/etc/rc.d/init.d/messagebus"
461     10 allow path="/etc/rc.d/init.d/sandbox" transition="/etc/rc.d/init.d/sandbox"
462     10 allow path="/etc/rc.d/init.d/rsyslog" transition="/etc/rc.d/init.d/rsyslog"
463     10 allow path="/etc/rc.d/init.d/smb" transition="/etc/rc.d/init.d/smb"
464     10 allow path="/etc/rc.d/init.d/sshd" transition="/etc/rc.d/init.d/sshd"
465     10 allow path="/etc/rc.d/init.d/cgconfig" transition="/etc/rc.d/init.d/cgconfig"
466     10 allow path="/etc/rc.d/init.d/udev-post" transition="/etc/rc.d/init.d/udev-post"
467     10 allow path="/etc/rc.d/init.d/firstboot" transition="/etc/rc.d/init.d/firstboot"
468     10 allow path="/etc/rc.d/init.d/ntpdate" transition="/etc/rc.d/init.d/ntpdate"
469     10 allow path="/etc/rc.d/init.d/crond" transition="/etc/rc.d/init.d/crond"
470     10 allow path="/etc/rc.d/init.d/restorecond" transition="/etc/rc.d/init.d/restorecond"
471     10 allow path="/etc/rc.d/init.d/httpd" transition="/etc/rc.d/init.d/httpd"
472     10 allow path="/etc/rc.d/init.d/rdisc" transition="/etc/rc.d/init.d/rdisc"
473     10 allow path="/etc/rc.d/init.d/postfix" transition="/etc/rc.d/init.d/postfix"
474     10 allow path="/etc/rc.d/init.d/saslauthd" transition="/etc/rc.d/init.d/saslauthd"
475     10 allow path="/etc/rc.d/init.d/netconsole" transition="/etc/rc.d/init.d/netconsole"
476     10 allow path="/etc/rc.d/init.d/network" transition="/etc/rc.d/init.d/network"
477     10 allow path="/etc/rc.d/init.d/avahi-daemon" transition="/etc/rc.d/init.d/avahi-daemon"
478     10 allow path="/etc/rc.d/init.d/auditd" transition="/etc/rc.d/init.d/auditd"
479     10 allow path="/etc/rc.d/init.d/nmb" transition="/etc/rc.d/init.d/nmb"
480     10 allow path="/etc/rc.d/init.d/iptables" transition="/etc/rc.d/init.d/iptables"
481     10 allow path="/etc/rc.d/init.d/cgred" transition="/etc/rc.d/init.d/cgred"
482    
483     0 acl modify_policy
484     audit 1
485     1 deny task.uid!=0
486     1 deny task.euid!=0
487     100 allow task.exe="/usr/sbin/caitsith-loadpolicy"
488     100 allow task.exe="/usr/sbin/caitsith-queryd"
489     10000 deny
490     </pre>
491    
492     <h3><a name="3.2">3.2. Updating policy configuration</a></h3>
493    
494     <p>There are two ways to update policy configuration.</p>
495    
496     <p>One is to use /sbin/caitsith-init which is automatically called when /sbin/init starts. /sbin/caitsith-init reads policy from /etc/caitsith/policy/current and writes to /proc/caitsith/policy interface. Therefore, you can update policy configuration by updating /etc/caitsith/policy/current and rebooting your system.</p>
497    
498     <p>The other is to use /usr/sbin/caitsith-loadpolicy which is defined for loading policy after your system has booted. /sbin/caitsith-loadpolicy reads policy from standard input and writes to /proc/caitsith/policy interface. Therefore, you can update policy configuration without updating /etc/caitsith/policy/current and rebooting your system. For example, if you want to append a "string_group mygroup1 /" line to /proc/caitsith/policy interface, run below command:</p>
499    
500     <pre class="command">
501     # echo 'string_group mygroup1 /' | /usr/sbin/caitsith-loadpolicy
502     </pre>
503    
504     <p>If you want to delete the "string_group mygroup1 /" line from /proc/caitsith/policy interface, run below command:</p>
505    
506     <pre class="command">
507     # echo 'delete string_group mygroup1 /' | /usr/sbin/caitsith-loadpolicy
508     </pre>
509    
510     <p>The contents in /proc/caitsith/policy will be lost when your system shuts down or reboots. To save /proc/caitsith/policy as /etc/caitsith/policy/current , run below command:</p>
511    
512     <pre class="command">
513     # /usr/sbin/caitsith-savepolicy
514     </pre>
515    
516     <h3><a name="3.3">3.3. Example of simple access restriction rule</a></h3>
517    
518     <hr>
519    
520     <p>Please read <a href="#policy_specification">Policy Specification</a> before continue.</p>
521    
522 kumaneko 10 <p>Then, decide conditions to restrict access. Below example restricts opening /etc/shadow for reading.</p>
523    
524     <table border="1">
525     <tr><td>
526     100 acl read path="/etc/shadow"<br>
527     &nbsp;&nbsp;&nbsp;&nbsp;audit 1
528     </td></tr>
529     </table>
530    
531     <p>By operating the system, access unmatched logs are generated and spooled in /proc/caitsith/audit interface when access request of opening /etc/shadow for reading happens. If /usr/sbin/caitsith-auditd is running , access unmatched logs will be moved to /var/log/caitsith/unmatched.log .</p>
532    
533     <table border="1">
534     <tr><td>
535     #2012/03/02 08:11:51# global-pid=2826 result=unmatched priority=100 / read path="/etc/shadow" task.pid=2826 task.ppid=2814 task.uid=0 task.gid=0 task.euid=0 task.egid=0 task.suid=0 task.sgid=0 task.fsuid=0 task.fsgid=0 task.type!=execute_handler task.exe="/usr/bin/passwd" task.domain="/usr/sbin/sshd" path.uid=0 path.gid=42 path.ino=33708 path.major=8 path.minor=1 path.perm=0640 path.type=file path.fsmagic=0xEF53 path.parent.uid=0 path.parent.gid=0 path.parent.ino=32769 path.parent.major=8 path.parent.minor=1 path.parent.perm=0755 path.parent.type=directory path.parent.fsmagic=0xEF53
536     </td></tr>
537     </table>
538    
539     <p>Examine the log and decide whether to grant this access request or not. To grant this request, add an allow line. Below example grants this request to /usr/bin/passwd program.</p>
540    
541     <table border="1">
542     <tr><td>
543     100 acl read path="/etc/shadow"<br>
544     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
545     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/bin/passwd"
546     </td></tr>
547     </table>
548    
549     <p>Operate the system again. For example, /usr/sbin/sshd program and /bin/cat program have requested opening /etc/shadow for reading.</p>
550    
551     <table border="1">
552     <tr><td>
553     #2012/03/02 08:13:06# global-pid=2831 result=unmatched priority=100 / read path="/etc/shadow" task.pid=2831 task.ppid=2691 task.uid=0 task.gid=0 task.euid=0 task.egid=0 task.suid=0 task.sgid=0 task.fsuid=0 task.fsgid=0 task.type!=execute_handler task.exe="/usr/sbin/sshd" task.domain="/usr/sbin/sshd" path.uid=0 path.gid=42 path.ino=33716 path.major=8 path.minor=1 path.perm=0640 path.type=file path.fsmagic=0xEF53 path.parent.uid=0 path.parent.gid=0 path.parent.ino=32769 path.parent.major=8 path.parent.minor=1 path.parent.perm=0755 path.parent.type=directory path.parent.fsmagic=0xEF53<br>
554     #2012/03/02 08:13:12# global-pid=2837 result=unmatched priority=100 / read path="/etc/shadow" task.pid=2837 task.ppid=2833 task.uid=0 task.gid=0 task.euid=0 task.egid=0 task.suid=0 task.sgid=0 task.fsuid=0 task.fsgid=0 task.type!=execute_handler task.exe="/bin/cat" task.domain="/usr/sbin/sshd" path.uid=0 path.gid=42 path.ino=33716 path.major=8 path.minor=1 path.perm=0640 path.type=file path.fsmagic=0xEF53 path.parent.uid=0 path.parent.gid=0 path.parent.ino=32769 path.parent.major=8 path.parent.minor=1 path.parent.perm=0755 path.parent.type=directory path.parent.fsmagic=0xEF53
555     </td></tr>
556     </table>
557    
558     <p>Add an allow line with /usr/sbin/sshd program in order to allow access by /usr/sbin/sshd program. Also, add a deny line with /bin/cat program in order to deny access by /bin/cat program. Give higher priority (i.e. smaller $cond_priority value) to deny line than allow line so that deny lines are checked before allow lines are checked.</p>
559    
560     <table border="1">
561     <tr><td>
562     100 acl read path="/etc/shadow"<br>
563     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
564     &nbsp;&nbsp;&nbsp;&nbsp;10 deny task.exe="/bin/cat"<br>
565     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/bin/passwd"<br>
566     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/sbin/sshd"
567     </td></tr>
568     </table>
569    
570     <p>From now on, attempt to read /etc/shadow using /bin/cat should be denied and access denied logs should be generated. If /usr/sbin/caitsith-auditd is running , access denied logs will be moved to /var/log/caitsith/denied.log .</p>
571    
572     <table border="1">
573     <tr><td>
574     #2012/03/02 08:14:38# global-pid=2842 result=denied priority=100 / read path="/etc/shadow" task.pid=2842 task.ppid=2833 task.uid=0 task.gid=0 task.euid=0 task.egid=0 task.suid=0 task.sgid=0 task.fsuid=0 task.fsgid=0 task.type!=execute_handler task.exe="/bin/cat" task.domain="/usr/sbin/sshd" path.uid=0 path.gid=42 path.ino=33716 path.major=8 path.minor=1 path.perm=0640 path.type=file path.fsmagic=0xEF53 path.parent.uid=0 path.parent.gid=0 path.parent.ino=32769 path.parent.major=8 path.parent.minor=1 path.parent.perm=0755 path.parent.type=directory path.parent.fsmagic=0xEF53
575     </td></tr>
576     </table>
577    
578     <p>After you have finished enumerating all allow lines and deny lines, add a deny line with lowest priority (i.e. largest $cond_priority value within this block).</p>
579    
580     <table border="1">
581     <tr><td>
582     100 acl read path="/etc/shadow"<br>
583     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
584     &nbsp;&nbsp;&nbsp;&nbsp;10 deny task.exe="/bin/cat"<br>
585     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/bin/passwd"<br>
586     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/sbin/sshd"<br>
587     &nbsp;&nbsp;&nbsp;&nbsp;10000 deny
588     </td></tr>
589     </table>
590    
591     <p>A rule for restricting /etc/shadow for opening is now completed.</p>
592    
593     <p>Note that the rule explained above alone cannot prevent diverted accesses such as creating a hard link of /etc/shadow . If the resource to protect has characteristic attribute, it is recommended to utilize such attributes. On several distributions, /etc/shadow is owned by shadow group. In that case, this rule can be modified to below. (Below example assumes that shadow group's group ID is 42.)</p>
594    
595     <table border="1">
596     <tr><td>
597     100 acl read path.gid=42<br>
598     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
599     &nbsp;&nbsp;&nbsp;&nbsp;10 deny task.exe="/bin/cat"<br>
600     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/bin/passwd"<br>
601     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/sbin/sshd"<br>
602     &nbsp;&nbsp;&nbsp;&nbsp;10000 deny
603     </td></tr>
604     </table>
605    
606     <p>On several distributions, /etc/shadow is owned by root user and root group and has DAC permissions 0400. In that case, you might want to use a rule like below. (You should check whether there are other files with such attributes.)</p>
607    
608     <table border="1">
609     <tr><td>
610     100 acl read path.uid=0 path.gid=0 path.perm=0400<br>
611     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
612     &nbsp;&nbsp;&nbsp;&nbsp;10 deny task.exe="/bin/cat"<br>
613     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/bin/passwd"<br>
614     &nbsp;&nbsp;&nbsp;&nbsp;100 allow task.exe="/usr/sbin/sshd"<br>
615     &nbsp;&nbsp;&nbsp;&nbsp;10000 deny
616     </td></tr>
617     </table>
618    
619     <p>It is recommended to restrict other operations such as mount, link and rename. For example, a rule to deny creation of hard links which is not owned by the user would look like below. (Note that the variable which refers source pathname of link operation is "old_path" rather than "path" because the operation is "link".)</p>
620    
621     <table border="1">
622     <tr><td>
623     100 acl link old_path.uid!=task.uid<br>
624     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
625     &nbsp;&nbsp;&nbsp;&nbsp;100 deny
626     </td></tr>
627     </table>
628    
629     <p>If you can split files into different filesystems or different partitions, you might be able to utilize more variables. For example, rules for denying creation of hard links on tmpfs filesystem (tmpfs filesystem's magic number is 0x01021994) would look like below.</p>
630    
631     <table border="1">
632     <tr><td>
633     100 acl link old_path.fsmagic=0x01021994<br>
634     &nbsp;&nbsp;&nbsp;&nbsp;audit 1<br>
635     &nbsp;&nbsp;&nbsp;&nbsp;10 deny
636     </td></tr>
637     </table>
638    
639     <p>Splitting into different partitions and defining rules based on partition's attributes will help preventing diverted access via creating hard links, for hard links cannot be created across partitions. Separating /home partition from / partition will be useful when protecting resources in /home partition.</p>
640    
641     <hr>
642    
643     <h1><a name="policy_specification">Policy Specification</a></h1>
644    
645     <h2><a name="available_parameters">1. About parameters which can be handled via policy</a></h2>
646    
647     <p>Each entry in the policy has a keyword that specifies "operation", and can optionally have "conditional expressions".</p>
648    
649     <p>It is possible to check parameters which can be represented as string data or numeric data using "conditional expressions".</p>
650    
651     <h3><a name="string_expression">1.1. String parameters representation rule</a></h3>
652    
653     <p>Parameters such as file's pathnames and command line arguments and environment variables are handled as string data.</p>
654    
655     <p>All ASCII printable characters other than \ character (i.e. from 33 to 91 and from 93 to 126) are represented as is.</p>
656    
657     <p>All other characters (i.e. from 0 to 32, 92 and from 127 to 255) are represented using \ooo style octal form.</p>
658    
659     <table border="1">
660     <tr>
661     <td>
662     <table><tr><td></td><td>Lower 4 bits</td></tr><tr><td>Upper 4 bits</td><td></td></tr></table>
663     </td>
664     <th><p>0x0</p></th>
665     <th><p>0x1</p></th>
666     <th><p>0x2</p></th>
667     <th><p>0x3</p></th>
668     <th><p>0x4</p></th>
669     <th><p>0x5</p></th>
670     <th><p>0x6</p></th>
671     <th><p>0x7</p></th>
672     <th><p>0x8</p></th>
673     <th><p>0x9</p></th>
674     <th><p>0xA</p></th>
675     <th><p>0xB</p></th>
676     <th><p>0xC</p></th>
677     <th><p>0xD</p></th>
678     <th><p>0xE</p></th>
679     <th><p>0xF</p></th>
680     </tr>
681     <tr>
682     <th><p>0x0</p></th>
683     <td><p>\000</p></td>
684     <td><p>\001</p></td>
685     <td><p>\002</p></td>
686     <td><p>\003</p></td>
687     <td><p>\004</p></td>
688     <td><p>\005</p></td>
689     <td><p>\006</p></td>
690     <td><p>\007</p></td>
691     <td><p>\010</p></td>
692     <td><p>\011</p></td>
693     <td><p>\012</p></td>
694     <td><p>\013</p></td>
695     <td><p>\014</p></td>
696     <td><p>\015</p></td>
697     <td><p>\016</p></td>
698     <td><p>\017</p></td>
699     </tr>
700     <tr>
701     <th><p>0x1</p></th>
702     <td><p>\020</p></td>
703     <td><p>\021</p></td>
704     <td><p>\022</p></td>
705     <td><p>\023</p></td>
706     <td><p>\024</p></td>
707     <td><p>\025</p></td>
708     <td><p>\026</p></td>
709     <td><p>\027</p></td>
710     <td><p>\030</p></td>
711     <td><p>\031</p></td>
712     <td><p>\032</p></td>
713     <td><p>\033</p></td>
714     <td><p>\034</p></td>
715     <td><p>\035</p></td>
716     <td><p>\036</p></td>
717     <td><p>\037</p></td>
718     </tr>
719     <tr>
720     <th><p>0x2</p></th>
721     <td><p>\040</p></td>
722     <td><p>!</p></td>
723     <td><p>"</p></td>
724     <td><p>#</p></td>
725     <td><p>$</p></td>
726     <td><p>%</p></td>
727     <td><p>&amp;</p></td>
728     <td><p>'</p></td>
729     <td><p>(</p></td>
730     <td><p>)</p></td>
731     <td><p>*</p></td>
732     <td><p>+</p></td>
733     <td><p>,</p></td>
734     <td><p>-</p></td>
735     <td><p>.</p></td>
736     <td><p>/</p></td>
737     </tr>
738     <tr>
739     <th><p>0x3</p></th>
740     <td><p>0</p></td>
741     <td><p>1</p></td>
742     <td><p>2</p></td>
743     <td><p>3</p></td>
744     <td><p>4</p></td>
745     <td><p>5</p></td>
746     <td><p>6</p></td>
747     <td><p>7</p></td>
748     <td><p>8</p></td>
749     <td><p>9</p></td>
750     <td><p>:</p></td>
751     <td><p>;</p></td>
752     <td><p>&lt;</p></td>
753     <td><p>=</p></td>
754     <td><p>&gt;</p></td>
755     <td><p>?</p></td>
756     </tr>
757     <tr>
758     <th><p>0x4</p></th>
759     <td><p>@</p></td>
760     <td><p>A</p></td>
761     <td><p>B</p></td>
762     <td><p>C</p></td>
763     <td><p>D</p></td>
764     <td><p>E</p></td>
765     <td><p>F</p></td>
766     <td><p>G</p></td>
767     <td><p>H</p></td>
768     <td><p>I</p></td>
769     <td><p>J</p></td>
770     <td><p>K</p></td>
771     <td><p>L</p></td>
772     <td><p>M</p></td>
773     <td><p>N</p></td>
774     <td><p>O</p></td>
775     </tr>
776     <tr>
777     <th><p>0x5</p></th>
778     <td><p>P</p></td>
779     <td><p>Q</p></td>
780     <td><p>R</p></td>
781     <td><p>S</p></td>
782     <td><p>T</p></td>
783     <td><p>U</p></td>
784     <td><p>V</p></td>
785     <td><p>W</p></td>
786     <td><p>X</p></td>
787     <td><p>Y</p></td>
788     <td><p>Z</p></td>
789     <td><p>[</p></td>
790     <td><p>\134</p></td>
791     <td><p>]</p></td>
792     <td><p>^</p></td>
793     <td><p>_</p></td>
794     </tr>
795     <tr>
796     <th><p>0x6</p></th>
797     <td><p>`</p></td>
798     <td><p>a</p></td>
799     <td><p>b</p></td>
800     <td><p>c</p></td>
801     <td><p>d</p></td>
802     <td><p>e</p></td>
803     <td><p>f</p></td>
804     <td><p>g</p></td>
805     <td><p>h</p></td>
806     <td><p>i</p></td>
807     <td><p>j</p></td>
808     <td><p>k</p></td>
809     <td><p>l</p></td>
810     <td><p>m</p></td>
811     <td><p>n</p></td>
812     <td><p>o</p></td>
813     </tr>
814     <tr>
815     <th><p>0x7</p></th>
816     <td><p>p</p></td>
817     <td><p>q</p></td>
818     <td><p>r</p></td>
819     <td><p>s</p></td>
820     <td><p>t</p></td>
821     <td><p>u</p></td>
822     <td><p>v</p></td>
823     <td><p>w</p></td>
824     <td><p>x</p></td>
825     <td><p>y</p></td>
826     <td><p>z</p></td>
827     <td><p>{</p></td>
828     <td><p>|</p></td>
829     <td><p>}</p></td>
830     <td><p>~</p></td>
831     <td><p>\177</p></td>
832     </tr>
833     <tr>
834     <th><p>0x8</p></th>
835     <td><p>\200</p></td>
836     <td><p>\201</p></td>
837     <td><p>\202</p></td>
838     <td><p>\203</p></td>
839     <td><p>\204</p></td>
840     <td><p>\205</p></td>
841     <td><p>\206</p></td>
842     <td><p>\207</p></td>
843     <td><p>\210</p></td>
844     <td><p>\211</p></td>
845     <td><p>\212</p></td>
846     <td><p>\213</p></td>
847     <td><p>\214</p></td>
848     <td><p>\215</p></td>
849     <td><p>\216</p></td>
850     <td><p>\217</p></td>
851     </tr>
852     <tr>
853     <th><p>0x9</p></th>
854     <td><p>\220</p></td>
855     <td><p>\221</p></td>
856     <td><p>\222</p></td>
857     <td><p>\223</p></td>
858     <td><p>\224</p></td>
859     <td><p>\225</p></td>
860     <td><p>\226</p></td>
861     <td><p>\227</p></td>
862     <td><p>\230</p></td>
863     <td><p>\231</p></td>
864     <td><p>\232</p></td>
865     <td><p>\233</p></td>
866     <td><p>\234</p></td>
867     <td><p>\235</p></td>
868     <td><p>\236</p></td>
869     <td><p>\237</p></td>
870     </tr>
871     <tr>
872     <th><p>0xA</p></th>
873     <td><p>\240</p></td>
874     <td><p>\241</p></td>
875     <td><p>\242</p></td>
876     <td><p>\243</p></td>
877     <td><p>\244</p></td>
878     <td><p>\245</p></td>
879     <td><p>\246</p></td>
880     <td><p>\247</p></td>
881     <td><p>\250</p></td>
882     <td><p>\251</p></td>
883     <td><p>\252</p></td>
884     <td><p>\253</p></td>
885     <td><p>\254</p></td>
886     <td><p>\255</p></td>
887     <td><p>\256</p></td>
888     <td><p>\257</p></td>
889     </tr>
890     <tr>
891     <th><p>0xB</p></th>
892     <td><p>\260</p></td>
893     <td><p>\261</p></td>
894     <td><p>\262</p></td>
895     <td><p>\263</p></td>
896     <td><p>\264</p></td>
897     <td><p>\265</p></td>
898     <td><p>\266</p></td>
899     <td><p>\267</p></td>
900     <td><p>\270</p></td>
901     <td><p>\271</p></td>
902     <td><p>\272</p></td>
903     <td><p>\273</p></td>
904     <td><p>\274</p></td>
905     <td><p>\275</p></td>
906     <td><p>\276</p></td>
907     <td><p>\277</p></td>
908     </tr>
909     <tr>
910     <th><p>0xC</p></th>
911     <td><p>\300</p></td>
912     <td><p>\301</p></td>
913     <td><p>\302</p></td>
914     <td><p>\303</p></td>
915     <td><p>\304</p></td>
916     <td><p>\305</p></td>
917     <td><p>\306</p></td>
918     <td><p>\307</p></td>
919     <td><p>\310</p></td>
920     <td><p>\311</p></td>
921     <td><p>\312</p></td>
922     <td><p>\313</p></td>
923     <td><p>\314</p></td>
924     <td><p>\315</p></td>
925     <td><p>\316</p></td>
926     <td><p>\317</p></td>
927     </tr>
928     <tr>
929     <th><p>0xD</p></th>
930     <td><p>\320</p></td>
931     <td><p>\321</p></td>
932     <td><p>\322</p></td>
933     <td><p>\323</p></td>
934     <td><p>\324</p></td>
935     <td><p>\325</p></td>
936     <td><p>\326</p></td>
937     <td><p>\327</p></td>
938     <td><p>\330</p></td>
939     <td><p>\331</p></td>
940     <td><p>\332</p></td>
941     <td><p>\333</p></td>
942     <td><p>\334</p></td>
943     <td><p>\335</p></td>
944     <td><p>\336</p></td>
945     <td><p>\337</p></td>
946     </tr>
947     <tr>
948     <th><p>0xE</p></th>
949     <td><p>\340</p></td>
950     <td><p>\341</p></td>
951     <td><p>\342</p></td>
952     <td><p>\343</p></td>
953     <td><p>\344</p></td>
954     <td><p>\345</p></td>
955     <td><p>\346</p></td>
956     <td><p>\347</p></td>
957     <td><p>\350</p></td>
958     <td><p>\351</p></td>
959     <td><p>\352</p></td>
960     <td><p>\353</p></td>
961     <td><p>\354</p></td>
962     <td><p>\355</p></td>
963     <td><p>\356</p></td>
964     <td><p>\357</p></td>
965     </tr>
966     <tr>
967     <th><p>0xF</p></th>
968     <td><p>\360</p></td>
969     <td><p>\361</p></td>
970     <td><p>\362</p></td>
971     <td><p>\363</p></td>
972     <td><p>\364</p></td>
973     <td><p>\365</p></td>
974     <td><p>\366</p></td>
975     <td><p>\367</p></td>
976     <td><p>\370</p></td>
977     <td><p>\371</p></td>
978     <td><p>\372</p></td>
979     <td><p>\373</p></td>
980     <td><p>\374</p></td>
981     <td><p>\375</p></td>
982     <td><p>\376</p></td>
983     <td><p>\377</p></td>
984     </tr>
985     </table>
986    
987     <p>It is possible to use wildcards listed below in order to match string patterns.</p>
988    
989     <table border="1">
990     <tr>
991     <th><p>Wildcard</p></th>
992     <th><p>Pattern match</p></th>
993     <th><p>Examples</p></th>
994     </tr>
995     <tr>
996     <td><p>\*</p></td>
997     <td><p>0 or more repetitions of characters other than "/"</p></td>
998     <td><p>/var/log/samba/\*</p></td>
999     </tr>
1000     <tr>
1001     <td><p>\@</p></td>
1002     <td><p>0 or more repetitions of characters other than "/" or "."</p></td>
1003     <td><p>/var/www/html/\@.html</p></td>
1004     </tr>
1005     <tr>
1006     <td><p>\?</p></td>
1007     <td><p>1 byte character other than "/"</p></td>
1008     <td><p>/tmp/mail.\?\?\?\?\?\?</p></td>
1009     </tr>
1010     <tr>
1011     <td><p>\$</p></td>
1012     <td><p>1 or more repetitions of decimal digits</p></td>
1013     <td><p>/proc/\$/cmdline</p></td>
1014     </tr>
1015     <tr>
1016     <td><p>\+</p></td>
1017     <td><p>1 decimal digit</p></td>
1018     <td><p>/var/tmp/my_work.\+</p></td>
1019     </tr>
1020     <tr>
1021     <td><p>\X</p></td>
1022     <td><p>1 or more repetitions of hexadecimal digits</p></td>
1023     <td><p>/var/tmp/my-work.\X</p></td>
1024     </tr>
1025     <tr>
1026     <td><p>\x</p></td>
1027     <td><p>1 hexadecimal digit</p></td>
1028     <td><p>/tmp/my-work.\x</p></td>
1029     </tr>
1030     <tr>
1031     <td><p>\A</p></td>
1032     <td><p>1 or more repetitions of alphabet characters</p></td>
1033     <td><p>/var/log/my-work/\$-\A-\$.log</p></td>
1034     </tr>
1035     <tr>
1036     <td><p>\a</p></td>
1037     <td><p>1 alphabet character</p></td>
1038     <td><p>/home/users/\a/\*/public_html/\*.html</p></td>
1039     </tr>
1040     <tr>
1041     <td><p>\-</p></td>
1042     <td><p>Pathname subtraction operator (negative match)</p></td>
1043     <td>
1044     <p>/\*\-proc\-sys</p>
1045     <p>This will match /\* except "/proc" and "/sys".</p>
1046     </td>
1047     </tr>
1048     <tr>
1049     <td><p>/\{dir\}/</p></td>
1050     <td><p>Recursive directory matching operator.</p>
1051     <p>Matches "/" and 1 or more repetitions of "dir/".</p></td>
1052     <td>
1053     <p>/var/www/html/\{\*\}/\*.html</p>
1054     <p>This will match all *.html files in subdirectories under /var/www/html/ directory. Note that /var/www/html/\*.html will not match.</p>
1055     </td>
1056     </tr>
1057     <tr>
1058     <td><p>/({dir\)/</p></td>
1059     <td><p>Recursive directory matching operator.</p>
1060     <p>Matches "/" and 0 or more repetitions of "dir/".</p></td>
1061     <td>
1062     <p>/var/www/html/\(\*\)/\*.html</p>
1063     <p>This will match all *.html files under /var/www/html/ directory. Note that /var/www/html/\*.html will match.</p>
1064     </td>
1065     </tr>
1066     </table>
1067    
1068     <p>It is possible to group string data using "<a href="#string_comparison">string_group</a>" syntax.</p>
1069    
1070     <h3><a name="numeric_expression">1.2. Numeric parameters representation rule</a></h3>
1071    
1072     <p>Parameters such as user ID and process ID are handled as numeric data.</p>
1073    
1074     <p>Decimal form, octal form and hexadecimal form are supported. Octal form is prefixed with 0 and Hexadecimal form is prefixed with 0x. For example, 010 in octal form is equivalent with 8 in decimal form, 0x10 in hexadecimal form is equivalent with 16 in decimal form.</p>
1075    
1076     <p>Since numeric data is handled using C language's "unsigned long" type, minimal value is 0 and maximal value is 0xFFFFFFFF (for 32 bit environments) or 0xFFFFFFFFFFFFFFFF (for 64 bit environments).</p>
1077    
1078     <p>It is possible to specify numeric data ranges in $min_value-$max_value form. If specifying in range, $min_value has to be smaller or equals to $max_value. For example, 0-100 is valid but 100-0 is invalid.</p>
1079    
1080     <p>It is possible to group numeric data or numeric data range using "<a href="#integer_comparison">number_group</a>" syntax.</p>
1081    
1082     <h3><a name="ipaddress_expression">1.3. IP address parameters representation rule</a></h3>
1083    
1084     <p>It is possible to handle IPv4 address and IPv6 address. IPv4 address (32 bit) is represented using dot separated decimal form. and IPv6 address (128 bit) is represented using forms defined in RFC 2373.</p>
1085    
1086     <p>It is possible to specify IP address ranges in $min_address-$max_address form. If specifying in range, $min_address has to be smaller or equals to $max_address. For example, 1.2.3.4-5.6.7.8 is valid but 5.6.7.8-1.2.3.4 is invalid.</p>
1087    
1088     <p>It is possible to group IP address and IP address range using "<a href="#ipaddr_comparison">ip_group</a>" syntax.</p>
1089    
1090     <h2><a name="conditions">2. About conditional expressions</a></h2>
1091    
1092     <p>Valid conditions are determined by "operation". See <a href="#syntax_list">List of syntaxes sorted by operations</a> for "operation".</p>
1093    
1094     <p>Some examples are shown below. Details of conditions are explained later.</p>
1095    
1096     <table border="1">
1097     <tr><td>Example of policy</td><td>Meaning</td></tr>
1098     <tr><td>acl execute</td><td>Execution of any program</td></tr>
1099     <tr><td>acl execute task.uid=0</td><td>Execution of any program by current thread's user ID is 0</td></tr>
1100     <tr><td>acl execute task.uid=0 task.gid=0</td><td>Execution of any program by current thread's user ID and group ID are both 0</td></tr>
1101     <tr><td>acl execute path="/bin/true"</td><td>Execution of any program where normalized pathname is /bin/true .</td></tr>
1102     <tr><td>acl execute path="/bin/true" argv[1]="--help"</td><td>Execution of any program where normalized pathname is /bin/true and the first command line argument is --help</td></tr>
1103     <tr><td>acl execute task.uid=0 path="/sbin/init"</td><td>Execution of any program where normalized pathname is /sbin/init by current thread's user ID is 0</td></tr>
1104     </table>
1105    
1106     <p>Basically conditions are omissible. But a few "operation" have mandatory conditions and parameters which controls behavior after policy matches. Such conditions/parameters are explained in individual topics.</p>
1107    
1108     <h3><a name="string_comparison">2.1. Conditional expressions which handle string parameters</a></h3>
1109    
1110     <p>Number of parameters which is represented as string data depends on "operation". For example, "read" operation has one and "rename" operation has two. Thus, the name of variables which references string data varies on "operation". See <a href="#syntax_list">List of syntaxes sorted by operations</a> for name of variables that handle string data. Below description assumes that the name of variable is "path".</p>
1111    
1112     <p>Comparison with string data is defined as below.</p>
1113    
1114     <table border="1">
1115     <tr><td>Conditions example</td><td>Value of variable "path"</td><td>Comparison result</td></tr>
1116     <tr><td rowspan="5">path="/tmp/\*"</td>
1117     <td>/</td><td>Does not match</td></tr>
1118     <tr><td>/tmp</td><td>Does not match</td></tr>
1119     <tr><td>/tmp/</td><td>Matches</td></tr>
1120     <tr><td>/tmp/rt6bh84t</td><td>Matches</td></tr>
1121     <tr><td>/tmp/349gy08t/y8024fgf</td><td>Does not match</td></tr>
1122     <tr><td rowspan="5">path!="/tmp/\*"</td>
1123     <td>/</td><td>Matches</td></tr>
1124     <tr><td>/tmp</td><td>Matches</td></tr>
1125     <tr><td>/tmp/</td><td>Does not match</td></tr>
1126     <tr><td>/tmp/rt6bh84t</td><td>Does not match</td></tr>
1127     <tr><td>/tmp/349gy08t/y8024fgf</td><td>Matches</td></tr>
1128     </table>
1129    
1130     <p>If a string_group group named TMPDIR is defined as</p>
1131    
1132     <table border="1">
1133     <tr><td>
1134     string_group TMPDIR /tmp<br>
1135     string_group TMPDIR /tmp/\(\*\)/\*
1136     </td></tr>
1137     </table>
1138    
1139     <p>it is possible to define conditions like below.</p>
1140    
1141     <table border="1">
1142     <tr><td>Conditions example</td><td>Value of variable "path"</td><td>Value of TMPDIR group</td><td>Comparison result</td></tr>
1143     <tr><td rowspan="4">path=@TMPDIR</td>
1144     <td>/</td><td rowspan="4">/tmp<br>/tmp/\(\*\)/\*</td><td>Does not match</td></tr>
1145     <tr><td>/tmp</td><td>Matches</td></tr>
1146     <tr><td>/tmp/rt6bh84t</td><td>Matches</td></tr>
1147     <tr><td>/tmp/349gy08t/y8024fgf</td><td>Matches</td></tr>
1148     <tr><td rowspan="4">path!=@TMPDIR</td>
1149     <td>/</td><td rowspan="4">/tmp<br>/tmp/\(\*\)/\*</td><td>Matches</td></tr>
1150     <tr><td>/tmp</td><td>Does not match</td></tr>
1151     <tr><td>/tmp/rt6bh84t</td><td>Does not match</td></tr>
1152     <tr><td>/tmp/349gy08t/y8024fgf</td><td>Does not match</td></tr>
1153     </table>
1154    
1155     <h3><a name="integer_comparison">2.2. Conditional expressions which handle numeric parameters</a></h3>
1156    
1157     <p>Number of parameters which is represented as numeric data depends on "operation". For example, "create" operation has one and "mkblock" operation has three. Thus, the name of variables which references numeric parameters varies on "operation". See <a href="#syntax_list">List of syntaxes sorted by operations</a> for name of variables that handle numeric data. Below description uses "task.uid" (which references current thread's user ID) and "task.gid" (which references current thread's group ID) as an example.</p>
1158    
1159     <p>Comparison with numeric value is defined as below.</p>
1160    
1161     <table border="1">
1162     <tr><td>Conditions example</td><td>Value of variable "task.uid"</td><td>Comparison result</td></tr>
1163     <tr><td rowspan="3">task.uid=0</td>
1164     <td>0</td><td>Matches</td></tr>
1165     <tr><td>100</td><td>Does not match</td></tr>
1166     <tr><td>500</td><td>Does not match</td></tr>
1167     <tr><td rowspan="3">task.uid!=0</td>
1168     <td>0</td><td>Does not match</td></tr>
1169     <tr><td>100</td><td>Matches</td></tr>
1170     <tr><td>500</td><td>Matches</td></tr>
1171     </table>
1172    
1173     <p>Comparison with numeric value range is defined as below.</p>
1174    
1175     <table border="1">
1176     <tr><td>Conditions example</td><td>Value of variable "task.gid"</td><td>Comparison result</td></tr>
1177     <tr><td rowspan="3">task.gid=0-100</td>
1178     <td>0</td><td>Matches</td></tr>
1179     <tr><td>100</td><td>Matches</td></tr>
1180     <tr><td>500</td><td>Does not match</td></tr>
1181     <tr><td rowspan="3">task.gid!=0-100</td><td>0</td><td>Does not match</td></tr>
1182     <tr><td>100</td><td>Does not match</td></tr>
1183     <tr><td>500</td><td>Matches</td></tr>
1184     </table>
1185    
1186     <p>It is possible to compare one variable which references numeric value with another variable which references numeric value.</p>
1187    
1188     <table border="1">
1189     <tr><td>Conditions example</td><td>Value of variable "task.uid"</td><td>Value of variable "task.gid"</td><td>Comparison result</td></tr>
1190     <tr><td rowspan="4">task.uid=task.gid</td>
1191     <td>0</td><td>0</td><td>Matches</td></tr>
1192     <tr><td>0</td><td>100</td><td>Does not match</td></tr>
1193     <tr><td>100</td><td>0</td><td>Does not match</td></tr>
1194     <tr><td>100</td><td>100</td><td>Matches</td></tr>
1195     <tr><td rowspan="4">task.uid!=task.gid</td>
1196     <td>0</td><td>0</td><td>Does not match</td></tr>
1197     <tr><td>0</td><td>100</td><td>Matches</td></tr>
1198     <tr><td>100</td><td>0</td><td>Matches</td></tr>
1199     <tr><td>100</td><td>100</td><td>Does not match</td></tr>
1200     </table>
1201    
1202     <p>If a number_group group named ID_GROUP is defined as</p>
1203    
1204     <table border="1">
1205     <tr><td>
1206     number_group ID_GROUP 100<br>
1207     number_group ID_GROUP 200-500
1208     </td></tr>
1209     </table>
1210    
1211     <p>it is possible to define conditions like below.</p>
1212    
1213     <table border="1">
1214     <tr><td>Conditions example</td><td>Value of variable "task.uid"</td><td>Values in ID_GROUP group</td><td>Comparison result</td></tr>
1215     <tr><td rowspan="4">task.uid=@ID_GROUP</td>
1216     <td>0</td><td rowspan="4">100<br>200-500</td><td>Does not match</td></tr>
1217     <tr><td>100</td><td>Matches</td></tr>
1218     <tr><td>500</td><td>Matches</td></tr>
1219     <tr><td>1000</td><td>Does not match</td></tr>
1220     <tr><td rowspan="4">task.uid!=@ID_GROUP</td>
1221     <td>0</td><td rowspan="4">100<br>200-500</td><td>Matches</td></tr>
1222     <tr><td>100</td><td>Does not match</td></tr>
1223     <tr><td>500</td><td>Does not match</td></tr>
1224     <tr><td>1000</td><td>Matches</td></tr>
1225     </table>
1226    
1227     <h3><a name="ipaddr_comparison">2.3. Conditional expressions which handle IP address parameters</a></h3>
1228    
1229     <p>Any "operation" which handles IPv4/IPv6 network address can check IP address using variable "ip". See <a href="#syntax_list">List of syntaxes sorted by operations</a> for operations that can handle IP address.</p>
1230    
1231     <p>Comparison with IP address value is defined as below. Note that comparison between an IPv4 address and an IPv6 address does not match.</p>
1232    
1233     <table border="1">
1234     <tr><td>Conditions example</td><td>Value of variable "ip"</td><td>Comparison result</td></tr>
1235     <tr><td rowspan="4">ip=127.0.0.1</td><td>127.0.0.1</td><td>Matches</td></tr>
1236     <tr><td>0.0.0.0</td><td>Does not match</td></tr>
1237     <tr><td>::1</td><td>Does not match</td></tr>
1238     <tr><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1239     <tr><td rowspan="4">ip!=127.0.0.1</td><td>127.0.0.1</td><td>Does not match</td></tr>
1240     <tr><td>0.0.0.0</td><td>Matches</td></tr>
1241     <tr><td>::1</td><td>Does not match</td></tr>
1242     <tr><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1243     <tr><td rowspan="4">ip=::1</td><td>127.0.0.1</td><td>Does not match</td></tr>
1244     <tr><td>0.0.0.0</td><td>Does not match</td></tr>
1245     <tr><td>::1</td><td>Matches</td></tr>
1246     <tr><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1247     <tr><td rowspan="4">ip!=::1</td><td>127.0.0.1</td><td>Does not match</td></tr>
1248     <tr><td>0.0.0.0</td><td>Does not match</td></tr>
1249     <tr><td>::1</td><td>Does not match</td></tr>
1250     <tr><td>::ffff:127.0.0.1</td><td>Matches</td></tr>
1251     </table>
1252    
1253     <p>Comparison with IP address range is defined as below.</p>
1254    
1255     <table border="1">
1256     <tr><td>Conditions example</td><td>Value of variable "ip"</td><td>Comparison result</td></tr>
1257     <tr><td rowspan="3">ip=127.0.0.0-127.255.255.255</td>
1258     <td>127.0.0.1</td><td>Matches</td></tr>
1259     <tr><td>10.0.0.1</td><td>Does not match</td></tr>
1260     <tr><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1261     <tr><td rowspan="3">ip!=127.0.0.0-127.255.255.255</td>
1262     <td>127.0.0.1</td><td>Does not match</td></tr>
1263     <tr><td>10.0.0.1</td><td>Matches</td></tr>
1264     <tr><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1265     <tr><td rowspan="3">ip=::-::1</td><td>::ffff:127.0.0.1</td><td>Does not match</td></tr>
1266     <tr><td>127.0.0.1</td><td>Does not match</td></tr>
1267     <tr><td>::1</td><td>Matches</td></tr>
1268     <tr><td rowspan="3">ip!=::-::1</td><td>::ffff:127.0.0.1</td><td>Matches</td></tr>
1269     <tr><td>127.0.0.1</td><td>Does not match</td></tr>
1270     <tr><td>::1</td><td>Does not match</td></tr>
1271     </table>
1272    
1273     <p>If an ip_group group named PRIVATE_ADDRESS is defined as</p>
1274    
1275     <table border="1">
1276     <tr><td>
1277     ip_group PRIVATE_ADDRESS 10.0.0.0-10.255.255.255<br>
1278     ip_group PRIVATE_ADDRESS 172.16.0.0-172.31.255.255<br>
1279     ip_group PRIVATE_ADDRESS 192.168.0.0-192.168.255.255<br>
1280     ip_group PRIVATE_ADDRESS fd00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
1281     </td></tr>
1282     </table>
1283    
1284     <p>it is possible to define conditions like below.</p>
1285    
1286     <table border="1">
1287     <tr><td>Conditions example</td><td>Value of variable "ip"</td><td>Values in PRIVATE_ADDRESS group</td><td>Comparison result</td></tr>
1288     <tr><td rowspan="5">ip=@PRIVATE_ADDRESS</td>
1289     <td>127.0.0.1</td><td rowspan="5">10.0.0.0-10.255.255.255<br>172.16.0.0-172.31.255.255<br>192.168.0.0-192.168.255.255<br>fd00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff</td><td>Does not match</td></tr>
1290     <tr><td>10.0.0.1</td><td>Matches</td></tr>
1291     <tr><td>192.168.0.1</td><td>Matches</td></tr>
1292     <tr><td>::ffff:172.16.0.1</td><td>Does not match</td></tr>
1293     <tr><td>fd01::</td><td>Matches</td></tr>
1294     <tr><td rowspan="5">ip!=@PRIVATE_ADDRESS</td><td>127.0.0.1</td><td rowspan="5">10.0.0.0-10.255.255.255<br>172.16.0.0-172.31.255.255<br>192.168.0.0-192.168.255.255<br>fd00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff</td><td>Matches</td></tr>
1295     <tr><td>10.0.0.1</td><td>Does not match</td></tr>
1296     <tr><td>::ffff:192.168.0.1</td><td>Matches</td></tr>
1297     <tr><td>::ffff:127.0.0.1</td><td>Matches</td></tr>
1298     <tr><td>fd01::</td><td>Does not match</td></tr>
1299     </table>
1300    
1301     <h3><a name="task_attributes_comparison">2.4. Conditional expressions which handle current thread's attributes</a></h3>
1302    
1303     <p>It is possible to use current thread's attributes as part of conditions. Below variables are always available.</p>
1304    
1305     <table border="1">
1306     <tr><td>Variable's name</td><td>Comparison method</td><td>Meaning</td><td></td></tr>
1307     <tr><td>task.uid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's user ID</td></tr>
1308     <tr><td>task.gid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's group ID</td></tr>
1309     <tr><td>task.euid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's effective user ID</td></tr>
1310     <tr><td>task.egid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's effective group ID</td></tr>
1311     <tr><td>task.suid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's saved user ID</td></tr>
1312     <tr><td>task.sgid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's saved group ID</td></tr>
1313     <tr><td>task.fsuid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's filesystem user ID</td></tr>
1314     <tr><td>task.fsgid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's filesystem group ID</td></tr>
1315     <tr><td>task.pid</td><td><a href="#integer_comparison">Numeric</a></td><td>Current thread's process ID </td></tr>
1316     <tr><td>task.ppid</td><td><a href="#integer_comparison">Numeric</a></td><td>Process ID of current thread's parent process</td></tr>
1317     <tr><td>task.exe</td><td><a href="#string_comparison">String</a></td><td>Current thread's program name (the content of /proc/self/exe)</td></tr>
1318     <tr><td>task.domain</td><td><a href="#string_comparison">String</a></td><td>Current thread's domainname (the content of /proc/caitsith/self_domain)</td></tr>
1319     <tr><td>task.type</td><td>Literal</td><td>Matches execute_handler if running as an execute handler, does not match execute_handler otherwise</td></tr>
1320     </table>
1321    
1322     <h3><a name="argv_comparison">2.5. Conditional expressions which handle command line arguments</a></h3>
1323    
1324     <p>It is possible to check command line arguments (a.k.a. argv[]) when checking permissions for program execution.</p>
1325    
1326     <table border="1">
1327     <tr><td>Conditions example</td><td>Comparison method</td><td>Meaning</td><td></td></tr>
1328     <tr><td>argv[0]="true"</td><td><a href="#string_comparison">String</a></td><td>argv[0] matches "true"</td></tr>
1329     <tr><td>argv[0]!="false"</td><td><a href="#string_comparison">String</a></td><td>argv[0] does not match "false"</td></tr>
1330     <tr><td>argv[1]=@ARGV1_GROUPS</td><td><a href="#string_comparison">String</a></td><td>argv[0] matches one of strings in string_group ARGV1_GROUPS group</td></tr>
1331     <tr><td>argv[1]!=@ARGV1_GROUPS</td><td><a href="#string_comparison">String</a></td><td>argv[0] matches none of strings in string_group ARGV1_GROUPS group</td></tr>
1332     </table>
1333    
1334     <p>Applications can pass a string data up to 32 * PAGE_SIZE bytes to each argv[]. But due to difficulty of allocating contiguous memory in the kernel, only up to 4085 bytes can be checked using variable "argv[$index]". If you want to check strictly, please consider using handler= argument of "allow " lines in "acl execute" block.</p>
1335    
1336     <h3><a name="envp_comparison">2.6. Conditional expressions which handle environment variable arguments</a></h3>
1337    
1338     <p>It is possible to check environment variables (a.k.a. envp[]) when checking permissions for program execution.</p>
1339    
1340     <table border="1">
1341     <tr><td>Conditions example</td><td>Comparison method</td><td>Meaning</td><td></td></tr>
1342     <tr><td>envp["PATH"]="/"</td><td><a href="#string_comparison">String</a></td><td>Environment variable PATH is defined and its value is "/"</td></tr>
1343     <tr><td>envp["PATH"]!="/"</td><td><a href="#string_comparison">String</a></td><td>Either<br>&nbsp;&nbsp;&nbsp;&nbsp;Environment variable PATH is not defined<br>or<br>&nbsp;&nbsp;&nbsp;&nbsp;Environment variable PATH is defined but its value is not "/"</td></tr>
1344     <tr><td>envp["PATH"]=@ENV_PATH_VALUES</td><td><a href="#string_comparison">String</a></td><td>Environment variable PATH is defined and its value matches one of strings in string_group ENVP_PATH_VALUES group</td></tr>
1345     <tr><td>envp["PATH"]!=@ENV_PATH_VALUES</td><td><a href="#string_comparison">String</a></td><td>Either<br>&nbsp;&nbsp;&nbsp;&nbsp;Environment variable PATH is not defined<br>or<br>&nbsp;&nbsp;&nbsp;&nbsp;Environment variable PATH is defined but its value matches none of strings in string_group ENVP_PATH_VALUES group</td></tr>
1346     <tr><td>envp["PATH"]=NULL</td><td>None</td><td>Environment variable PATH is not defined</td></tr>
1347     <tr><td>envp["PATH"]!=NULL</td><td>None</td><td>Environment variable PATH is not defined</td></tr>
1348     </table>
1349    
1350     <p>Applications can pass a string data up to 32 * PAGE_SIZE bytes to each envp[]. But due to difficulty of allocating contiguous memory in the kernel, only up to 4085 bytes can be checked using variable "envp["$name"]". If you want to check strictly, please consider using handler= argument of "allow " lines in "acl execute" block.</p>
1351    
1352     <h3><a name="dac_permission_comparison">2.7. Conditional expressions which handle file's DAC permissions</a></h3>
1353    
1354     <p>When checking permissions for file related operations, it is possible to check its DAC permissions if the file already exists as of permission check.
1355     Below table assumes that the variable name for referencing the requested pathname is "path".</p>
1356    
1357     <p>Value of DAC permissions can be referenced using variable "path.perm", and its value is between 0 and 07777. Although it is possible to do normal <a href="#integer_comparison">numeric comparison</a>, below constants are provided in order to make it easier to compare whether specific bit is set or not.</p>
1358    
1359     <table border="1">
1360     <tr><td>Constant</td><td>Value ranges that match </td></tr>
1361     <tr><td>setuid</td><td>Values where bitwise AND between path.perm and 04000 are 04000. (i.e. 04000-07777)</td></tr>
1362     <tr><td>setgid</td><td>Values where bitwise AND between path.perm and 02000 are 02000. (i.e. 02000-03777 06000-07777)</td></tr>
1363     <tr><td>sticky</td><td>Values where bitwise AND between path.perm and 01000 are 01000. (i.e. 01000-01777 03000-03777 05000-05777 07000-07777)</td></tr>
1364     <tr><td>owner_read</td><td>Values where bitwise AND between path.perm and 00400 are 00400. (e.g. 00400-00777 01400-01777 02400-02777)</td></tr>
1365     <tr><td>owner_write</td><td>Values where bitwise AND between path.perm and 00200 are 00200. (e.g. 00200-00377 00600-00777 01200-01377)</td></tr>
1366     <tr><td>owner_execute</td><td>Values where bitwise AND between path.perm and 00100 are 00100. (e.g. 00100-00177 00300-00377 00500-00577)</td></tr>
1367     <tr><td>group_read</td><td>Values where bitwise AND between path.perm and 00040 are 00040. (e.g. 00040-00077 00140-00177 00240-00277)</td></tr>
1368     <tr><td>group_write</td><td>Values where bitwise AND between path.perm and 00020 are 00020. (e.g. 00020-00037 00060-00077 00120-00137)</td></tr>
1369     <tr><td>group_execute</td><td>Values where bitwise AND between path.perm and 00010 are 00010. (e.g. 00010-00017 00030-00037 00050-00057)</td></tr>
1370     <tr><td>others_read</td><td>Values where bitwise AND between path.perm and 00004 are 00004. (e.g. 00004-00007 00014-00017 00024-00027)</td></tr>
1371     <tr><td>others_write</td><td>Values where bitwise AND between path.perm and 00002 are 00002. (e.g. 00002-00003 00006-00007 00012-00013)</td></tr>
1372     <tr><td>others_execute</td><td>Values where bitwise AND between path.perm and 00001 are 00001. (e.g. 00001 00003 00005 00007 00011 00013)</td></tr>
1373     </table>
1374    
1375     <p>Below are some examples that use constants.</p>
1376    
1377     <table border="1">
1378     <tr><td>Conditions example</td><td>Permissions of file referenced by variable "path"</td><td>Comparison result</td></tr>
1379     <tr><td>path.perm=setuid</td><td>04755</td><td>Matches</td></tr>
1380     <tr><td>path.perm!=setuid</td><td>04755</td><td>Does not match</td></tr>
1381     <tr><td>path.perm=setuid path.perm=setgid path.perm=sticky</td><td>0755</td><td>Does not match</td></tr>
1382     <tr><td>path.perm!=setuid path.perm!=setgid path.perm!=sticky</td><td>0755</td><td>Matches</td></tr>
1383     </table>
1384    
1385     <h3><a name="file_type_comparison">2.8. Conditional expressions which handle file's type</a></h3>
1386    
1387     <p>When checking permissions for file related operations, it is possible to check its type if the file already exists as of permission check.
1388     Below table assumes that the variable name for referencing the requested pathname is "path".</p>
1389    
1390     <p>Type of a file can be referenced using variable "path.type", and its value takes one of "file", "directory", "socket", "fifo", "block", "char", "symlink".</p>
1391    
1392     <table border="1">
1393     <tr><td>Possible conditions</td><td>Type of file referenced by variable "path"</td><td>Comparison result</td></tr>
1394     <tr><td>path.type=file</td><td>Regular file</td><td>Matches</td></tr>
1395     <tr><td>path.type!=file</td><td>Other than regular file</td><td>Matches</td></tr>
1396     <tr><td>path.type=directory</td><td>Directory</td><td>Matches</td></tr>
1397     <tr><td>path.type!=directory</td><td>Other than directory</td><td>Matches</td></tr>
1398     <tr><td>path.type=socket</td><td>Unix domain socket</td><td>Matches</td></tr>
1399     <tr><td>path.type!=socket</td><td>Other than Unix domain socket</td><td>Matches</td></tr>
1400     <tr><td>path.type=fifo</td><td>FIFO</td><td>Matches</td></tr>
1401     <tr><td>path.type!=fifo</td><td>Other than FIFO</td><td>Matches</td></tr>
1402     <tr><td>path.type=block</td><td>Block device file</td><td>Matches</td></tr>
1403     <tr><td>path.type!=block</td><td>Other than block device file</td><td>Matches</td></tr>
1404     <tr><td>path.type=char</td><td>Character device file</td><td>Matches</td></tr>
1405     <tr><td>path.type!=char</td><td>Other than character device file</td><td>Matches</td></tr>
1406     <tr><td>path.type=symlink</td><td>Symbolic link</td><td>Matches</td></tr>
1407     <tr><td>path.type!=symlink</td><td>Other than symbolic link</td><td>Matches</td></tr>
1408     </table>
1409    
1410     <h3><a name="file_attributes_comparison">2.9. Conditional expressions which handle file's attributes</a></h3>
1411    
1412     <p>When checking permissions for file related operations, it is possible to check its attributes if the file already exists as of permission check.
1413     Below table assumes that the variable name for referencing the requested pathname is "path".</p>
1414    
1415     <table border="1">
1416     <tr><td>Variable's name</td><td>Comparison method</td><td>Meaning</td></tr>
1417     <tr><td>path.uid</td><td><a href="#integer_comparison">Numeric</a></td><td>Owner ID</td></tr>
1418     <tr><td>path.gid</td><td><a href="#integer_comparison">Numeric</a></td><td>Group ID</td></tr>
1419     <tr><td>path.ino</td><td><a href="#integer_comparison">Numeric</a></td><td>i-node number on the filesystem</td></tr>
1420     <tr><td>path.major</td><td><a href="#integer_comparison">Numeric</a></td><td>Device major number on the filesystem</td></tr>
1421     <tr><td>path.minor</td><td><a href="#integer_comparison">Numeric</a></td><td>Device minor number on the filesystem</td></tr>
1422     <tr><td>path.perm</td><td><a href="#dac_permission_comparison">Permission</a></td><td>DAC permissions</td></tr>
1423     <tr><td>path.type</td><td><a href="#file_type_comparison">File's type</a></td><td>Type of the file</td></tr>
1424     <tr><td>path.dev_major</td><td><a href="#integer_comparison">Numeric</a></td><td>Device major number of the file if path.type=block or path.type=char</td></tr>
1425     <tr><td>path.dev_minor</td><td><a href="#integer_comparison">Numeric</a></td><td>Device minor number of the file if path.type=block or path.type=char</td></tr>
1426     <tr><td>path.fsmagic</td><td><a href="#integer_comparison">Numeric</a></td><td>Magic number of filesystem</td></tr>
1427     </table>
1428    
1429     <p>When checking permissions for file related operations, it is possible to also check its parent directory's attributes.
1430     Below table assumes that the variable name for referencing the requested pathname is "path".</p>
1431    
1432     <table border="1">
1433     <tr><td>Variable's name</td><td>Comparison method</td><td>Meaning</td></tr>
1434     <tr><td>path.parent.uid</td><td><a href="#integer_comparison">Numeric</a></td><td>Owner ID</td></tr>
1435     <tr><td>path.parent.gid</td><td><a href="#integer_comparison">Numeric</a></td><td>Group ID</td></tr>
1436     <tr><td>path.parent.ino</td><td><a href="#integer_comparison">Numeric</a></td><td>i-node number on the filesystem</td></tr>
1437     <tr><td>path.parent.major</td><td><a href="#integer_comparison">Numeric</a></td><td>Device major number on the filesystem</td></tr>
1438     <tr><td>path.parent.minor</td><td><a href="#integer_comparison">Numeric</a></td><td>Device minor number on the filesystem</td></tr>
1439     <tr><td>path.parent.perm</td><td><a href="#dac_permission_comparison">Permission</a></td><td>DAC permissions</td></tr>
1440     <tr><td>path.parent.fsmagic</td><td><a href="#integer_comparison">Numeric</a></td><td>Magic number of filesystem</td></tr>
1441     </table>
1442    
1443     <p>It does not make sense to use path.parent.type path.parent.dev_major path.parent.dev_minor because path.parent is always a directory.</p>
1444    
1445     <p>If path refers a mount point (root of directory entry tree within that partition), path.parent refers the same path rather than referring mount point's parent.</p>
1446    
1447     <h2><a name="syntax_list">3. List of syntaxes sorted by operations</a></h2>
1448    
1449     <table border="1">
1450     <tr><td>Operation</td><td>Meaning</td><td>Available variables</td><td>Content of variable</td><td>Related man pages</td></tr>
1451    
1452     <tr><td rowspan="11">execute</td><td rowspan="11">Execute a program</td><td><a href="#string_comparison">path</a></td><td>Requested program's pathname</td><td rowspan="11">execve(2)</td></tr>
1453     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1454     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</tr>
1455     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1456     <tr><td><a href="#string_comparison">exec</a></td><td>Requested program's pathname, but maybe a symbolic link</td></tr>
1457     <tr><td><a href="#integer_comparison">argc</a></td><td>Number of command line arguments passed to this request</td></tr>
1458     <tr><td><a href="#integer_comparison">envc</a></td><td>Number of environment variables arguments</td></tr>
1459     <tr><td><a href="#argv_comparison">argv[$index]</a></td><td>$index'th (0 &lt;= $index &lt; argc) value of command line arguments</td></tr>
1460     <tr><td><a href="#envp_comparison">envp["$name"]</a></td><td>Value of environment variable named $name</td></tr>
1461     <tr><td>handler</td><td>Pathname of a wrapper program for preprocessing (available to only "allow" lines)</td></tr>
1462     <tr><td>transition</td><td>New domainname to transit to if operation was successful (available to only "allow" lines)</td></tr>
1463    
1464     <tr><td rowspan="4">read</td><td rowspan="4">Open a pathname for reading</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">open(2)</td></tr>
1465     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1466     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1467     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1468    
1469     <tr><td rowspan="4">write</td><td rowspan="4">Open a pathname for writing</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">open(2)</td></tr>
1470     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1471     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1472     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1473    
1474     <tr><td rowspan="4">append</td><td rowspan="4">Open a pathname for appending</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">open(2)</td></tr>
1475     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1476     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1477     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1478    
1479     <tr><td rowspan="4">create</td><td rowspan="4">Create a regular file</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">open(2), mknod(2)</td></tr>
1480     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1481     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1482     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1483    
1484     <tr><td rowspan="4">unlink</td><td rowspan="4">Delete a non directory pathname</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">unlink(2)</td></tr>
1485     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1486     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1487     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1488    
1489     <tr><td rowspan="4">getattr</td><td rowspan="4">Get attributes of a pathname</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">stat(2)</td></tr>
1490     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1491     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1492     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1493    
1494     <tr><td rowspan="4">mkdir</td><td rowspan="4">Create a directory</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">mkdir(2)</td></tr>
1495     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1496     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1497     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1498    
1499     <tr><td rowspan="4">rmdir</td><td rowspan="4">Delete a directory pathname</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">rmdir(2)</td></tr>
1500     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1501     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1502     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1503    
1504     <tr><td rowspan="4">mkfifo</td><td rowspan="4">Create a FIFO</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">mknod(2)</td></tr>
1505     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1506     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1507     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1508    
1509     <tr><td rowspan="4">mksock</td><td rowspan="4">Create a Unix domain socket</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">mknod(2)</td></tr>
1510     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1511     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1512     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1513    
1514     <tr><td rowspan="4">truncate</td><td rowspan="4">Truncate a regular file</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">open(2), truncate(2)</td></tr>
1515     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1516     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1517     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1518    
1519     <tr><td rowspan="4">symlink</td><td rowspan="4">Create a symbolic link</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">symlink(2)</td></tr>
1520     <tr><td><a href="#string_comparison">target</a></td><td>Symbolic link's content</td></tr>
1521     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1522     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1523    
1524     <tr><td rowspan="6">mkblock</td><td rowspan="6">Create a block device file</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="6">mknod(2)</td></tr>
1525     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1526     <tr><td><a href="#integer_comparison">dev_major</a></td><td>Major device number of a new object referenced by variable "path"</td></tr>
1527     <tr><td><a href="#integer_comparison">dev_minor</a></td><td>Minor device number of a new object referenced by variable "path"</td></tr>
1528     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1529     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1530    
1531     <tr><td rowspan="6">mkchar</td><td rowspan="6">Create a character device file</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="6">mknod(2)</td></tr>
1532     <tr><td><a href="#integer_comparison">perm</a></td><td>DAC permissions of a new object referenced by variable "path"</td></tr>
1533     <tr><td><a href="#integer_comparison">dev_major</a></td><td>Major device number of a new object referenced by variable "path"</td></tr>
1534     <tr><td><a href="#integer_comparison">dev_minor</a></td><td>Minor device number of a new object referenced by variable "path"</td></tr>
1535     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1536     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1537    
1538     <tr><td rowspan="6">link</td><td rowspan="6">Create a link</td><td><a href="#string_comparison">old_path</a></td><td>Link source's pathname</td><td rowspan="6">link(2)</td></tr>
1539     <tr><td><a href="#string_comparison">new_path</a></td><td>Link target's pathname</td></tr>
1540     <tr><td><a href="#file_attributes_comparison">old_path.$attribute</a></td><td>Attributes of an object referenced by variable "old_path"</td></tr>
1541     <tr><td><a href="#file_attributes_comparison">old_path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1542     <tr><td><a href="#file_attributes_comparison">new_path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1543     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1544    
1545     <tr><td rowspan="6">rename</td><td rowspan="6">Rename a pathname</td><td><a href="#string_comparison">old_path</a></td><td>Old pathname</td><td rowspan="6">rename(2)</td></tr>
1546     <tr><td><a href="#string_comparison">new_path</a></td><td>New pathname</td></tr>
1547     <tr><td><a href="#file_attributes_comparison">old_path.$attribute</a></td><td>Attributes of an object referenced by variable "old_path"</td></tr>
1548     <tr><td><a href="#file_attributes_comparison">old_path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1549     <tr><td><a href="#file_attributes_comparison">new_path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1550     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1551    
1552     <tr><td rowspan="5">chmod</td><td rowspan="5">Change DAC's permission</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="5">chmod(2)</td></tr>
1553     <tr><td><a href="#integer_comparison">perm</a></td><td>New DAC permissions of an object referenced by variable "path"</td></tr>
1554     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1555     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1556     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1557    
1558     <tr><td rowspan="5">chown</td><td rowspan="5">Change DAC's owner ID</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="5">chown(2)</td></tr>
1559     <tr><td><a href="#integer_comparison">uid</a></td><td>New DAC owner ID of an object referenced by variable "path"</td></tr>
1560     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1561     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1562     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1563    
1564     <tr><td rowspan="5">chgrp</td><td rowspan="5">Change DAC's group ID</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="5">chown(2)</td></tr>
1565     <tr><td><a href="#integer_comparison">gid</a></td><td>New DAC group ID of an object referenced by variable "path"</td></tr>
1566     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1567     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1568     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1569    
1570     <tr><td rowspan="5">ioctl</td><td rowspan="5">Use ioctl request</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="5">ioctl(2)</td></tr>
1571     <tr><td><a href="#integer_comparison">cmd</a></td><td>Command number for ioctl request</td></tr>
1572     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1573     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1574     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1575    
1576     <tr><td rowspan="4">chroot</td><td rowspan="4">Change root directory</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="4">chroot(2)</td></tr>
1577     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1578     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1579     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1580    
1581     <tr><td rowspan="9">mount</td><td rowspan="9">Mount a filesystem</td><td><a href="#string_comparison">source</a></td><td>Source name if filesystem name is one of "--bind", "--move" or a filesystem that requires device file. Unavailable otherwise.</td><td rowspan="9">mount(2)</td></tr>
1582     <tr><td><a href="#string_comparison">target</a></td><td>Mount point or target name</td></tr>
1583 kumaneko 15 <tr><td><a href="#string_comparison">fstype</a></td><td>Filesystem name, determined by below order.<br>
1584 kumaneko 10 <ol>
1585     <li>"--remount" if mount flags contains MS_REMOUNT flag</li>
1586     <li>"--bind" if mount flags contains MS_BIND flag</li>
1587     <li>"--make-shared" if mount flags contains MS_SHARED flag</li>
1588     <li>"--make-private" if mount flags contains MS_PRIVATE flag</li>
1589     <li>"--make-slave" if mount flags contains MS_SLAVE flag</li>
1590     <li>"--make-unbindable" if mount flags contains MS_UNBINDABLE flag</li>
1591     <li>"--move" if mount flags contains MS_MOVE flag</li>
1592     <li>name of filesystem</li>
1593     </ol>
1594     </td></tr>
1595     <tr><td><a href="#integer_comparison">flags</a></td><td>Mount flags</td></tr>
1596     <tr><td><a href="#string_comparison">data</a></td><td>Mount options not in mount flags argument (e.g. "errors=remount-ro"). This variable is not available to filesystems that require binary mount options (e.g."nfs", "coda", "ncpfs"). Also, this variable is available only if filesystem type is either "--remount" or name of filesystem.</td></tr>
1597     <tr><td><a href="#file_attributes_comparison">source.$attribute</a></td><td>Attributes of an object referenced by variable "source" when variable "source" references a valid pathname</td></tr>
1598     <tr><td><a href="#file_attributes_comparison">source.parent.$attribute</a></td><td>Attributes of parent directory of an object referenced by variable "source" when variable "source" references a valid pathname</td></tr>
1599     <tr><td><a href="#file_attributes_comparison">target.$attribute</a></td><td>Attributes of an object referenced by variable "target"</td></tr>
1600     <tr><td><a href="#file_attributes_comparison">target.parent.$attribute</a></td><td>Attributes of parent directory of an object referenced by variable "target"</td></tr>
1601     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1602    
1603     <tr><td rowspan="5">unmount</td><td rowspan="5">Unmount a filesystem</td><td><a href="#string_comparison">path</a></td><td>Requested pathname</td><td rowspan="5">umount(2)</td></tr>
1604     <tr><td><a href="#integer_comparison">flags</a></td><td>Unmount flags</td></tr>
1605     <tr><td><a href="#file_attributes_comparison">path.$attribute</a></td><td>Attributes of an object referenced by variable "path"</td></tr>
1606     <tr><td><a href="#file_attributes_comparison">path.parent.$attribute</a></td><td>Parent directory's attributes</td></tr>
1607     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1608    
1609     <tr><td rowspan="7">pivot_root</td><td rowspan="7">Exchange root directory</td><td><a href="#string_comparison">new_root</a></td><td>New root directory</td><td rowspan="7">pivot_root(2)</td></tr>
1610     <tr><td><a href="#string_comparison">put_old</a></td><td>Location to place old root directory</td></tr>
1611     <tr><td><a href="#file_attributes_comparison">new_root.$attribute</a></td><td>Attributes of an object referenced by variable "new_root"</td></tr>
1612     <tr><td><a href="#file_attributes_comparison">new_root.parent.$attribute</a></td><td>Attributes of parent directory of an object referenced by variable "new_root"</td></tr>
1613     <tr><td><a href="#file_attributes_comparison">put_old.$attribute</a></td><td>Attributes of an object referenced by variable "put_old"</td></tr>
1614     <tr><td><a href="#file_attributes_comparison">put_old.parent.$attribute</a></td><td>Attributes of parent directory of an object referenced by variable "put_old"</td></tr>
1615     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1616    
1617     <tr><td rowspan="3">inet_stream_bind</td><td rowspan="3">Binding PF_INET/PF_INET6+SOCK_STREAM socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">bind(2), ip(7), ipv6(7)</td></tr>
1618     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1619     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1620    
1621     <tr><td rowspan="3">inet_stream_listen</td><td rowspan="3">Listening PF_INET/PF_INET6+SOCK_STREAM socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">listen(2), ip(7), ipv6(7)</td></tr>
1622     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1623     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1624    
1625     <tr><td rowspan="3">inet_stream_connect</td><td rowspan="3">Connecting PF_INET/PF_INET6+SOCK_STREAM socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">connect(2), ip(7), ipv6(7)</td></tr>
1626     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1627     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1628    
1629     <tr><td rowspan="3">inet_stream_accept</td><td rowspan="3">Accepting PF_INET/PF_INET6+SOCK_STREAM socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">accept(2), ip(7), ipv6(7)</td></tr>
1630     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1631     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1632    
1633     <tr><td rowspan="3">inet_dgram_bind</td><td rowspan="3">Binding PF_INET/PF_INET6+SOCK_DGRAM socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">bind(2), ip(7), ipv6(7)</td></tr>
1634     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1635     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1636    
1637     <tr><td rowspan="3">inet_dgram_send</td><td rowspan="3">Sending AF_INET/AF_INET6 datagrams</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">sendmsg(2), ip(7), ipv6(7)</td></tr>
1638     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1639     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1640    
1641     <tr><td rowspan="3">inet_dgram_recv</td><td rowspan="3">Receiving AF_INET/AF_INET6 datagrams</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">recvmsg(2), ip(7), ipv6(7)</td></tr>
1642     <tr><td><a href="#integer_comparison">port</a></td><td>Port number</td></tr>
1643     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1644    
1645     <tr><td rowspan="3">inet_raw_bind</td><td rowspan="3">Binding PF_INET/PF_INET6+SOCK_RAW socket</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">bind(2), raw(7)</td></tr>
1646     <tr><td><a href="#integer_comparison">proto</a></td><td>Protocol number</td></tr>
1647     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1648    
1649     <tr><td rowspan="3">inet_raw_send</td><td rowspan="3">Sending AF_INET/AF_INET6 packets</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">sendmsg(2), raw(7)</td></tr>
1650     <tr><td><a href="#integer_comparison">proto</a></td><td>Protocol number</td></tr>
1651     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1652    
1653     <tr><td rowspan="3">inet_raw_recv</td><td rowspan="3">Receiving AF_INET/AF_INET6 packets</td><td><a href="#ipaddr_comparison">ip</a></td><td>IPv4 or IPv6 address</td><td rowspan="3">recvmsg(2), raw(7)</td></tr>
1654     <tr><td><a href="#integer_comparison">proto</a></td><td>Protocol number</td></tr>
1655     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1656    
1657     <tr><td rowspan="2">unix_stream_bind</td><td rowspan="2">Binding PF_UNIX+SOCK_STREAM socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">bind(2), unix(7)</td></tr>
1658     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1659    
1660     <tr><td rowspan="2">unix_stream_listen</td><td rowspan="2">Listening PF_UNIX+SOCK_STREAM socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">listen(2), unix(7)</td></tr>
1661     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1662    
1663     <tr><td rowspan="2">unix_stream_connect</td><td rowspan="2">Connecting PF_UNIX+SOCK_STREAM socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">connect(2), unix(7)</td></tr>
1664     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1665    
1666     <tr><td rowspan="2">unix_stream_accept</td><td rowspan="2">Accepting PF_UNIX+SOCK_STREAM socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">accept(2), unix(7)</td></tr>
1667     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1668    
1669     <tr><td rowspan="2">unix_dgram_bind</td><td rowspan="2">Binding PF_UNIX+SOCK_DGRAM socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">bind(2), unix(7)</td></tr>
1670     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1671    
1672     <tr><td rowspan="2">unix_dgram_send</td><td rowspan="2">Sending AF_UNIX datagrams</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">sendmsg(2), unix(7)</td></tr>
1673     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1674    
1675     <tr><td rowspan="2">unix_dgram_recv</td><td rowspan="2">Receiving AF_UNIX datagrams</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">recvmsg(2), unix(7)</td></tr>
1676     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1677    
1678     <tr><td rowspan="2">unix_seqpacket_bind</td><td rowspan="2">Binding PF_UNIX+SOCK_SEQPACKET socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">bind(2), unix(7)</td></tr>
1679     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1680    
1681     <tr><td rowspan="2">unix_seqpacket_listen</td><td rowspan="2">Listening PF_UNIX+SOCK_SEQPACKET socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">listen(2), unix(7)</td></tr>
1682     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1683    
1684     <tr><td rowspan="2">unix_seqpacket_connect</td><td rowspan="2">Connecting PF_UNIX+SOCK_SEQPACKET socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">connect(2), unix(7)</td></tr>
1685     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1686    
1687     <tr><td rowspan="2">unix_seqpacket_accept</td><td rowspan="2">Accepting PF_UNIX+SOCK_SEQPACKET socket</td><td><a href="#string_comparison">addr</a></td><td>Unix domain socket address</td><td rowspan="2">accept(2), unix(7)</td></tr>
1688     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1689    
1690     <tr><td rowspan="3">ptrace</td><td rowspan="3">Call ptrace() system call</td><td><a href="#integer_comparison">cmd</a></td><td>Command number</td><td rowspan="3">ptrace(2)</td></tr>
1691     <tr><td><a href="#string_comparison">domain</a></td><td>Target process's domainname</td></tr>
1692     <tr><td><a href="#task_attributes_comparison">task.$attribute</a></td><td>Current thread's attributes</td></tr>
1693    
1694     <tr><td rowspan="2">signal</td><td rowspan="2">Send signals</td><td><a href="#integer_comparison">sig</a></td><td