2005-10-22 21:09:03 +00:00
|
|
|
|
2008-07-02 14:07:57 +00:00
|
|
|
policy_module(lpd, 1.10.0)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2007-03-26 18:41:45 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Use lpd server instead of cups
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2008-07-23 21:38:39 +00:00
|
|
|
gen_tunable(use_lpd_server, false)
|
2007-03-26 18:41:45 +00:00
|
|
|
|
2005-10-22 21:09:03 +00:00
|
|
|
type checkpc_t;
|
|
|
|
type checkpc_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_system_domain(checkpc_t, checkpc_exec_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
role system_r types checkpc_t;
|
|
|
|
|
|
|
|
type checkpc_log_t;
|
|
|
|
logging_log_file(checkpc_log_t)
|
|
|
|
|
|
|
|
type lpd_t;
|
|
|
|
type lpd_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_daemon_domain(lpd_t, lpd_exec_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
type lpd_tmp_t;
|
|
|
|
files_tmp_file(lpd_tmp_t)
|
|
|
|
|
|
|
|
type lpd_var_run_t;
|
|
|
|
files_pid_file(lpd_var_run_t)
|
|
|
|
|
2006-01-18 22:26:26 +00:00
|
|
|
type lpr_exec_t;
|
2007-07-19 18:57:48 +00:00
|
|
|
application_executable_file(lpr_exec_t)
|
2006-01-18 22:26:26 +00:00
|
|
|
|
2005-10-22 21:09:03 +00:00
|
|
|
type print_spool_t;
|
|
|
|
files_tmp_file(print_spool_t)
|
|
|
|
|
|
|
|
type printer_t;
|
|
|
|
files_type(printer_t)
|
|
|
|
|
|
|
|
type printconf_t;
|
|
|
|
files_type(printconf_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Checkpc local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
# Allow checkpc to access the lpd spool so it can check & fix it.
|
|
|
|
# This requires that /usr/sbin/checkpc have type checkpc_t.
|
|
|
|
|
|
|
|
allow checkpc_t self:capability { setgid setuid dac_override };
|
2006-05-17 20:55:12 +00:00
|
|
|
allow checkpc_t self:process signal_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
allow checkpc_t self:unix_stream_socket create_socket_perms;
|
2006-05-17 20:55:12 +00:00
|
|
|
allow checkpc_t self:tcp_socket create_socket_perms;
|
|
|
|
allow checkpc_t self:udp_socket create_socket_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow checkpc_t checkpc_log_t:file manage_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
logging_log_filetrans(checkpc_t, checkpc_log_t, file)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow checkpc_t lpd_var_run_t:dir search_dir_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
files_search_pids(checkpc_t)
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
rw_files_pattern(checkpc_t, print_spool_t, print_spool_t)
|
|
|
|
delete_files_pattern(checkpc_t, print_spool_t, print_spool_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
files_search_spool(checkpc_t)
|
|
|
|
|
|
|
|
allow checkpc_t printconf_t:file getattr;
|
2008-10-16 16:09:20 +00:00
|
|
|
allow checkpc_t printconf_t:dir list_dir_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(checkpc_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(checkpc_t)
|
|
|
|
corenet_all_recvfrom_netlabel(checkpc_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(checkpc_t)
|
|
|
|
corenet_udp_sendrecv_all_if(checkpc_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(checkpc_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(checkpc_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(checkpc_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(checkpc_t)
|
|
|
|
corenet_tcp_connect_all_ports(checkpc_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_all_client_packets(checkpc_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
dev_append_printer(checkpc_t)
|
|
|
|
|
|
|
|
# This is less desirable, but checkpc demands /bin/bash and /bin/chown:
|
|
|
|
corecmd_exec_shell(checkpc_t)
|
|
|
|
corecmd_exec_bin(checkpc_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(checkpc_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
files_read_etc_files(checkpc_t)
|
|
|
|
files_read_etc_runtime_files(checkpc_t)
|
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(checkpc_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
# Allow access to /dev/console through the fd:
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(checkpc_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(checkpc_t)
|
|
|
|
libs_use_shared_libs(checkpc_t)
|
|
|
|
|
|
|
|
sysnet_read_config(checkpc_t)
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-07-23 21:38:39 +00:00
|
|
|
cron_system_entry(checkpc_t, checkpc_exec_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 21:09:03 +00:00
|
|
|
logging_send_syslog_msg(checkpc_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 21:09:03 +00:00
|
|
|
nis_use_ypbind(checkpc_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Lpd local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow lpd_t self:capability { setgid setuid net_bind_service dac_read_search dac_override chown fowner };
|
|
|
|
dontaudit lpd_t self:capability sys_tty_config;
|
2005-11-10 21:37:54 +00:00
|
|
|
allow lpd_t self:process signal_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow lpd_t self:fifo_file rw_fifo_file_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
allow lpd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow lpd_t self:unix_dgram_socket create_socket_perms;
|
2006-05-17 20:55:12 +00:00
|
|
|
allow lpd_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow lpd_t self:udp_socket create_stream_socket_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(lpd_t, lpd_tmp_t, lpd_tmp_t)
|
|
|
|
manage_files_pattern(lpd_t, lpd_tmp_t, lpd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(lpd_t, lpd_tmp_t, { file dir })
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(lpd_t, lpd_var_run_t, lpd_var_run_t)
|
|
|
|
manage_sock_files_pattern(lpd_t, lpd_var_run_t, lpd_var_run_t)
|
|
|
|
files_pid_filetrans(lpd_t, lpd_var_run_t, file)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
# Write to /var/spool/lpd.
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(lpd_t, print_spool_t, print_spool_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
files_search_spool(lpd_t)
|
|
|
|
|
|
|
|
# lpd must be able to execute the filter utilities in /usr/share/printconf.
|
2008-10-16 16:09:20 +00:00
|
|
|
allow lpd_t printconf_t:dir list_dir_perms;
|
2005-10-22 21:09:03 +00:00
|
|
|
can_exec(lpd_t, printconf_t)
|
|
|
|
|
|
|
|
# Create and bind to /dev/printer.
|
2006-12-12 20:08:08 +00:00
|
|
|
allow lpd_t printer_t:lnk_file manage_lnk_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
dev_filetrans(lpd_t, printer_t, lnk_file)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(lpd_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
# bash wants access to /proc/meminfo
|
|
|
|
kernel_read_system_state(lpd_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(lpd_t)
|
|
|
|
corenet_all_recvfrom_netlabel(lpd_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(lpd_t)
|
|
|
|
corenet_udp_sendrecv_all_if(lpd_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(lpd_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(lpd_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(lpd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(lpd_t)
|
|
|
|
corenet_tcp_bind_all_nodes(lpd_t)
|
|
|
|
corenet_tcp_bind_printer_port(lpd_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_printer_server_packets(lpd_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(lpd_t)
|
|
|
|
dev_rw_printer(lpd_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(lpd_t)
|
|
|
|
fs_search_auto_mountpoints(lpd_t)
|
|
|
|
|
|
|
|
# Filter scripts may be shell scripts, and may invoke progs like /bin/mktemp
|
|
|
|
corecmd_exec_bin(lpd_t)
|
|
|
|
corecmd_exec_shell(lpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(lpd_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
|
|
|
files_read_etc_runtime_files(lpd_t)
|
|
|
|
files_read_usr_files(lpd_t)
|
|
|
|
# for defoma
|
|
|
|
files_list_world_readable(lpd_t)
|
|
|
|
files_read_world_readable_files(lpd_t)
|
|
|
|
files_read_world_readable_symlinks(lpd_t)
|
|
|
|
files_list_var_lib(lpd_t)
|
|
|
|
files_read_var_lib_files(lpd_t)
|
|
|
|
files_read_var_lib_symlinks(lpd_t)
|
|
|
|
# config files for lpd are of type etc_t, probably should change this
|
|
|
|
files_read_etc_files(lpd_t)
|
|
|
|
|
|
|
|
libs_use_ld_so(lpd_t)
|
|
|
|
libs_use_shared_libs(lpd_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(lpd_t)
|
|
|
|
|
|
|
|
miscfiles_read_fonts(lpd_t)
|
|
|
|
miscfiles_read_localization(lpd_t)
|
|
|
|
|
|
|
|
sysnet_read_config(lpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(lpd_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
|
|
|
sysadm_dontaudit_search_home_dirs(lpd_t)
|
2005-10-22 21:09:03 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 21:09:03 +00:00
|
|
|
nis_use_ypbind(lpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 21:09:03 +00:00
|
|
|
seutil_sigchld_newrole(lpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 21:09:03 +00:00
|
|
|
udev_read_db(lpd_t)
|
|
|
|
')
|