1900668638
The latest revision of the labeled policy patches which enable both labeled and unlabeled policy support for NetLabel. This revision takes into account Chris' feedback from the first version and reduces the number of interface calls in each domain down to two at present: one for unlabeled access, one for NetLabel access. The older, transport layer specific interfaces, are still present for use by third-party modules but are not used in the default policy modules. trunk: Use netmsg initial SID for MLS-only Netlabel packets, from Paul Moore. This patch changes the policy to use the netmsg initial SID as the "base" SID/context for NetLabel packets which only have MLS security attributes. Currently we use the unlabeled initial SID which makes it very difficult to distinquish between actual unlabeled packets and those packets which have MLS security attributes.
70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
|
|
policy_module(apcupsd,1.0.2)
|
|
|
|
########################################
|
|
#
|
|
# 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)
|
|
|
|
type apcupsd_log_t;
|
|
logging_log_file(apcupsd_log_t)
|
|
|
|
type apcupsd_var_run_t;
|
|
files_pid_file(apcupsd_var_run_t)
|
|
|
|
########################################
|
|
#
|
|
# apcupsd local policy
|
|
#
|
|
|
|
allow apcupsd_t self:process signal;
|
|
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 })
|
|
|
|
manage_files_pattern(apcupsd_t,apcupsd_var_run_t,apcupsd_var_run_t)
|
|
files_pid_filetrans(apcupsd_t,apcupsd_var_run_t, file)
|
|
|
|
corenet_all_recvfrom_unlabeled(apcupsd_t)
|
|
corenet_all_recvfrom_netlabel(apcupsd_t)
|
|
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)
|
|
|
|
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)
|
|
|
|
libs_use_ld_so(apcupsd_t)
|
|
libs_use_shared_libs(apcupsd_t)
|
|
|
|
logging_send_syslog_msg(apcupsd_t)
|
|
|
|
miscfiles_read_localization(apcupsd_t)
|
|
|
|
ifdef(`targeted_policy',`
|
|
term_dontaudit_use_unallocated_ttys(apcupsd_t)
|
|
term_dontaudit_use_generic_ptys(apcupsd_t)
|
|
')
|