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

128 lines
3.6 KiB
Plaintext
Raw Normal View History

policy_module(bitlbee, 1.9.0)
########################################
#
# Declarations
#
type bitlbee_t;
type bitlbee_exec_t;
init_daemon_domain(bitlbee_t, bitlbee_exec_t)
inetd_tcp_service_domain(bitlbee_t, bitlbee_exec_t)
type bitlbee_conf_t;
files_config_file(bitlbee_conf_t)
type bitlbee_initrc_exec_t;
init_script_file(bitlbee_initrc_exec_t)
type bitlbee_runtime_t alias bitlbee_var_run_t;
files_pid_file(bitlbee_runtime_t)
type bitlbee_tmp_t;
files_tmp_file(bitlbee_tmp_t)
type bitlbee_var_t;
files_type(bitlbee_var_t)
type bitlbee_log_t;
logging_log_file(bitlbee_log_t)
########################################
#
# Local policy
#
allow bitlbee_t self:capability { dac_override kill setgid setuid sys_nice };
allow bitlbee_t self:process { setsched signal };
allow bitlbee_t self:fifo_file rw_fifo_file_perms;
allow bitlbee_t self:tcp_socket { accept listen };
allow bitlbee_t self:unix_stream_socket { accept listen };
allow bitlbee_t bitlbee_conf_t:dir list_dir_perms;
allow bitlbee_t bitlbee_conf_t:file read_file_perms;
manage_dirs_pattern(bitlbee_t, bitlbee_log_t, bitlbee_log_t)
append_files_pattern(bitlbee_t, bitlbee_log_t, bitlbee_log_t)
create_files_pattern(bitlbee_t, bitlbee_log_t, bitlbee_log_t)
setattr_files_pattern(bitlbee_t, bitlbee_log_t, bitlbee_log_t)
manage_files_pattern(bitlbee_t, bitlbee_tmp_t, bitlbee_tmp_t)
manage_dirs_pattern(bitlbee_t, bitlbee_tmp_t, bitlbee_tmp_t)
files_tmp_filetrans(bitlbee_t, bitlbee_tmp_t, { dir file })
manage_files_pattern(bitlbee_t, bitlbee_var_t, bitlbee_var_t)
files_var_lib_filetrans(bitlbee_t, bitlbee_var_t, file)
manage_dirs_pattern(bitlbee_t, bitlbee_runtime_t, bitlbee_runtime_t)
manage_files_pattern(bitlbee_t, bitlbee_runtime_t, bitlbee_runtime_t)
manage_sock_files_pattern(bitlbee_t, bitlbee_runtime_t, bitlbee_runtime_t)
files_pid_filetrans(bitlbee_t, bitlbee_runtime_t, { dir file sock_file })
kernel_read_kernel_sysctls(bitlbee_t)
kernel_read_system_state(bitlbee_t)
kernel_read_crypto_sysctls(bitlbee_t)
corenet_all_recvfrom_unlabeled(bitlbee_t)
corenet_all_recvfrom_netlabel(bitlbee_t)
corenet_tcp_sendrecv_generic_if(bitlbee_t)
corenet_tcp_sendrecv_generic_node(bitlbee_t)
corenet_tcp_bind_generic_node(bitlbee_t)
corenet_sendrecv_jabber_client_client_packets(bitlbee_t)
corenet_tcp_connect_jabber_client_port(bitlbee_t)
corenet_sendrecv_aol_client_packets(bitlbee_t)
corenet_tcp_connect_aol_port(bitlbee_t)
corenet_sendrecv_gatekeeper_client_packets(bitlbee_t)
corenet_tcp_connect_gatekeeper_port(bitlbee_t)
corenet_sendrecv_mmcc_client_packets(bitlbee_t)
corenet_tcp_connect_mmcc_port(bitlbee_t)
corenet_sendrecv_msnp_client_packets(bitlbee_t)
corenet_tcp_connect_msnp_port(bitlbee_t)
corenet_sendrecv_http_client_packets(bitlbee_t)
corenet_tcp_connect_http_port(bitlbee_t)
corenet_sendrecv_http_cache_client_packets(bitlbee_t)
corenet_tcp_connect_http_cache_port(bitlbee_t)
corenet_sendrecv_ircd_server_packets(bitlbee_t)
corenet_tcp_bind_ircd_port(bitlbee_t)
corenet_sendrecv_ircd_client_packets(bitlbee_t)
corenet_tcp_connect_ircd_port(bitlbee_t)
corenet_sendrecv_interwise_server_packets(bitlbee_t)
corenet_tcp_bind_interwise_port(bitlbee_t)
dev_read_rand(bitlbee_t)
dev_read_urand(bitlbee_t)
files_read_usr_files(bitlbee_t)
libs_legacy_use_shared_libs(bitlbee_t)
auth_use_nsswitch(bitlbee_t)
logging_send_syslog_msg(bitlbee_t)
miscfiles_read_localization(bitlbee_t)
bitlbee: allow using GetDynamicUser on Debian On Debian 10, starting bitlbee daemon leads to: type=AVC msg=audit(1567941717.044:14204): avc: denied { search } for pid=5704 comm="bitlbee" name="dbus" dev="tmpfs" ino=13798 scontext=system_u:system_r:bitlbee_t tcontext=system_u:object_r:system_dbusd_var_run_t tclass=dir permissive=0 type=AVC msg=audit(1567941717.044:14205): avc: denied { read } for pid=5704 comm="bitlbee" name="direct:64707" dev="tmpfs" ino=16529 scontext=system_u:system_r:bitlbee_t tcontext=system_u:object_r:init_var_run_t tclass=lnk_file permissive=0 type=AVC msg=audit(1567941756.020:14208): avc: denied { search } for pid=6363 comm="bitlbee" name="dbus" dev="tmpfs" ino=13798 scontext=system_u:system_r:bitlbee_t tcontext=system_u:object_r:system_dbusd_var_run_t tclass=dir permissive=0 type=AVC msg=audit(1567941756.020:14209): avc: denied { read } for pid=6363 comm="bitlbee" name="direct:64707" dev="tmpfs" ino=16529 scontext=system_u:system_r:bitlbee_t tcontext=system_u:object_r:init_var_run_t tclass=lnk_file permissive=0 type=USER_AVC msg=audit(1567941770.492:14215): pid=432 uid=106 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t msg='avc: denied { send_msg } for msgtype=method_call interface=org.freedesktop.systemd1.Manager member=GetDynamicUsers dest=org.freedesktop.systemd1 spid=6694 tpid=1 scontext=system_u:system_r:bitlbee_t tcontext=system_u:system_r:init_t tclass=dbus permissive=0 exe="/usr/bin/dbus-daemon" sauid=106 hostname=? addr=? terminal=?' All these denials are related to getting dynamic users through a D-Bus call to GetDynamicUsers() of interface org.freedesktop.systemd1.Manager. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-09-08 21:07:15 +00:00
ifdef(`init_systemd', `
# For /run/systemd/dynamic-uid/
init_list_pids(bitlbee_t)
optional_policy(`
dbus_system_bus_client(bitlbee_t)
# For GetDynamicUser() of org.freedesktop.systemd1.Manager
init_dbus_chat(bitlbee_t)
')
')
optional_policy(`
tcpd_wrapped_domain(bitlbee_t, bitlbee_exec_t)
')