"-a" | "--all" , -i
"-b" | "--boot" , -i
"-d" | "--dmesg" /bin/dmesg. , dmesg , auditd; "ausearch -m avc | audit2allow" "-a".
"-D" | "--dontaudit" dontaudit ( : allow)
"-h" | "--help"
"-i <inputfile>" | "--input <inputfile>" <inputfile>
"-l" | "--lastreload"
"-m <modulename>" | "--module <modulename>" / <modulename>
"-M <modulename>" , -o
"-p <policyfile>" | "--policy <policyfile>" ,
"-o <outputfile>" | "--output <outputfile>" <outputfile>
"-r" | "--requires"
"-N" | "--noreference" , . .
"-R" | "--reference" . , .
"-x" | "--xperms"
"-w" | "--why" SELinux
"-v" | "--verbose"
, , , , ( ) . (allow) . - , , , . audit2why (8) .
; , . / , , , . ; 'dontaudit', 'allow'.
: , . , (AVC) /var/log/messages. /var/log/messages /var/log/audit/audit.logaudit2allow $ cat /var/log/audit/audit.log | audit2allow -m local > local.te $ cat local.te module local 1.0; require { class file { getattr open read }; type myapp_t; type etc_t; }; allow myapp_t etc_t:file { getattr open read }; < local.te > audit2allow $ cat /var/log/audit/audit.log | audit2allow -R -m local > local.te $ cat local.te policy_module(local, 1.0) gen_require(` type myapp_t; type etc_t; }; files_read_etc_files(myapp_t) < local.te > Makefile # SELinux # /usr/share/selinux/devel, # . # .te , $ make -f /usr/share/selinux/devel/Makefile local.pp # make local.te # . "pp", # "te" . # .te "pp" # semodule. $ semodule -i local.pp # $ checkmodule -M -m -o local.mod local.te # $ semodule_package -o local.pp -m local.mod # $ semodule -i local.pp audit2allow $ cat /var/log/audit/audit.log | audit2allow -M local : local.te : checkmodule -M -m -o local.mod local.te : semodule_package -o local.pp -m local.mod ******************** *********************** , semodule -i local.pp audit2allow ( ) $ cd /etc/selinux/$SELINUXTYPE/src/policy $ cat /var/log/audit/audit.log | audit2allow >> domains/misc/local.te $ cat domains/misc/local.te allow cupsd_config_t unconfined_t:fifo_file { getattr ioctl }; < domains/misc/local.te > $ make load
audit2allow , Justin R. Smith, Yuichi Nakamura Dan Walsh. <gammaray (at] basealt.ru>.