selinux-refpolicy/policy/modules/services/openhpi.te
Stephen Smalley 161bda392e access_vectors: Remove unused permissions
Remove unused permission definitions from SELinux.
Many of these were only ever used in pre-mainline
versions of SELinux, prior to Linux 2.6.0.  Some of them
were used in the legacy network or compat_net=1 checks
that were disabled by default in Linux 2.6.18 and
fully removed in Linux 2.6.30.

The corresponding classmap declarations were removed from the
mainline kernel in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42a9699a9fa179c0054ea3cf5ad3cc67104a6162

Permissions never used in mainline Linux:
file swapon
filesystem transition
tcp_socket { connectto newconn acceptfrom }
node enforce_dest
unix_stream_socket { newconn acceptfrom }

Legacy network checks, removed in 2.6.30:
socket { recv_msg send_msg }
node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:41:50 -05:00

57 lines
1.6 KiB
Plaintext

policy_module(openhpi, 1.4.1)
########################################
#
# Declarations
#
type openhpid_t;
type openhpid_exec_t;
init_daemon_domain(openhpid_t, openhpid_exec_t)
type openhpid_initrc_exec_t;
init_script_file(openhpid_initrc_exec_t)
type openhpid_runtime_t alias openhpid_var_run_t;
files_pid_file(openhpid_runtime_t)
type openhpid_var_lib_t;
files_type(openhpid_var_lib_t)
########################################
#
# Local policy
#
allow openhpid_t self:capability kill;
allow openhpid_t self:process signal;
allow openhpid_t self:fifo_file rw_fifo_file_perms;
allow openhpid_t self:netlink_route_socket r_netlink_socket_perms;
allow openhpid_t self:unix_stream_socket { accept listen };
allow openhpid_t self:tcp_socket create_stream_socket_perms;
allow openhpid_t self:udp_socket create_socket_perms;
manage_dirs_pattern(openhpid_t, openhpid_var_lib_t, openhpid_var_lib_t)
manage_files_pattern(openhpid_t, openhpid_var_lib_t, openhpid_var_lib_t)
files_var_lib_filetrans(openhpid_t, openhpid_var_lib_t, dir)
manage_files_pattern(openhpid_t, openhpid_runtime_t, openhpid_runtime_t)
files_pid_filetrans(openhpid_t, openhpid_runtime_t, file)
corenet_all_recvfrom_unlabeled(openhpid_t)
corenet_all_recvfrom_netlabel(openhpid_t)
corenet_tcp_sendrecv_generic_if(openhpid_t)
corenet_tcp_sendrecv_generic_node(openhpid_t)
corenet_tcp_bind_generic_node(openhpid_t)
corenet_sendrecv_openhpid_server_packets(openhpid_t)
corenet_tcp_bind_openhpid_port(openhpid_t)
dev_read_urand(openhpid_t)
files_read_etc_files(openhpid_t)
logging_send_syslog_msg(openhpid_t)
miscfiles_read_localization(openhpid_t)