mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 07:45:50 +00:00
Add testcases for 'owner link' rules
.. and document that the tools don't support them yet
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION link access test with audit deny and owner restriction
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
profile test {
|
||||
audit deny owner link subset /alpha/beta -> /tmp/**,
|
||||
/tmp/** r,
|
||||
}
|
||||
|
10
parser/tst/simple_tests/file/ok_link_owner.sd
Normal file
10
parser/tst/simple_tests/file/ok_link_owner.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION simple link access test with owner restriction
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
profile test {
|
||||
owner link subset /alpha/beta -> /tmp/**,
|
||||
/tmp/** r,
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ RE_FLAGS = '(\s+(flags\s*=\s*)?\((?P<flags>[^)]+)\))?'
|
||||
|
||||
RE_PROFILE_END = re.compile('^\s*\}' + RE_EOL)
|
||||
RE_PROFILE_CAP = re.compile(RE_AUDIT_DENY + 'capability(?P<capability>(\s+\S+)+)?' + RE_COMMA_EOL)
|
||||
# TODO: add support for 'owner' to RE_PROFILE_LINK
|
||||
RE_PROFILE_LINK = re.compile(RE_AUDIT_DENY + 'link\s+(((subset)|(<=))\s+)?([\"\@\/].*?"??)\s+->\s*([\"\@\/].*?"??)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_ALIAS = re.compile('^\s*alias\s+("??.+?"??)\s+->\s*("??.+?"??)' + RE_COMMA_EOL)
|
||||
RE_PROFILE_RLIMIT = re.compile('^\s*set\s+rlimit\s+(?P<rlimit>[a-z]+)\s*<=\s*(?P<value>[^ ]+(\s+[a-zA-Z]+)?)' + RE_COMMA_EOL)
|
||||
|
@@ -224,6 +224,10 @@ unknown_line = [
|
||||
'file/owner/ok_1.sd',
|
||||
'profile/entry_mods_audit_ok1.sd',
|
||||
|
||||
# link rules with owner conditional
|
||||
'file/ok_link_owner.sd',
|
||||
'file/ok_link_audit_deny_owner_subset.sd',
|
||||
|
||||
# namespace
|
||||
'profile/profile_ns_named_ok1.sd', # profile keyword?
|
||||
'profile/profile_ns_named_ok2.sd', # profile keyword?
|
||||
|
Reference in New Issue
Block a user