|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
policy_module(portreserve, 1.0.0)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
########################################
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
# Declarations
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
type portreserve_t;
|
|
Chris PeBenito |
a5ef55 |
type portreserve_exec_t;
|
|
Chris PeBenito |
a5ef55 |
init_daemon_domain(portreserve_t, portreserve_exec_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
type portreserve_etc_t;
|
|
Chris PeBenito |
a5ef55 |
files_type(portreserve_etc_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
type portreserve_var_run_t;
|
|
Chris PeBenito |
a5ef55 |
files_pid_file(portreserve_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
########################################
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
# Portreserve local policy
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
allow portreserve_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
a5ef55 |
allow portreserve_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
a5ef55 |
allow portreserve_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
Chris PeBenito |
a5ef55 |
allow portreserve_t self:tcp_socket create_socket_perms;
|
|
Chris PeBenito |
a5ef55 |
allow portreserve_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# Read etc files
|
|
Chris PeBenito |
a5ef55 |
list_dirs_pattern(portreserve_t, portreserve_etc_t, portreserve_etc_t)
|
|
Chris PeBenito |
a5ef55 |
read_files_pattern(portreserve_t, portreserve_etc_t, portreserve_etc_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# Manage /var/run/portreserve/*
|
|
Chris PeBenito |
a5ef55 |
manage_dirs_pattern(portreserve_t, portreserve_var_run_t, portreserve_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
manage_files_pattern(portreserve_t, portreserve_var_run_t, portreserve_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
manage_sock_files_pattern(portreserve_t, portreserve_var_run_t, portreserve_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
files_pid_filetrans(portreserve_t, portreserve_var_run_t, { file sock_file })
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_bind_generic_node(portreserve_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_udp_bind_generic_node(portreserve_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_bind_all_reserved_ports(portreserve_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_udp_bind_all_reserved_ports(portreserve_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
files_read_etc_files(portreserve_t)
|