selinux-refpolicy/policy/modules/services/ulogd.te

77 lines
2.1 KiB
Plaintext
Raw Normal View History

policy_module(ulogd, 1.5.2)
########################################
#
# Declarations
#
type ulogd_t;
type ulogd_exec_t;
init_daemon_domain(ulogd_t, ulogd_exec_t)
type ulogd_etc_t;
files_config_file(ulogd_etc_t)
type ulogd_initrc_exec_t;
init_script_file(ulogd_initrc_exec_t)
type ulogd_modules_t;
files_type(ulogd_modules_t)
type ulogd_runtime_t;
files_pid_file(ulogd_runtime_t)
type ulogd_var_log_t;
logging_log_file(ulogd_var_log_t)
########################################
#
# Local policy
#
# If there is an AVC about capability dac_read_search being denied to ulogd_t,
# it may be caused by root not being able to access to /var/log/ulog according
# to the directory permissions. Such an issue can be fixed using ACL (for
# example with: setfacl -m u:root:rwx /var/log/ulog). Please do not add
# a rule allowing dac_read_search if you encounter this, but fix your system.
allow ulogd_t self:capability { net_admin setgid setuid sys_nice };
allow ulogd_t self:process setsched;
ulogd: allow creating a netlink-netfilter socket This is used to get the packets logged by the firewall. I experienced this on a Debian system which uses nftables rules with the "log" keyword: type=AVC msg=audit(1565901600.257:348): avc: denied { create } for pid=8586 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tcla ss=netlink_netfilter_socket permissive=1 type=AVC msg=audit(1565901103.154:327): avc: denied { read } for pid=436 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tclass=netlink_netfilter_socket permissive=1 type=SYSCALL msg=audit(1565901103.154:327): arch=c000003e syscall=45 success=yes exit=148 a0=8 a1=7f651d19d010 a2=249f0 a3=0 items=0 ppid=1 pid=436 auid=4294967295 uid=111 gid=118 euid=111 suid=111 fsuid=111 egid=118 sgid=118 fsgid=118 tty=(none) ses=4294967295 comm="ulogd" exe="/usr/sbin/ulogd" subj=system_u:system_r:ulogd_t key=(null) type=PROCTITLE msg=audit(1565901103.154:327): proctitle=2F7573722F7362696E2F756C6F6764002D2D6461656D6F6E002D2D75696400756C6F67002D2D70696466696C65002F72756E2F756C6F672F756C6F67642E706964 [ ... ] type=AVC msg=audit(1565901600.241:338): avc: denied { write } for pid=436 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tclass=netlink_netfilter_socket permissive=1 type=AVC msg=audit(1565901600.257:348): avc: denied { create } for pid=8586 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tclass=netlink_netfilter_socket permissive=1 type=AVC msg=audit(1565901600.257:349): avc: denied { getattr } for pid=8586 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tclass=netlink_netfilter_socket permissive=1 type=AVC msg=audit(1565901600.257:350): avc: denied { bind } for pid=8586 comm="ulogd" scontext=system_u:system_r:ulogd_t tcontext=system_u:system_r:ulogd_t tclass=netlink_netfilter_socket permissive=1 Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-08-17 13:53:32 +00:00
allow ulogd_t self:netlink_netfilter_socket create_socket_perms;
allow ulogd_t self:netlink_nflog_socket create_socket_perms;
allow ulogd_t self:netlink_socket create_socket_perms;
allow ulogd_t self:tcp_socket create_stream_socket_perms;
read_files_pattern(ulogd_t, ulogd_etc_t, ulogd_etc_t)
list_dirs_pattern(ulogd_t, ulogd_modules_t, ulogd_modules_t)
mmap_exec_files_pattern(ulogd_t, ulogd_modules_t, ulogd_modules_t)
manage_files_pattern(ulogd_t, ulogd_runtime_t, ulogd_runtime_t)
append_files_pattern(ulogd_t, ulogd_var_log_t, ulogd_var_log_t)
create_files_pattern(ulogd_t, ulogd_var_log_t, ulogd_var_log_t)
setattr_files_pattern(ulogd_t, ulogd_var_log_t, ulogd_var_log_t)
logging_log_filetrans(ulogd_t, ulogd_var_log_t, file)
files_read_etc_files(ulogd_t)
files_read_usr_files(ulogd_t)
# For /proc/sys/kernel/ngroups_max
kernel_read_kernel_sysctls(ulogd_t)
logging_send_syslog_msg(ulogd_t)
miscfiles_read_localization(ulogd_t)
sysnet_dns_name_resolve(ulogd_t)
optional_policy(`
mysql_stream_connect(ulogd_t)
mysql_tcp_connect(ulogd_t)
')
optional_policy(`
postgresql_stream_connect(ulogd_t)
postgresql_tcp_connect(ulogd_t)
')