|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
12e9ea |
policy_module(lpd,1.7.1)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
56e1b3 |
## <desc>
|
|
Chris PeBenito |
56e1b3 |
##
|
|
Chris PeBenito |
56e1b3 |
## Use lpd server instead of cups
|
|
Chris PeBenito |
56e1b3 |
##
|
|
Chris PeBenito |
56e1b3 |
## </desc>
|
|
Chris PeBenito |
56e1b3 |
gen_tunable(use_lpd_server,false)
|
|
Chris PeBenito |
56e1b3 |
|
|
Chris PeBenito |
17de1b |
type checkpc_t;
|
|
Chris PeBenito |
17de1b |
type checkpc_exec_t;
|
|
Chris PeBenito |
17de1b |
init_system_domain(checkpc_t,checkpc_exec_t)
|
|
Chris PeBenito |
17de1b |
role system_r types checkpc_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type checkpc_log_t;
|
|
Chris PeBenito |
17de1b |
logging_log_file(checkpc_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type lpd_t;
|
|
Chris PeBenito |
17de1b |
type lpd_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(lpd_t,lpd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type lpd_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(lpd_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type lpd_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(lpd_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type lpr_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_executable_file(lpr_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type print_spool_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(print_spool_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type printer_t;
|
|
Chris PeBenito |
17de1b |
files_type(printer_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type printconf_t;
|
|
Chris PeBenito |
17de1b |
files_type(printconf_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Checkpc local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Allow checkpc to access the lpd spool so it can check & fix it.
|
|
Chris PeBenito |
17de1b |
# This requires that /usr/sbin/checkpc have type checkpc_t.
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow checkpc_t self:capability { setgid setuid dac_override };
|
|
Chris PeBenito |
17de1b |
allow checkpc_t self:process signal_perms;
|
|
Chris PeBenito |
17de1b |
allow checkpc_t self:unix_stream_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow checkpc_t self:tcp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow checkpc_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow checkpc_t checkpc_log_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
logging_log_filetrans(checkpc_t,checkpc_log_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow checkpc_t lpd_var_run_t:dir search_dir_perms;
|
|
Chris PeBenito |
17de1b |
files_search_pids(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
rw_files_pattern(checkpc_t,print_spool_t,print_spool_t)
|
|
Chris PeBenito |
c0868a |
delete_files_pattern(checkpc_t,print_spool_t,print_spool_t)
|
|
Chris PeBenito |
17de1b |
files_search_spool(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow checkpc_t printconf_t:file getattr;
|
|
Chris PeBenito |
17de1b |
allow checkpc_t printconf_t:dir { getattr search read };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled(checkpc_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_if(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_if(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_all_ports(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_all_client_packets(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_append_printer(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# This is less desirable, but checkpc demands /bin/bash and /bin/chown:
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(checkpc_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(checkpc_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(checkpc_t)
|
|
Chris PeBenito |
17de1b |
# Allow access to /dev/console through the fd:
|
|
Chris PeBenito |
17de1b |
init_use_fds(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(checkpc_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(checkpc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
cron_system_entry(checkpc_t,checkpc_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(checkpc_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(checkpc_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Lpd local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:capability { setgid setuid net_bind_service dac_read_search dac_override chown fowner };
|
|
Chris PeBenito |
17de1b |
dontaudit lpd_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:process signal_perms;
|
|
Chris PeBenito |
c0868a |
allow lpd_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow lpd_t self:udp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_dirs_pattern(lpd_t,lpd_tmp_t,lpd_tmp_t)
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(lpd_t,lpd_tmp_t,lpd_tmp_t)
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(lpd_t, lpd_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(lpd_t,lpd_var_run_t,lpd_var_run_t)
|
|
Chris PeBenito |
c0868a |
manage_sock_files_pattern(lpd_t,lpd_var_run_t,lpd_var_run_t)
|
|
Chris PeBenito |
17de1b |
files_pid_filetrans(lpd_t,lpd_var_run_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Write to /var/spool/lpd.
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(lpd_t,print_spool_t,print_spool_t)
|
|
Chris PeBenito |
17de1b |
files_search_spool(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# lpd must be able to execute the filter utilities in /usr/share/printconf.
|
|
Chris PeBenito |
17de1b |
allow lpd_t printconf_t:dir { getattr search read };
|
|
Chris PeBenito |
17de1b |
can_exec(lpd_t, printconf_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Create and bind to /dev/printer.
|
|
Chris PeBenito |
c0868a |
allow lpd_t printer_t:lnk_file manage_lnk_file_perms;
|
|
Chris PeBenito |
17de1b |
dev_filetrans(lpd_t,printer_t,lnk_file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(lpd_t)
|
|
Chris PeBenito |
17de1b |
# bash wants access to /proc/meminfo
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled(lpd_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_if(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_if(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_all_nodes(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_printer_port(lpd_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_printer_server_packets(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(lpd_t)
|
|
Chris PeBenito |
17de1b |
dev_rw_printer(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs(lpd_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Filter scripts may be shell scripts, and may invoke progs like /bin/mktemp
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(lpd_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_usr_files(lpd_t)
|
|
Chris PeBenito |
17de1b |
# for defoma
|
|
Chris PeBenito |
17de1b |
files_list_world_readable(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_world_readable_files(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_world_readable_symlinks(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_list_var_lib(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_var_lib_files(lpd_t)
|
|
Chris PeBenito |
17de1b |
files_read_var_lib_symlinks(lpd_t)
|
|
Chris PeBenito |
17de1b |
# config files for lpd are of type etc_t, probably should change this
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(lpd_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_fonts(lpd_t)
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(lpd_t)
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_search_sysadm_home_dirs(lpd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(lpd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(lpd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(lpd_t)
|
|
Chris PeBenito |
17de1b |
')
|