apparmor/parser/tst/simple_tests/file
John Johansen e3fca60d11 parser: add the ability to specify a priority prefix to rules
This enables adding a priority to a rules in policy, finishing out the
priority work done to plumb priority support through the internals in
the previous patch.

Rules have a default priority of 0. The priority prefix can be added
before the other currently support rule prefixes, ie.

  [priority prefix][audit qualifier][rule mode][owner]

If present a numerical priority can be assigned to the rule, where the
greater the number the higher the priority. Eg.

    priority=1 audit file r /etc/passwd,

    priority=-1 deny file w /etc/**,

Rule priority allows the rule with the highest priority to completely
override lower priority rules where they overlap. Within a given
priority level rules will accumulate in standard apparmor fashion.

    Eg. given
        priority=1 w   /*c,
        priority=0 r   /a*,
        priority=-1 k  /*b*,

    /abc, /bc, /ac   .. will have permissions of w
    /ab, /abb, /aaa, .. will have permissions of r
    /b, /bcb, /bab,  .. will have permissions of k

User specified rule priorities are currently capped at the arbitrary
values of 1000, and -1000.

Notes:
* not all rule types support the priority prefix. Rukes like
  - network
  - capability
  - rlimits need to be reworked
  need to be reworked to properly preserve the policy rule structure.
* this patch does not support priority on rule blocks
* this patch does not support using a variable in the priority value.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2024-08-14 17:15:24 -07:00
..
allow treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
file treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
owner parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
priority parser: add the ability to specify a priority prefix to rules 2024-08-14 17:15:24 -07:00
bad_append_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_append_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
bad_bare_file_outside.sd Add tests for various rules outside of a profile 2015-10-19 21:13:48 +02:00
bad_comma_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_embedded_0_1.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_0_2.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_0_3.sd And the related patch to fix globbing for af_unix abstract names 2015-02-12 10:19:16 -08:00
bad_embedded_spaces_1.sd Parser: fix error when using regex profile names in IPC rules 2014-10-01 15:54:30 -07:00
bad_link_outside.sd Add tests for various rules outside of a profile 2015-10-19 21:13:48 +02:00
bad_lock_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
bad_re_brace_1.sd parser: add test case for empty character class regex 2013-12-03 15:55:54 -08:00
bad_re_brace_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
bad_re_brace_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
dos_line_endings.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
front_perms_ok_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_3.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_4.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_5.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_alternations_1.sd parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
ok_alternations_2.sd parser: add basic alternation tests, along with their file and owner 2013-12-03 16:34:17 -08:00
ok_alternations_3.sd parser: remove length restriction in convert_aaregex_to_pcre usage 2013-12-16 01:15:17 -08:00
ok_append_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_audit_deny_link.sd parser: fix compilation failure of deny link rules 2015-03-23 11:25:48 -07:00
ok_bare_1.sd parser: Move failing test to TODO 2016-02-11 16:01:13 -06:00
ok_carat_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_carat_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_comma_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_comma_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_deny_1.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_2.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_3.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_4.sd parser - add simple file deny rule tests 2013-10-11 22:33:05 -07:00
ok_deny_link.sd parser: fix compilation failure of deny link rules 2015-03-23 11:25:48 -07:00
ok_embedded_spaces_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_2.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_3.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_embedded_spaces_4.sd Parser: fix error when using regex profile names in IPC rules 2014-10-01 15:54:30 -07:00
ok_inv_char_class.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_link_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_link_audit_deny_owner_subset.sd Add testcases for 'owner link' rules 2019-04-22 13:36:33 +02:00
ok_link_owner.sd Add testcases for 'owner link' rules 2019-04-22 13:36:33 +02:00
ok_lock_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_mmap_1.sd Rearrange tests into subdirectories, so that it is easier to see what tests 2009-07-23 07:42:57 +00:00
ok_mmap_2.sd treewide: spelling/typo fixes in comments and docs 2020-12-01 12:47:11 -08:00
ok_octal_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_octal_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_other_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_other_2.sd add keyword 'other' vim syntax support, plus language parsing tests 2014-01-24 11:17:23 -08:00
ok_other_3.sd add keyword 'other' vim syntax support, plus language parsing tests 2014-01-24 11:17:23 -08:00
ok_quoted_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_2.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_3.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_4.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_quoted_5.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
ok_slashquote_1.sd parser: add additional language tests to get wider test coverage 2014-01-17 23:20:51 -08:00
stacking_ok_1.sd parser: Support stacking in exec and change_profile rules 2016-03-18 17:28:51 -05:00
var1_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_src_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var1_target_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_src_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_audit_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_deny_link.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_1.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_2.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00
var2_target_ok_link_3.sd Fix: variable expansion for link target 2015-06-06 01:28:12 -07:00