From 4ba7f860ac0a6393e0548c05727a07cb0ac015e4 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Tue, 24 Mar 2015 03:52:51 -0700 Subject: [PATCH] Add basic info about link rules to apparmor.d man page Signed-off-by: John Johansen Acked-by: Christian Boltz --- parser/apparmor.d.pod | 50 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/parser/apparmor.d.pod b/parser/apparmor.d.pod index 661d924e1..10808c990 100644 --- a/parser/apparmor.d.pod +++ b/parser/apparmor.d.pod @@ -54,7 +54,7 @@ B = '#' I B = any characters -B = [ I ... ] [ I ... ] ( '"' I '"' | I ) [ 'flags=(complain)' ]'{' [ ( I | I | I | I | I | I | I | I | I | I | I | I ) ... ] '}' +B = [ I ... ] [ I ... ] ( '"' I '"' | I ) [ 'flags=(complain)' ]'{' [ ( I | I | I | I | I | I | I | I | I | I | I | I | I ) ... ] '}' B = [ I ... ] ( I | 'profile ' I ) '{' [ ( I | I | I ) ... ] '}' @@ -165,7 +165,7 @@ B = ( 'send' | 'receive' | 'bind' | 'eavesdrop' ) (some accesses a B = B (see below for meanings) -B = [ I ] 'unix' [ I ] [ I ] [ I ] [ I ] +B = [ I ] 'unix' [ I ] [ I ] [ I ] [ I ] B = ( I | I ) @@ -205,6 +205,8 @@ B = ( 'ix' | 'ux' | 'Ux' | 'px' | 'Px' | 'cx' | 'Cx' | 'pix' | B = name (requires I specified) +B = I [ 'owner' ] 'link' [ 'subset' ] ( 'to' | '-E' ) ',' + B = '@{' I [ ( I | '_' ) ... ] '}' B = I ('=' | '+=') (space separated values) @@ -504,9 +506,9 @@ B, given to ld.so(8). Allows the program to be able to create a link with this name. When a 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. +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. =item B @@ -528,6 +530,44 @@ may be allowed, Eg. =back +=head2 Link rules + +Link rules allow specifying permission to form a hard link as a link +target pair. If the subset condition is specified then the permissions +to access the link file must be a subset of the profiles permissions +to access the target file. If there is an 'x' rule on the new link, it +must match the original file exactly. + +Eg. + + /file1 r, + /file2 rwk, + /link* rw, + link subset /link* -> /**, + + The link rule allows linking of /link to both /file1 or /file2 by + name however because the /link file has 'rw' permissions it is not + allowed to link to /file1 because that would grant an access path + to /file1 with more permissions than the 'r' permissions the profile + specifies. + + A link of /link to /file2 would be allowed because the 'rw' permissions + of /link are a subset of the 'rwk' permissions for /file1. + +The link rule is equivalent to specifying the 'l' link permission as +a leading permission with no other file access permissions. When this +is done the link rule options can be specified. + +The following link rule is equivalent to the 'l' permission file rule + link /foo -> bar, + l /foo -> /bar, + +File rules that specify the 'l' permission and don't specify the extend +link permissions map to link rules as follows. + /foo l, + l /foo, + link subset /foo -> /**, + =head2 Comments Comments start with # and may begin at any place within a line. The