selinux-policy/policy/modules/services/apcupsd.te

125 lines
3.4 KiB
Plaintext
Raw Normal View History

2007-05-07 14:55:54 +00:00
policy_module(apcupsd, 1.5.0)
2007-05-07 14:55:54 +00:00
########################################
#
# Declarations
#
type apcupsd_t;
type apcupsd_exec_t;
init_daemon_domain(apcupsd_t, apcupsd_exec_t)
type apcupsd_lock_t;
files_lock_file(apcupsd_lock_t)
2008-10-08 15:50:03 +00:00
type apcupsd_initrc_exec_t;
init_script_file(apcupsd_initrc_exec_t)
2007-05-07 14:55:54 +00:00
type apcupsd_log_t;
logging_log_file(apcupsd_log_t)
2007-09-06 18:34:40 +00:00
type apcupsd_tmp_t;
files_tmp_file(apcupsd_tmp_t)
2007-05-07 14:55:54 +00:00
type apcupsd_var_run_t;
files_pid_file(apcupsd_var_run_t)
########################################
#
# apcupsd local policy
#
2007-09-06 18:34:40 +00:00
allow apcupsd_t self:capability { dac_override setgid sys_tty_config };
allow apcupsd_t self:process signal;
2007-05-07 14:55:54 +00:00
allow apcupsd_t self:fifo_file rw_file_perms;
allow apcupsd_t self:unix_stream_socket create_stream_socket_perms;
allow apcupsd_t self:tcp_socket create_stream_socket_perms;
allow apcupsd_t apcupsd_lock_t:file manage_file_perms;
files_lock_filetrans(apcupsd_t,apcupsd_lock_t,file)
allow apcupsd_t apcupsd_log_t:dir setattr;
manage_files_pattern(apcupsd_t, apcupsd_log_t, apcupsd_log_t)
logging_log_filetrans(apcupsd_t, apcupsd_log_t, { file dir })
2007-05-07 14:55:54 +00:00
2007-09-06 18:34:40 +00:00
manage_files_pattern(apcupsd_t, apcupsd_tmp_t, apcupsd_tmp_t)
files_tmp_filetrans(apcupsd_t, apcupsd_tmp_t, file)
manage_files_pattern(apcupsd_t, apcupsd_var_run_t, apcupsd_var_run_t)
2007-05-07 14:55:54 +00:00
files_pid_filetrans(apcupsd_t,apcupsd_var_run_t, file)
2007-09-06 18:34:40 +00:00
kernel_read_system_state(apcupsd_t)
corecmd_exec_bin(apcupsd_t)
corecmd_exec_shell(apcupsd_t)
corenet_all_recvfrom_unlabeled(apcupsd_t)
corenet_all_recvfrom_netlabel(apcupsd_t)
2007-05-07 14:55:54 +00:00
corenet_tcp_sendrecv_generic_if(apcupsd_t)
corenet_tcp_sendrecv_all_nodes(apcupsd_t)
corenet_tcp_sendrecv_all_ports(apcupsd_t)
corenet_tcp_bind_all_nodes(apcupsd_t)
corenet_tcp_bind_apcupsd_port(apcupsd_t)
corenet_sendrecv_apcupsd_server_packets(apcupsd_t)
2007-09-06 18:34:40 +00:00
corenet_tcp_connect_apcupsd_port(apcupsd_t)
2007-05-07 14:55:54 +00:00
dev_rw_generic_usb_dev(apcupsd_t)
# Init script handling
domain_use_interactive_fds(apcupsd_t)
files_read_etc_files(apcupsd_t)
files_search_locks(apcupsd_t)
2007-09-06 18:34:40 +00:00
# Creates /etc/nologin
files_manage_etc_runtime_files(apcupsd_t)
files_etc_filetrans_etc_runtime(apcupsd_t,file)
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=240805
term_use_unallocated_ttys(apcupsd_t)
#apcupsd runs shutdown, probably need a shutdown domain
init_rw_utmp(apcupsd_t)
init_telinit(apcupsd_t)
2007-05-07 14:55:54 +00:00
logging_send_syslog_msg(apcupsd_t)
miscfiles_read_localization(apcupsd_t)
2008-10-08 15:50:03 +00:00
sysnet_dns_name_resolve(apcupsd_t)
2008-11-05 16:10:46 +00:00
userdom_use_user_ttys(apcupsd_t)
2008-10-08 15:50:03 +00:00
2007-09-06 18:34:40 +00:00
optional_policy(`
hostname_exec(apcupsd_t)
')
optional_policy(`
mta_send_mail(apcupsd_t)
2008-10-08 15:50:03 +00:00
mta_system_content(apcupsd_tmp_t)
2007-09-06 18:34:40 +00:00
')
########################################
#
# apcupsd_cgi Declarations
#
optional_policy(`
apache_content_template(apcupsd_cgi)
2008-10-17 15:52:39 +00:00
2007-09-06 18:34:40 +00:00
allow httpd_apcupsd_cgi_script_t self:tcp_socket create_stream_socket_perms;
allow httpd_apcupsd_cgi_script_t self:udp_socket create_socket_perms;
2008-10-17 15:52:39 +00:00
2007-09-06 18:34:40 +00:00
corenet_all_recvfrom_unlabeled(httpd_apcupsd_cgi_script_t)
corenet_all_recvfrom_netlabel(httpd_apcupsd_cgi_script_t)
corenet_tcp_sendrecv_all_if(httpd_apcupsd_cgi_script_t)
corenet_tcp_sendrecv_all_nodes(httpd_apcupsd_cgi_script_t)
corenet_tcp_sendrecv_all_ports(httpd_apcupsd_cgi_script_t)
corenet_tcp_connect_apcupsd_port(httpd_apcupsd_cgi_script_t)
corenet_udp_sendrecv_all_if(httpd_apcupsd_cgi_script_t)
corenet_udp_sendrecv_all_nodes(httpd_apcupsd_cgi_script_t)
corenet_udp_sendrecv_all_ports(httpd_apcupsd_cgi_script_t)
2008-10-17 15:52:39 +00:00
2007-09-06 18:34:40 +00:00
sysnet_dns_name_resolve(httpd_apcupsd_cgi_script_t)
')