diff --git a/parser/apparmor.d.pod b/parser/apparmor.d.pod index b4cd05a49..1c1234d33 100644 --- a/parser/apparmor.d.pod +++ b/parser/apparmor.d.pod @@ -50,24 +50,20 @@ B = '#' I B = any characters -B = [ I ... ] [ I ... ] I [ 'flags=(complain)' ]'{' [ ( I | I | I | I | 'capability ' I ) ... ] '}' +B = [ I ... ] [ I ... ] ( '"' I '"' | I ) [ 'flags=(complain)' ]'{' [ ( I | I | I | I | 'capability ' I ) ... ] '}' B = [ I ... ] I '{' [ ( I | I | I ) ... ] '}' B = (lowercase capability name without 'CAP_' prefix; see capabilities(7)) -B = (non-whitespace characters except for '^', must start with '/') +B = (non-whitespace characters except for '^', must start with '/'. Embedded spaces or tabs must be quoted.) B = '^' (non-whitespace characters; see change_hat(2) for a description of how this "hat" is used.) -B = ( I | I ) ',' +B = ( '"' I '"' | I ) I ',' -B = ( I | I ) I - -B = (non-whitespace characters except for B, must start with '/'. May include I.) - -B = (non-whitespace characters, must start with '/', B have special meanings; see below. May include I.) +B = (must start with '/' (after variable expansion), B have special meanings; see below. May include I. Rules with embedded spaces or tabs must be quoted. Rules must end with '/' to apply to directories.) B = ( 'r' | 'w' | 'l' | 'ix' | 'ux' | 'Ux' | 'px' | 'Px' | 'm' ) [ I ... ] (not all combinations are allowed; see below.) @@ -86,8 +82,9 @@ of subprofiles ("hats") in a profile, limited only by kernel memory. Subprofile names are limited to 974 characters. Not all profiles benefit from subprofiles --- applications must either be written or modified to use change_hat(2) -to take advantage of subprofiles. (An Apache module, mod_apparmor(5) -has been provided to use change_hat(2).) +to take advantage of subprofiles. Several change_hat(2)-aware +applications exist, including an Apache module, mod_apparmor(5); a PAM +module, pam_apparmor; and a Tomcat valve, tomcat_apparmor. =head2 Access Modes @@ -122,16 +119,14 @@ modes: =item B -Allows the program to have read access to the file. Read access is -required for shell scripts and other interpreted content, and determines -if an executing process can core dump or be attached to with ptrace(2). -(ptrace(2) is used by utilities such as strace(1), ltrace(1), and -gdb(1).) +Allows the program to have read access to the file or directory listing. Read access is +required for shell scripts and other interpreted content. =item B -Allows the program to have write access to the file. Files must have -this permission if they are to be unlinked (removed.) +Allows the program to have write access to the file. Files and directories must have +this permission if they are to be unlinked (removed.) Write mode is not +required on a directory to rename or create files within the directory. =item B @@ -218,9 +213,10 @@ B, given to ld.so(8). =item B Allows the program to be able to create a link with this name. When a -link is created, the file that is being linked to B have the same -access permissions as the link being created (with the exception that -the destination does not have to have link access.) +link is created, the new link B have a subset of permissions as +the original file (with the exception that +the destination does not have to have link access.) If there is an 'x' rule +on the new link, it must match the original file exactly. =back @@ -293,6 +289,31 @@ will expand to one rule to match ab, one rule to match cd =back +When AppArmor looks up a directory the pathname being looked up will +end with a slash (e.g., F); otherwise it will not end with a +slash. Only rules that match a trailing slash will match directories. Some +examples, none matching the F directory itself, are: + +=over 4 + +=item B + +Files directly in F. + +=item B + +Directories directly in F. + +=item B + +Files and directories anywhere underneath F. + +=item B + +Directories anywhere underneath F. + +=back + =head2 #include mechanism AppArmor provides an easy abstraction mechanism to group common file @@ -421,7 +442,7 @@ An example AppArmor profile: /etc/ld.so.cache r, /etc/foo.conf r, /etc/foo/* r, - /lib/ld-*.so* x, + /lib/ld-*.so* rmix, /lib/lib*.so* r, /proc/[0-9]** r, /usr/lib/** r, @@ -431,8 +452,8 @@ An example AppArmor profile: # a comment about foo's subprofile, bar. ^bar { - /lib/ld-*.so* x, - /usr/bin/bar ix, + /lib/ld-*.so* rmix, + /usr/bin/bar rmix, /var/spool/* rwl, } }