2014-09-12 17:25:14 +02:00
|
|
|
" generated from apparmor.vim.in by create-apparmor.vim.py
|
|
|
|
" do not edit this file - edit apparmor.vim.in or create-apparmor.vim.py instead
|
|
|
|
|
2011-01-10 16:38:12 +01:00
|
|
|
" ----------------------------------------------------------------------
|
|
|
|
" Copyright (c) 2005 Novell, Inc. All Rights Reserved.
|
2014-09-12 17:25:14 +02:00
|
|
|
" Copyright (c) 2006-2012 Christian Boltz. All Rights Reserved.
|
2012-06-18 09:29:01 +02:00
|
|
|
"
|
2011-01-10 16:38:12 +01:00
|
|
|
" This program is free software; you can redistribute it and/or
|
|
|
|
" modify it under the terms of version 2 of the GNU General Public
|
|
|
|
" License as published by the Free Software Foundation.
|
2012-06-18 09:29:01 +02:00
|
|
|
"
|
2011-01-10 16:38:12 +01:00
|
|
|
" This program is distributed in the hope that it will be useful,
|
|
|
|
" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
" GNU General Public License for more details.
|
2012-06-18 09:29:01 +02:00
|
|
|
"
|
2011-01-10 16:38:12 +01:00
|
|
|
" You should have received a copy of the GNU General Public License
|
|
|
|
" along with this program; if not, contact Novell, Inc.
|
2012-06-18 09:29:01 +02:00
|
|
|
"
|
|
|
|
" To contact Novell about this file by physical or electronic mail,
|
2011-01-10 16:38:12 +01:00
|
|
|
" you may find current contact information at www.novell.com.
|
|
|
|
"
|
|
|
|
" To contact Christian Boltz about this file by physical or electronic
|
|
|
|
" mail, you may find current contact information at www.cboltz.de/en/kontakt.
|
|
|
|
"
|
|
|
|
" If you want to report a bug via bugzilla.novell.com, please assign it
|
|
|
|
" to suse-beta[AT]cboltz.de (replace [AT] with @).
|
|
|
|
" ----------------------------------------------------------------------
|
|
|
|
"
|
2012-06-18 09:29:01 +02:00
|
|
|
" stick this file into ~/.vim/syntax/ and add these commands into your .vimrc
|
2011-01-10 16:38:12 +01:00
|
|
|
" to have vim automagically use this syntax file for these directories:
|
|
|
|
"
|
2014-09-12 17:25:14 +02:00
|
|
|
" autocmd BufNewFile,BufRead /etc/apparmor.d/* set syntax=apparmor
|
|
|
|
" autocmd BufNewFile,BufRead /usr/share/apparmor/extra-profiles/* set syntax=apparmor
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" profiles are case sensitive
|
|
|
|
syntax case match
|
|
|
|
|
|
|
|
" color setup...
|
|
|
|
|
|
|
|
" adjust colors according to the background
|
|
|
|
|
|
|
|
" switching colors depending on the background color doesn't work
|
|
|
|
" unfortunately, so we use colors that work with light and dark background.
|
|
|
|
" Patches welcome ;-)
|
|
|
|
|
|
|
|
"if &background == "light"
|
|
|
|
" light background
|
|
|
|
hi sdProfileName ctermfg=lightblue
|
|
|
|
hi sdHatName ctermfg=darkblue
|
|
|
|
hi sdExtHat ctermfg=darkblue
|
|
|
|
" hi sdComment2 ctermfg=darkblue
|
|
|
|
hi sdGlob ctermfg=darkmagenta
|
|
|
|
hi sdAlias ctermfg=darkmagenta
|
|
|
|
hi sdEntryWriteExec ctermfg=black ctermbg=yellow
|
|
|
|
hi sdEntryUX ctermfg=darkred cterm=underline
|
|
|
|
hi sdEntryUXe ctermfg=darkred
|
|
|
|
hi sdEntryIX ctermfg=darkcyan
|
|
|
|
hi sdEntryM ctermfg=darkcyan
|
|
|
|
hi sdEntryPX ctermfg=darkgreen cterm=underline
|
|
|
|
hi sdEntryPXe ctermfg=darkgreen
|
|
|
|
hi sdEntryW ctermfg=darkyellow
|
|
|
|
hi sdCap ctermfg=lightblue
|
|
|
|
hi sdSetCap ctermfg=black ctermbg=yellow
|
|
|
|
hi sdNetwork ctermfg=lightblue
|
|
|
|
hi sdNetworkDanger ctermfg=darkred
|
|
|
|
hi sdCapKey cterm=underline ctermfg=lightblue
|
|
|
|
hi sdCapDanger ctermfg=darkred
|
|
|
|
hi sdRLimit ctermfg=lightblue
|
|
|
|
hi def link sdEntryR Normal
|
|
|
|
hi def link sdEntryK Normal
|
|
|
|
hi def link sdFlags Normal
|
|
|
|
hi sdEntryChangeProfile ctermfg=darkgreen cterm=underline
|
2012-06-18 09:29:01 +02:00
|
|
|
"else
|
2011-01-10 16:38:12 +01:00
|
|
|
" dark background
|
|
|
|
" hi sdProfileName ctermfg=white
|
|
|
|
" hi sdHatName ctermfg=white
|
|
|
|
" hi sdGlob ctermfg=magenta
|
|
|
|
" hi sdEntryWriteExec ctermfg=black ctermbg=yellow
|
|
|
|
" hi sdEntryUX ctermfg=red cterm=underline
|
|
|
|
" hi sdEntryUXe ctermfg=red
|
|
|
|
" hi sdEntryIX ctermfg=cyan
|
|
|
|
" hi sdEntryM ctermfg=cyan
|
|
|
|
" hi sdEntryPX ctermfg=green cterm=underline
|
|
|
|
" hi sdEntryPXe ctermfg=green
|
|
|
|
" hi sdEntryW ctermfg=yellow
|
|
|
|
" hi sdCap ctermfg=lightblue
|
|
|
|
" hi sdCapKey cterm=underline ctermfg=lightblue
|
|
|
|
" hi def link sdEntryR Normal
|
|
|
|
" hi def link sdFlags Normal
|
|
|
|
" hi sdCapDanger ctermfg=red
|
|
|
|
"endif
|
|
|
|
|
|
|
|
hi def link sdInclude Include
|
|
|
|
high def link sdComment Comment
|
|
|
|
"high def link sdComment2 Comment
|
|
|
|
high def link sdFlagKey TODO
|
|
|
|
high def link sdError ErrorMsg
|
|
|
|
|
|
|
|
|
|
|
|
" always sync from the start. should be relatively quick since we don't have
|
|
|
|
" that many rules and profiles shouldn't be _extremely_ large...
|
|
|
|
syn sync fromstart
|
|
|
|
|
|
|
|
syn keyword sdFlagKey complain debug
|
|
|
|
|
|
|
|
" highlight invalid syntax
|
|
|
|
syn match sdError /{/ contained
|
|
|
|
syn match sdError /}/
|
|
|
|
syn match sdError /^.*$/ contains=sdComment "highlight all non-valid lines as error
|
|
|
|
" TODO: do not mark lines containing only whitespace as error
|
|
|
|
|
|
|
|
" TODO: the sdGlob pattern is not anchored with ^ and $, so it matches all lines matching ^@{...}.*
|
|
|
|
" This allows incorrect lines also and should be checked better.
|
|
|
|
" This also (accidently ;-) includes variable definitions (@{FOO}=/bar)
|
|
|
|
" TODO: make a separate pattern for variable definitions, then mark sdGlob as contained
|
2011-08-19 08:36:54 +02:00
|
|
|
syn match sdGlob /\v\?|\*|\{.*,.*\}|[[^\]]\+\]|\@\{[a-zA-Z][a-zA-Z0-9_]*\}/
|
2011-01-10 16:38:12 +01:00
|
|
|
|
2020-05-21 17:19:40 +02:00
|
|
|
syn match sdAlias /\v^\s*alias\s+(\/|\@\{\S*\})\S*\s+-\>\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" syn match sdComment /#.*/
|
|
|
|
|
|
|
|
syn cluster sdEntry contains=sdEntryWriteExec,sdEntryR,sdEntryW,sdEntryIX,sdEntryPX,sdEntryPXe,sdEntryUX,sdEntryUXe,sdEntryM,sdCap,sdSetCap,sdExtHat,sdRLimit,sdNetwork,sdNetworkDanger,sdEntryChangeProfile
|
|
|
|
|
|
|
|
|
|
|
|
" TODO: support audit and deny keywords for all rules (not only for files)
|
|
|
|
" TODO: higlight audit and deny keywords everywhere
|
|
|
|
|
|
|
|
" Capability line
|
|
|
|
|
|
|
|
" normal capabilities - really keep this list? syn match sdCap should be enough... (difference: sdCapKey words would loose underlining)
|
2020-11-03 11:08:09 +01:00
|
|
|
syn keyword sdCapKey audit_read block_suspend bpf checkpoint_restore chown dac_override dac_read_search fowner fsetid ipc_lock ipc_owner kill lease linux_immutable mknod net_admin net_bind_service net_broadcast net_raw perfmon setgid setpcap setuid syslog sys_boot sys_chroot sys_nice sys_pacct sys_ptrace sys_resource sys_time sys_tty_config wake_alarm
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" dangerous capabilities - highlighted separately
|
2020-03-16 08:13:25 +01:00
|
|
|
syn keyword sdCapDanger audit_control audit_write mac_override mac_admin setfcap sys_admin sys_module sys_rawio
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" full line. Keywords are from sdCapKey + sdCapDanger
|
2020-11-03 11:08:09 +01:00
|
|
|
syn match sdCap /\v^\s*(audit\s+)?(deny\s+|allow\s+)?capability\s+((audit_control|audit_read|audit_write|block_suspend|bpf|checkpoint_restore|chown|dac_override|dac_read_search|fowner|fsetid|ipc_lock|ipc_owner|kill|lease|linux_immutable|mac_admin|mac_override|mknod|net_admin|net_bind_service|net_broadcast|net_raw|perfmon|setfcap|setgid|setpcap|setuid|syslog|sys_admin|sys_boot|sys_chroot|sys_module|sys_nice|sys_pacct|sys_ptrace|sys_rawio|sys_resource|sys_time|sys_tty_config|wake_alarm)\s+)*(audit_control|audit_read|audit_write|block_suspend|bpf|checkpoint_restore|chown|dac_override|dac_read_search|fowner|fsetid|ipc_lock|ipc_owner|kill|lease|linux_immutable|mac_admin|mac_override|mknod|net_admin|net_bind_service|net_broadcast|net_raw|perfmon|setfcap|setgid|setpcap|setuid|syslog|sys_admin|sys_boot|sys_chroot|sys_module|sys_nice|sys_pacct|sys_ptrace|sys_rawio|sys_resource|sys_time|sys_tty_config|wake_alarm)\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdCapKey,sdCapDanger,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2012-06-18 09:29:01 +02:00
|
|
|
" all capabilities ('capability' without any keyword)
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdCapDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?capability\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" Network line
|
|
|
|
" Syntax: network domain (inet, ...) type (stream, ...) protocol (tcp, ...)
|
2011-02-01 00:50:47 +01:00
|
|
|
" TODO: 'owner' isn't supported, but will be (JJ, 2011-01-11)
|
2022-02-21 10:10:34 +01:00
|
|
|
syn match sdNetwork /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network(\s+(unspec|unix|inet|ax25|ipx|appletalk|netrom|bridge|atmpvc|x25|inet6|rose|netbeui|security|key|netlink|packet|ash|econet|atmsvc|rds|sna|irda|pppox|wanpipe|llc|ib|mpls|can|tipc|bluetooth|iucv|rxrpc|isdn|phonet|ieee802154|caif|alg|nfc|vsock|kcm|qipcrtr|smc|xdp|mctp))?(\s+(stream|dgram|seqpacket|rdm|packet))?(\s+tcp|\s+udp|\s+icmp)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2011-01-10 16:38:12 +01:00
|
|
|
" network rules containing 'raw'
|
2022-02-21 10:10:34 +01:00
|
|
|
syn match sdNetworkDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network(\s+(unspec|unix|inet|ax25|ipx|appletalk|netrom|bridge|atmpvc|x25|inet6|rose|netbeui|security|key|netlink|packet|ash|econet|atmsvc|rds|sna|irda|pppox|wanpipe|llc|ib|mpls|can|tipc|bluetooth|iucv|rxrpc|isdn|phonet|ieee802154|caif|alg|nfc|vsock|kcm|qipcrtr|smc|xdp|mctp))?(\s+(raw))(\s+tcp|\s+udp|\s+icmp)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2011-01-10 16:38:12 +01:00
|
|
|
" 'all networking' includes raw -> mark as dangerous
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdNetworkDanger /\v^\s*(audit\s+)?(deny\s+|allow\s+)?network\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
" Change Profile
|
2017-03-20 08:58:11 +01:00
|
|
|
syn match sdEntryChangeProfile /\v^\s*(audit\s+)?(deny\s+|allow\s+)?change_profile\s+(safe\s+[/@]\S+|unsafe\s+[/@]\S+|[/@]\S+)?\s*(-\>\s*\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
" bare change_profile rule
|
|
|
|
syn match sdEntryChangeProfile /\v^\s*(audit\s+)?(deny\s+|allow\s+)?change_profile\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" rlimit
|
2011-02-01 00:50:47 +01:00
|
|
|
" TODO: audit and deny support will be added (JJ, 2011-01-11)
|
2011-01-10 16:38:12 +01:00
|
|
|
"
|
|
|
|
"syn match sdRLimit /\v^\s*rlimit\s+()\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+(nofile|ofile|nproc|rtprio)\s+\<\=\s+[0-9]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2011-02-01 00:50:47 +01:00
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+(locks|sigpending)\s+\<\=\s+[0-9]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+(fsize|data|stack|core|rss|as|memlock|msgqueue)\s+\<\=\s+[0-9]+([KMG]B)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2011-02-01 00:50:47 +01:00
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+nice\s+\<\=\s+(-1?[0-9]|-20|1?[0-9])\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+cpu\s+\<\=\s+[0-9]+(seconds|minutes|hours|days)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+rttime\s+\<\=\s+[0-9]+(ms|seconds|minutes)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
|
|
|
syn match sdRLimit /\v^\s*set\s+rlimit\s+(cpu|rttime|nofile|nproc|rtprio|locks|sigpending|fsize|data|stack|core|rss|as|memlock|msgqueue|nice)\s+\<\=\s+infinity\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
" link rules
|
2014-10-20 08:50:16 +02:00
|
|
|
syn match sdEntryW /\v^\s+(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?link\s+(subset\s+)?(\/|\@\{\S*\})\S*\s+-\>\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
|
2014-10-20 08:50:16 +02:00
|
|
|
syn match sdExtHat /\v^\s+(\^|hat\s+|profile\s+)\S+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdComment " hat without {...}
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdProfileName /\v^((profile\s+)?\/\S+|profile\s+([a-zA-Z0-9]\S*\s)?\S+)\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ contains=sdProfileStart,sdHatName,sdFlags,sdComment,sdGlob
|
2012-06-18 09:29:01 +02:00
|
|
|
syn match sdProfileStart /{/ contained
|
2011-01-10 16:38:12 +01:00
|
|
|
syn match sdProfileEnd /^}\s*(#.*)?$/ contained " TODO: syn region does not (yet?) allow usage of comment in end=
|
|
|
|
" TODO: Removing the $ mark from end= will allow non-comments also :-(
|
2014-10-20 08:50:16 +02:00
|
|
|
syn match sdHatName /\v^\s+(\^|hat\s+|profile\s+)\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ contains=sdProfileStart,sdFlags,sdComment
|
2012-06-18 09:29:01 +02:00
|
|
|
syn match sdHatStart /{/ contained
|
2011-01-10 16:38:12 +01:00
|
|
|
syn match sdHatEnd /}/ contained " TODO: allow comments + [same as for syn match sdProfileEnd]
|
2014-09-12 17:25:14 +02:00
|
|
|
syn match sdFlags /\v((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)/ contained contains=sdFlagKey
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
syn match sdComment /\s*#.*$/
|
2011-02-01 00:50:47 +01:00
|
|
|
" NOTE: contains=sdComment changes #include highlighting to comment color.
|
|
|
|
" NOTE: Comment highlighting still works without contains=sdComment.
|
|
|
|
syn match sdInclude /\s*#include\s<\S*>/ " TODO: doesn't check until $
|
|
|
|
syn match sdInclude /\s*include\s<\S*>/ " TODO: doesn't check until $
|
2020-05-21 17:19:40 +02:00
|
|
|
syn match sdInclude /\s*#include\sif\sexists\s<\S*>/ " TODO: doesn't check until $
|
|
|
|
syn match sdInclude /\s*include\sif\sexists\s<\S*>/ " TODO: doesn't check until $
|
2011-01-10 16:38:12 +01:00
|
|
|
|
2021-08-13 20:30:25 +02:00
|
|
|
syn match sdInclude /\s*abi\s<\S*>\s*,/ contains=sdComment " TODO: doesn't check until $
|
|
|
|
|
2011-01-10 16:38:12 +01:00
|
|
|
" basic profile block...
|
|
|
|
" \s+ does not work in end=, therefore using \s\s*
|
2014-09-12 17:25:14 +02:00
|
|
|
syn region Normal start=/\v^(profile\s+)?\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ matchgroup=sdProfileEnd end=/^}\s*$/ contains=sdProfileName,Hat,@sdEntry,sdComment,sdError,sdInclude
|
2014-10-20 08:50:16 +02:00
|
|
|
syn region Hat start=/\v^\s+(\^|hat\s+|profile\s+)\S+\s+((flags\s*\=\s*)?\(\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted)(\s*,\s*(complain|audit|attach_disconnected|no_attach_disconnected|chroot_attach|chroot_no_attach|chroot_relative|namespace_relative|mediate_deleted|delegate_deleted))*\s*\)\s+)=\{/ matchgroup=sdHatEnd end=/^\s\s*}\s*$/ contains=sdHatName,@sdEntry,sdComment,sdError,sdInclude
|
2014-09-12 17:25:14 +02:00
|
|
|
|
|
|
|
" file permissions
|
|
|
|
|
2011-01-10 16:38:12 +01:00
|
|
|
|
|
|
|
|
2014-09-12 17:25:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
" file rules added with create_file_rule()
|
|
|
|
|
|
|
|
" write + exec/mmap - danger! (known bug: accepts aw to keep things simple)
|
|
|
|
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryWriteExec /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|a|m|k|[iuUpPcC]x)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" ux(mr) - unconstrained entry, flag the line red. also includes pux which is unconstrained if no profile exists
|
|
|
|
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ux|pux)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" Ux(mr) and PUx(mr) - like ux + clean environment
|
|
|
|
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryUXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Ux|PUx)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" px/cx/pix/cix(mrk) - standard exec entry, flag the line blue
|
|
|
|
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|px|cx|pix|cix)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" Px/Cx/Pix/Cix(mrk) - like px/cx + clean environment
|
|
|
|
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryPXe /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|Px|Cx|Pix|Cix)+(\s+-\>\s+\S+)?\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" ix(mr) - standard exec entry, flag the line green
|
|
|
|
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|ix)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|ix)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ix)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryIX /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k|ix)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" mr - mmap with PROT_EXEC
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(r|m|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" special case: deny x is allowed (does not need to be ix, px, ux or cx)
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(r|m|k|x)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(r|m|k|x)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(r|m|k|x)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryM /\v^\s*(audit\s+)?deny\s+(owner\s+|other\s+)?(r|m|k|x)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" write + append is an error
|
|
|
|
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+\S*(w\S*a|a\S*w)\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+\S*(w\S*a|a\S*w)\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?\S*(w\S*a|a\S*w)\S*\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdError /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?\S*(w\S*a|a\S*w)\S*\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" write entry, flag the line yellow
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|w|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|w|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|w|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" append entry, flag the line yellow
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+(l|r|a|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+(l|r|a|k)+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|a|k)+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryW /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(l|r|a|k)+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" read entry + locking, currently no highlighting
|
|
|
|
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+[rlk]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+[rlk]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rlk]+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryK /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rlk]+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|
|
|
|
" read entry, no highlighting
|
|
|
|
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?(\/|\@\{\S*\})\S*\s+[rl]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?"(\/|\@\{\S*\})\S*"\s+[rl]+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rl]+\s+(\/|\@\{\S*\})\S*\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
syn match sdEntryR /\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+|other\s+)?[rl]+\s+"(\/|\@\{\S*\})\S*"+\s*,(\s*$|(\s*#.*$)\@=)/ contains=sdGlob,sdComment nextgroup=@sdEntry,sdComment,sdError,sdInclude
|
|
|
|
|