mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
![]() Add userland support for matching based on extended file attributes. This leverages DFA based matching already in the kernel: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8e51f908 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=73f488cd Matching is exposed via flags on the profile: /usr/bin/* xattrs=(user.foo=bar user.bar=foo) { # ... } xattr values are appended to the existing xmatch via a null transition. $ echo '/usr/bin/* xattrs=(user.foo=foo user.bar=bar) {}' | \ ./parser/apparmor_parser -QT -D expr-tree DFA: Expression Tree /usr/bin/[^\0000/]([^\0000/])*(\0000bar)?(\0000foo)?< 0x1> DFA: Expression Tree (\a|(\n|(\0002|\t)))< 0x4> Tested manually on a 4.19 kernel via QEMU+KVM. TODO: * ~~Add regression tests~~ (EDIT: done) * ~~EDIT: add support in the tools~~ (EDIT: done) Questions for reviewers: * ~~parser/libapparmor: regex construction probably needs cleaning up~~ (EDIT: done) * ~~parser/parser_regex.c: confused what xmatch length is for~~ (EDIT: done) /cc @mjg59 PR: https://gitlab.com/apparmor/apparmor/merge_requests/270 Signed-off-by: John Johansen <john.johansen@canonical.com> |
||
---|---|---|
.. | ||
apparmor | ||
easyprof | ||
po | ||
test | ||
vim | ||
aa-audit | ||
aa-audit.pod | ||
aa-autodep | ||
aa-autodep.pod | ||
aa-cleanprof | ||
aa-cleanprof.pod | ||
aa-complain | ||
aa-complain.pod | ||
aa-decode | ||
aa-decode.pod | ||
aa-disable | ||
aa-disable.pod | ||
aa-easyprof | ||
aa-easyprof.pod | ||
aa-enforce | ||
aa-enforce.pod | ||
aa-genprof | ||
aa-genprof.pod | ||
aa-logprof | ||
aa-logprof.pod | ||
aa-mergeprof | ||
aa-mergeprof.pod | ||
aa-notify | ||
aa-notify.pod | ||
aa-remove-unknown | ||
aa-remove-unknown.pod | ||
aa-sandbox | ||
aa-sandbox.pod | ||
aa-status | ||
aa-status.pod | ||
aa-unconfined | ||
aa-unconfined.pod | ||
check_po.pl | ||
logprof.conf | ||
logprof.conf.pod | ||
Makefile | ||
notify.conf | ||
python-tools-setup.py | ||
README.md | ||
severity.db |
Known Bugs: Will allow multiple letters in the () due to translation/unicode issues with regexing the key. User input will probably bug out in a different locale.