diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 7d7956596..a1f2e6d97 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -4,6 +4,7 @@ comsat dbus dhcp + dictd hal squid diff --git a/refpolicy/policy/modules/services/dictd.fc b/refpolicy/policy/modules/services/dictd.fc new file mode 100644 index 000000000..817c44e60 --- /dev/null +++ b/refpolicy/policy/modules/services/dictd.fc @@ -0,0 +1,6 @@ + +/etc/dictd\.conf -- context_template(system_u:object_r:dictd_etc_t,s0) + +/usr/sbin/dictd -- context_template(system_u:object_r:dictd_exec_t,s0) + +/var/lib/dictd(/.*)? context_template(system_u:object_r:dictd_var_lib_t,s0) diff --git a/refpolicy/policy/modules/services/dictd.if b/refpolicy/policy/modules/services/dictd.if new file mode 100644 index 000000000..26f27aadd --- /dev/null +++ b/refpolicy/policy/modules/services/dictd.if @@ -0,0 +1,21 @@ +## Dictionary daemon + +######################################## +## +## Use dictionary services by connecting +## over TCP. +## +## +## Domain allowed access. +## +# +interface(`dictd_use',` + gen_require(` + type dictd_t; + class tcp_socket { connectto acceptfrom recvfrom }; + ') + + allow $1 dictd_t:tcp_socket { connectto recvfrom }; + allow dictd_t $1:tcp_socket { acceptfrom recvfrom }; + kernel_tcp_recvfrom($1) +') diff --git a/refpolicy/policy/modules/services/dictd.te b/refpolicy/policy/modules/services/dictd.te new file mode 100644 index 000000000..a1f9e7324 --- /dev/null +++ b/refpolicy/policy/modules/services/dictd.te @@ -0,0 +1,101 @@ + +policy_module(dictd,1.0) + +######################################## +# +# Declarations +# + +type dictd_t; +type dictd_exec_t; +init_daemon_domain(dictd_t,dictd_exec_t) + +type dictd_etc_t; #, usercanread; +files_type(dictd_etc_t) + +type dictd_var_lib_t alias var_lib_dictd_t; +files_type(dictd_var_lib_t) + +######################################## +# +# Local policy +# + +allow dictd_t self:capability { setuid setgid }; +dontaudit dictd_t self:capability sys_tty_config; +allow dictd_t self:process { signal_perms setpgid }; +allow dictd_t self:unix_stream_socket create_stream_socket_perms; + +allow dictd_t dictd_etc_t:file r_file_perms; +files_search_etc(dictd_t) + +allow dictd_t dictd_var_lib_t:dir r_dir_perms; +allow dictd_t dictd_var_lib_t:file r_file_perms; + +kernel_read_system_state(dictd_t) +kernel_read_kernel_sysctl(dictd_t) +kernel_tcp_recvfrom(dictd_t) + +corenet_tcp_sendrecv_all_if(dictd_t) +corenet_raw_sendrecv_all_if(dictd_t) +corenet_udp_sendrecv_all_if(dictd_t) +corenet_tcp_sendrecv_all_nodes(dictd_t) +corenet_udp_sendrecv_all_nodes(dictd_t) +corenet_raw_sendrecv_all_nodes(dictd_t) +corenet_tcp_sendrecv_all_ports(dictd_t) +corenet_udp_sendrecv_all_ports(dictd_t) +corenet_tcp_bind_all_nodes(dictd_t) +corenet_udp_bind_all_nodes(dictd_t) +corenet_tcp_bind_dict_port(dictd_t) + +dev_read_sysfs(dictd_t) + +fs_getattr_xattr_fs(dictd_t) +fs_search_auto_mountpoints(dictd_t) + +term_dontaudit_use_console(dictd_t) + +domain_use_wide_inherit_fd(dictd_t) + +files_read_etc_files(dictd_t) +files_read_etc_runtime_files(dictd_t) +files_read_usr_files(dictd_t) +files_search_var_lib(dictd_t) +# for checking for nscd +files_dontaudit_search_pids(dictd_t) + +init_use_fd(dictd_t) +init_use_script_pty(dictd_t) + +libs_use_ld_so(dictd_t) +libs_use_shared_libs(dictd_t) + +logging_send_syslog_msg(dictd_t) + +miscfiles_read_localization(dictd_t) + +userdom_dontaudit_use_unpriv_user_fd(dictd_t) + +ifdef(`targeted_policy',` + term_dontaudit_use_unallocated_tty(dictd_t) + term_dontaudit_use_generic_pty(dictd_t) + files_dontaudit_read_root_file(dictd_t) +') + +optional_policy(`nis.te',` + nis_use_ypbind(dictd_t) +') + +optional_policy(`selinuxutil.te',` + seutil_sigchld_newrole(dictd_t) +') + +optional_policy(`udev.te',` + udev_read_db(dictd_t) +') + +ifdef(`TODO',` +optional_policy(`rhgb.te',` + rhgb_domain(dictd_t) +') +') dnl end TODO diff --git a/refpolicy/policy/modules/system/userdomain.if b/refpolicy/policy/modules/system/userdomain.if index 4615eef76..5ea3c0273 100644 --- a/refpolicy/policy/modules/system/userdomain.if +++ b/refpolicy/policy/modules/system/userdomain.if @@ -244,6 +244,10 @@ template(`base_user_template',` dbus_system_bus_client_template($1,$1_t) ') + optional_policy(`dictd.te',` + dictd_use($1_t) + ') + optional_policy(`inetd.te',` inetd_tcp_connect($1_t) ')