2.
A hat named by the entire URI path
3.
A default server hat as specified by the
AADefaultHatName
keyword
4.
DEFAULT_URI
(if none of those exist, it goes back to the “parent” Apache hat)
5.2.2 Location and Directory Directives
Location and directory directives specify hat names in the program configuration file
so the program calls the hat regarding its security. For Apache, you can find documen-
tation about the location and directory directives at
http://httpd.apache.org/
docs-2.0/sections.html
.
The location directive example below specifies that, for a given location,
mod_apparmor
should use a specific hat:
<Location /foo/> AAHatName MY_HAT_NAME </Location>
This tries to use
MY_HAT_NAME
for any URI beginning with
/foo/
(
/foo/
,
/foo/
bar
,
/foo/cgi/path/blah_blah/blah
, etc.).
The directory directive works similarly to the location directive, except it refers to a
path in the file system as in the following example:
<Directory "/srv/www/www.immunix.com/docs">
# Note lack of trailing slash
AAHatName immunix.com
</Directory>
Example:
The program phpsysinfo is used to illustrate a location directive in the
following example. The tarball can be downloaded from
http://phpsysinfo
.sourceforge.com
.
1
After downloading the tarball, install it into
/srv/www/htdocs/sysinfo
.
2
Create
/etc/apache2/conf.d/sysinfo.conf
and add the following
text to it:
<Location "/sysinfo">
AAHatName sysinfo
</Location>
The following hat should then work for phpsyinfo:
84
Novell AppArmor Administration Guide