Add nut from Stefan Schulze Frielinghaus and Miroslav Grepl.
This commit is contained in:
parent
4ebfec7303
commit
e526fca176
@ -1,6 +1,7 @@
|
||||
- X object manager revisions from Eamon Walsh.
|
||||
- Added modules:
|
||||
dbadm (KaiGai Kohei)
|
||||
nut (Stefan Schulze Frielinghaus, Miroslav Grepl)
|
||||
pyicqt (Stefan Schulze Frielinghaus)
|
||||
|
||||
* Tue Nov 17 2009 Chris PeBenito <selinux@tresys.com> - 2.20091117
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
policy_module(corenetwork, 1.13.2)
|
||||
policy_module(corenetwork, 1.13.3)
|
||||
|
||||
########################################
|
||||
#
|
||||
@ -191,6 +191,7 @@ network_port(tftp, udp,69,s0)
|
||||
network_port(tor, tcp,9001,s0, tcp,9030,s0, tcp,9050,s0)
|
||||
network_port(traceroute, udp,64000,s0, udp,64001,s0, udp,64002,s0, udp,64003,s0, udp,64004,s0, udp,64005,s0, udp,64006,s0, udp,64007,s0, udp,64008,s0, udp,64009,s0, udp,64010,s0)
|
||||
network_port(transproxy, tcp,8081,s0)
|
||||
network_port(ups, tcp,3493,s0)
|
||||
type utcpserver_port_t, port_type; dnl network_port(utcpserver) # no defined portcon
|
||||
network_port(uucpd, tcp,540,s0)
|
||||
network_port(varnishd, tcp,6081,s0, tcp,6082,s0)
|
||||
|
12
policy/modules/services/nut.fc
Normal file
12
policy/modules/services/nut.fc
Normal file
@ -0,0 +1,12 @@
|
||||
/etc/ups(/.*)? gen_context(system_u:object_r:nut_conf_t,s0)
|
||||
|
||||
/sbin/upsdrvctl -- gen_context(system_u:object_r:nut_upsdrvctl_exec_t,s0)
|
||||
|
||||
/usr/sbin/upsd -- gen_context(system_u:object_r:nut_upsd_exec_t,s0)
|
||||
/usr/sbin/upsmon -- gen_context(system_u:object_r:nut_upsmon_exec_t,s0)
|
||||
|
||||
/var/run/nut(/.*)? gen_context(system_u:object_r:nut_var_run_t,s0)
|
||||
|
||||
/var/www/nut-cgi-bin/upsimage\.cgi -- gen_context(system_u:object_r:httpd_nutups_cgi_script_exec_t,s0)
|
||||
/var/www/nut-cgi-bin/upsset\.cgi -- gen_context(system_u:object_r:httpd_nutups_cgi_script_exec_t,s0)
|
||||
/var/www/nut-cgi-bin/upsstats\.cgi -- gen_context(system_u:object_r:httpd_nutups_cgi_script_exec_t,s0)
|
1
policy/modules/services/nut.if
Normal file
1
policy/modules/services/nut.if
Normal file
@ -0,0 +1 @@
|
||||
## <summary>nut - Network UPS Tools </summary>
|
153
policy/modules/services/nut.te
Normal file
153
policy/modules/services/nut.te
Normal file
@ -0,0 +1,153 @@
|
||||
|
||||
policy_module(nut, 1.0.0)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Declarations
|
||||
#
|
||||
|
||||
type nut_conf_t;
|
||||
files_config_file(nut_conf_t)
|
||||
|
||||
type nut_upsd_t;
|
||||
type nut_upsd_exec_t;
|
||||
init_daemon_domain(nut_upsd_t, nut_upsd_exec_t)
|
||||
|
||||
type nut_upsmon_t;
|
||||
type nut_upsmon_exec_t;
|
||||
init_daemon_domain(nut_upsmon_t, nut_upsmon_exec_t)
|
||||
|
||||
type nut_upsdrvctl_t;
|
||||
type nut_upsdrvctl_exec_t;
|
||||
init_daemon_domain(nut_upsdrvctl_t, nut_upsdrvctl_exec_t)
|
||||
|
||||
type nut_var_run_t;
|
||||
files_pid_file(nut_var_run_t)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Local policy for upsd
|
||||
#
|
||||
|
||||
allow nut_upsd_t self:capability { setgid setuid };
|
||||
allow nut_upsd_t self:unix_dgram_socket { create_socket_perms sendto };
|
||||
allow nut_upsd_t self:tcp_socket connected_stream_socket_perms;
|
||||
|
||||
allow nut_upsd_t nut_upsdrvctl_t:unix_stream_socket connectto;
|
||||
|
||||
read_files_pattern(nut_upsd_t, nut_conf_t, nut_conf_t)
|
||||
|
||||
# pid file
|
||||
manage_files_pattern(nut_upsd_t, nut_var_run_t, nut_var_run_t)
|
||||
manage_dirs_pattern(nut_upsd_t, nut_var_run_t, nut_var_run_t)
|
||||
manage_sock_files_pattern(nut_upsd_t, nut_var_run_t, nut_var_run_t)
|
||||
files_pid_filetrans(nut_upsd_t, nut_var_run_t, { file sock_file })
|
||||
|
||||
kernel_read_kernel_sysctls(nut_upsd_t)
|
||||
|
||||
corenet_tcp_bind_ups_port(nut_upsd_t)
|
||||
corenet_tcp_bind_generic_port(nut_upsd_t)
|
||||
corenet_tcp_bind_all_nodes(nut_upsd_t)
|
||||
|
||||
files_read_usr_files(nut_upsd_t)
|
||||
|
||||
auth_use_nsswitch(nut_upsd_t)
|
||||
|
||||
logging_send_syslog_msg(nut_upsd_t)
|
||||
|
||||
miscfiles_read_localization(nut_upsd_t)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Local policy for upsmon
|
||||
#
|
||||
|
||||
allow nut_upsmon_t self:capability { dac_override dac_read_search setgid setuid };
|
||||
allow nut_upsmon_t self:fifo_file rw_fifo_file_perms;
|
||||
allow nut_upsmon_t self:unix_dgram_socket { create_socket_perms sendto };
|
||||
allow nut_upsmon_t self:tcp_socket create_socket_perms;
|
||||
|
||||
read_files_pattern(nut_upsmon_t, nut_conf_t, nut_conf_t)
|
||||
|
||||
# pid file
|
||||
manage_files_pattern(nut_upsmon_t, nut_var_run_t, nut_var_run_t)
|
||||
manage_dirs_pattern(nut_upsmon_t, nut_var_run_t, nut_var_run_t)
|
||||
files_pid_filetrans(nut_upsmon_t, nut_var_run_t, file)
|
||||
|
||||
kernel_read_kernel_sysctls(nut_upsmon_t)
|
||||
kernel_read_system_state(nut_upsmon_t)
|
||||
|
||||
corecmd_exec_bin(nut_upsmon_t)
|
||||
corecmd_exec_shell(nut_upsmon_t)
|
||||
|
||||
corenet_tcp_connect_ups_port(nut_upsmon_t)
|
||||
corenet_tcp_connect_generic_port(nut_upsmon_t)
|
||||
|
||||
# Creates /etc/killpower
|
||||
files_manage_etc_runtime_files(nut_upsmon_t)
|
||||
files_etc_filetrans_etc_runtime(nut_upsmon_t, file)
|
||||
|
||||
# /usr/bin/wall
|
||||
term_write_all_terms(nut_upsmon_t)
|
||||
|
||||
# upsmon runs shutdown, probably need a shutdown domain
|
||||
init_rw_utmp(nut_upsmon_t)
|
||||
init_telinit(nut_upsmon_t)
|
||||
|
||||
logging_send_syslog_msg(nut_upsmon_t)
|
||||
|
||||
auth_use_nsswitch(nut_upsmon_t)
|
||||
|
||||
miscfiles_read_localization(nut_upsmon_t)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Local policy for upsdrvctl
|
||||
#
|
||||
|
||||
allow nut_upsdrvctl_t self:capability { dac_override kill setgid setuid };
|
||||
allow nut_upsdrvctl_t self:process { sigchld signal signull };
|
||||
allow nut_upsdrvctl_t self:fd use;
|
||||
allow nut_upsdrvctl_t self:fifo_file rw_fifo_file_perms;
|
||||
allow nut_upsdrvctl_t self:unix_dgram_socket { create_socket_perms sendto };
|
||||
allow nut_upsdrvctl_t self:udp_socket create_socket_perms;
|
||||
|
||||
read_files_pattern(nut_upsdrvctl_t, nut_conf_t, nut_conf_t)
|
||||
|
||||
# pid file
|
||||
manage_files_pattern(nut_upsdrvctl_t, nut_var_run_t, nut_var_run_t)
|
||||
manage_dirs_pattern(nut_upsdrvctl_t, nut_var_run_t, nut_var_run_t)
|
||||
manage_sock_files_pattern(nut_upsdrvctl_t, nut_var_run_t, nut_var_run_t)
|
||||
files_pid_filetrans(nut_upsdrvctl_t, nut_var_run_t, { file sock_file })
|
||||
|
||||
kernel_read_kernel_sysctls(nut_upsdrvctl_t)
|
||||
|
||||
# /sbin/upsdrvctl executes other drivers
|
||||
corecmd_exec_bin(nut_upsdrvctl_t)
|
||||
|
||||
dev_read_urand(nut_upsdrvctl_t)
|
||||
dev_rw_generic_usb_dev(nut_upsdrvctl_t)
|
||||
|
||||
term_use_unallocated_ttys(nut_upsdrvctl_t)
|
||||
|
||||
auth_use_nsswitch(nut_upsdrvctl_t)
|
||||
|
||||
init_sigchld(nut_upsdrvctl_t)
|
||||
|
||||
logging_send_syslog_msg(nut_upsdrvctl_t)
|
||||
|
||||
miscfiles_read_localization(nut_upsdrvctl_t)
|
||||
|
||||
#######################################
|
||||
#
|
||||
# Local policy for upscgi scripts
|
||||
# requires httpd_enable_cgi and httpd_can_network_connect
|
||||
#
|
||||
|
||||
optional_policy(`
|
||||
apache_content_template(nutups_cgi)
|
||||
|
||||
read_files_pattern(httpd_nutups_cgi_script_t, nut_conf_t, nut_conf_t)
|
||||
|
||||
corenet_tcp_connect_ups_port(httpd_nutups_cgi_script_t)
|
||||
')
|
Loading…
Reference in New Issue
Block a user