From 18963117b3e34b82aa560329c49f284d33ba0261 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Mar 31 2006 22:09:27 +0000 Subject: add dante, bug 1521 --- diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 7010030..b4df0f5 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -33,6 +33,7 @@ calamaris cipe clamav (Erich Schubert) + dante dpkg (Erich Schubert) ethereal evolution diff --git a/refpolicy/policy/modules/services/dante.fc b/refpolicy/policy/modules/services/dante.fc new file mode 100644 index 0000000..5071bae --- /dev/null +++ b/refpolicy/policy/modules/services/dante.fc @@ -0,0 +1,6 @@ + +/etc/socks(/.*)? gen_context(system_u:object_r:dante_conf_t,s0) + +/usr/sbin/sockd -- gen_context(system_u:object_r:dante_exec_t,s0) + +/var/run/sockd.pid -- gen_context(system_u:object_r:dante_var_run_t,s0) diff --git a/refpolicy/policy/modules/services/dante.if b/refpolicy/policy/modules/services/dante.if new file mode 100644 index 0000000..704661c --- /dev/null +++ b/refpolicy/policy/modules/services/dante.if @@ -0,0 +1 @@ +## Dante msproxy and socks4/5 proxy server diff --git a/refpolicy/policy/modules/services/dante.te b/refpolicy/policy/modules/services/dante.te new file mode 100644 index 0000000..5b32250 --- /dev/null +++ b/refpolicy/policy/modules/services/dante.te @@ -0,0 +1,96 @@ + +policy_module(dante,1.0.0) + +######################################## +# +# Declarations +# + +type dante_t; +type dante_exec_t; +init_daemon_domain(dante_t,dante_exec_t) + +type dante_conf_t; +files_type(dante_conf_t) + +type dante_var_run_t; +files_pid_file(dante_var_run_t) + +######################################## +# +# Local policy +# + +allow dante_t self:capability { setuid setgid }; +dontaudit dante_t self:capability sys_tty_config; +allow dante_t self:process signal_perms; +allow dante_t self:fifo_file { read write }; +allow dante_t self:tcp_socket create_stream_socket_perms; +allow dante_t self:udp_socket create_socket_perms; + +allow dante_t dante_conf_t:dir r_dir_perms; +allow dante_t dante_conf_t:file r_file_perms; + +allow dante_t dante_var_run_t:file create_file_perms; +allow dante_t dante_var_run_t:dir rw_dir_perms; +files_pid_filetrans(dante_t,dante_var_run_t,file) + +kernel_read_kernel_sysctls(dante_t) +kernel_list_proc(dante_t) +kernel_read_proc_symlinks(dante_t) + +corenet_tcp_sendrecv_generic_if(dante_t) +corenet_udp_sendrecv_generic_if(dante_t) +corenet_raw_sendrecv_generic_if(dante_t) +corenet_tcp_sendrecv_all_nodes(dante_t) +corenet_udp_sendrecv_all_nodes(dante_t) +corenet_raw_sendrecv_all_nodes(dante_t) +corenet_tcp_sendrecv_all_ports(dante_t) +corenet_udp_sendrecv_all_ports(dante_t) +corenet_non_ipsec_sendrecv(dante_t) +corenet_tcp_bind_all_nodes(dante_t) +corenet_udp_bind_all_nodes(dante_t) +#TODO: no portcons for this type +#allow dante_t socks_port_t:tcp_socket name_bind; + +dev_read_sysfs(dante_t) + +domain_use_interactive_fds(dante_t) + +files_read_etc_files(dante_t) +files_read_etc_runtime_files(dante_t) + +fs_getattr_all_fs(dante_t) +fs_search_auto_mountpoints(dante_t) + +term_dontaudit_use_console(dante_t) + +init_use_fds(dante_t) +init_use_script_ptys(dante_t) +init_write_utmp(dante_t) + +libs_use_ld_so(dante_t) +libs_use_shared_libs(dante_t) + +logging_send_syslog_msg(dante_t) + +miscfiles_read_localization(dante_t) + +sysnet_read_config(dante_t) + +userdom_dontaudit_use_unpriv_user_fds(dante_t) +userdom_dontaudit_search_sysadm_home_dirs(dante_t) + +ifdef(`targeted_policy',` + term_dontaudit_use_unallocated_ttys(dante_t) + term_dontaudit_use_generic_ptys(dante_t) + files_dontaudit_read_root_files(dante_t) +') + +optional_policy(` + seutil_sigchld_newrole(dante_t) +') + +optional_policy(` + udev_read_db(dante_t) +') diff --git a/refpolicy/policy/modules/system/init.if b/refpolicy/policy/modules/system/init.if index 6902c6a..a9dcfc1 100644 --- a/refpolicy/policy/modules/system/init.if +++ b/refpolicy/policy/modules/system/init.if @@ -890,6 +890,25 @@ interface(`init_dontaudit_write_utmp',` ######################################## ## +## Write to utmp. +## +## +## +## Domain allowed access. +## +## +# +interface(`init_write_utmp',` + gen_require(` + type initrc_var_run_t; + ') + + files_list_pids($1) + allow $1 initrc_var_run_t:file { getattr write }; +') + +######################################## +## ## Do not audit attempts to lock ## init script pid files. ## diff --git a/refpolicy/policy/modules/system/init.te b/refpolicy/policy/modules/system/init.te index ba73a3d..0b6f2d9 100644 --- a/refpolicy/policy/modules/system/init.te +++ b/refpolicy/policy/modules/system/init.te @@ -1,5 +1,5 @@ -policy_module(init,1.3.3) +policy_module(init,1.3.4) gen_require(` class passwd rootok;