From 0cc79fcc6385ff779f8954b7018931a924942741 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Apr 12 2006 19:24:21 +0000 Subject: add perdition, bug 1537 --- diff --git a/refpolicy/Changelog b/refpolicy/Changelog index c8b877a..7f0ca9d 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -48,6 +48,7 @@ mplayer nagios nessus + perdition postgrey pxe qmail (Petre Rodan) diff --git a/refpolicy/policy/modules/services/perdition.fc b/refpolicy/policy/modules/services/perdition.fc new file mode 100644 index 0000000..bcdf89b --- /dev/null +++ b/refpolicy/policy/modules/services/perdition.fc @@ -0,0 +1,3 @@ +/etc/perdition(/.*)? gen_context(system_u:object_r:perdition_etc_t,s0) + +/usr/sbin/perdition -- gen_context(system_u:object_r:perdition_exec_t,s0) diff --git a/refpolicy/policy/modules/services/perdition.if b/refpolicy/policy/modules/services/perdition.if new file mode 100644 index 0000000..949cc11 --- /dev/null +++ b/refpolicy/policy/modules/services/perdition.if @@ -0,0 +1,21 @@ +## Perdition POP and IMAP proxy + +######################################## +## +## Connect to perdition over a TCP socket +## +## +## +## The type of the process performing this action. +## +## +# +interface(`perdition_tcp_connect',` + gen_require(` + type perdition_t; + ') + + allow $1 perdition_t:tcp_socket { connectto recvfrom }; + allow perdition_t $1:tcp_socket { acceptfrom recvfrom }; + kernel_tcp_recvfrom($1) +') diff --git a/refpolicy/policy/modules/services/perdition.te b/refpolicy/policy/modules/services/perdition.te new file mode 100644 index 0000000..f407289 --- /dev/null +++ b/refpolicy/policy/modules/services/perdition.te @@ -0,0 +1,93 @@ + +policy_module(perdition,1.0.0) + +######################################## +# +# Declarations +# + +type perdition_t; +type perdition_exec_t; +init_daemon_domain(perdition_t,perdition_exec_t) + +type perdition_etc_t; +files_config_file(perdition_etc_t) + +type perdition_var_run_t; +files_pid_file(perdition_var_run_t) + +######################################## +# +# Local policy +# + +allow perdition_t self:capability { setgid setuid }; +dontaudit perdition_t self:capability sys_tty_config; +allow perdition_t self:process signal_perms; +allow perdition_t self:tcp_socket create_stream_socket_perms; +allow perdition_t self:udp_socket create_socket_perms; + +allow perdition_t perdition_etc_t:file { getattr read }; +files_search_etc(perdition_t) + +allow perdition_t perdition_var_run_t:file create_file_perms; +allow perdition_t perdition_var_run_t:dir rw_dir_perms; +files_pid_filetrans(perdition_t,perdition_var_run_t,file) + +kernel_read_kernel_sysctls(perdition_t) +kernel_list_proc(perdition_t) +kernel_read_proc_symlinks(perdition_t) +kernel_tcp_recvfrom(perdition_t) + +corenet_non_ipsec_sendrecv(perdition_t) +corenet_tcp_sendrecv_generic_if(perdition_t) +corenet_udp_sendrecv_generic_if(perdition_t) +corenet_raw_sendrecv_generic_if(perdition_t) +corenet_tcp_sendrecv_all_nodes(perdition_t) +corenet_udp_sendrecv_all_nodes(perdition_t) +corenet_raw_sendrecv_all_nodes(perdition_t) +corenet_tcp_sendrecv_all_ports(perdition_t) +corenet_udp_sendrecv_all_ports(perdition_t) +corenet_tcp_bind_all_nodes(perdition_t) +corenet_udp_bind_all_nodes(perdition_t) +corenet_tcp_bind_pop_port(perdition_t) + +dev_read_sysfs(perdition_t) + +domain_use_interactive_fds(perdition_t) + +fs_getattr_all_fs(perdition_t) +fs_search_auto_mountpoints(perdition_t) + +files_read_etc_files(perdition_t) + +term_dontaudit_use_console(perdition_t) + +init_use_fds(perdition_t) +init_use_script_ptys(perdition_t) + +libs_use_ld_so(perdition_t) +libs_use_shared_libs(perdition_t) + +logging_send_syslog_msg(perdition_t) + +miscfiles_read_localization(perdition_t) + +sysnet_read_config(perdition_t) + +userdom_dontaudit_use_unpriv_user_fds(perdition_t) +userdom_dontaudit_search_sysadm_home_dirs(perdition_t) + +ifdef(`targeted_policy',` + term_dontaudit_use_unallocated_ttys(perdition_t) + term_dontaudit_use_generic_ptys(perdition_t) + files_dontaudit_read_root_files(perdition_t) +') + +optional_policy(` + seutil_sigchld_newrole(perdition_t) +') + +optional_policy(` + udev_read_db(perdition_t) +') diff --git a/refpolicy/policy/modules/system/userdomain.if b/refpolicy/policy/modules/system/userdomain.if index 6c3834c..c6b4973 100644 --- a/refpolicy/policy/modules/system/userdomain.if +++ b/refpolicy/policy/modules/system/userdomain.if @@ -404,6 +404,10 @@ template(`base_user_template',` ') optional_policy(` + perdition_tcp_connect($1_t) + ') + + optional_policy(` portmap_tcp_connect($1_t) ') diff --git a/refpolicy/policy/modules/system/userdomain.te b/refpolicy/policy/modules/system/userdomain.te index c4d73bc..0fc100f 100644 --- a/refpolicy/policy/modules/system/userdomain.te +++ b/refpolicy/policy/modules/system/userdomain.te @@ -1,5 +1,5 @@ -policy_module(userdomain,1.3.11) +policy_module(userdomain,1.3.12) gen_require(` role sysadm_r, staff_r, user_r;