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.
101 lines
2.6 KiB
Plaintext
101 lines
2.6 KiB
Plaintext
|
|
policy_module(ucspitcp,1.1.1)
|
|
|
|
########################################
|
|
#
|
|
# Declarations
|
|
#
|
|
|
|
type rblsmtpd_t;
|
|
type rblsmtpd_exec_t;
|
|
init_system_domain(rblsmtpd_t,rblsmtpd_exec_t)
|
|
role system_r types rblsmtpd_t;
|
|
|
|
type ucspitcp_t;
|
|
type ucspitcp_exec_t;
|
|
init_system_domain(ucspitcp_t,ucspitcp_exec_t)
|
|
role system_r types ucspitcp_t;
|
|
|
|
########################################
|
|
#
|
|
# Local policy for rblsmtpd
|
|
#
|
|
|
|
ucspitcp_service_domain(rblsmtpd_t, rblsmtpd_exec_t)
|
|
|
|
corecmd_search_bin(rblsmtpd_t)
|
|
|
|
corenet_all_recvfrom_unlabeled(rblsmtpd_t)
|
|
corenet_all_recvfrom_netlabel(rblsmtpd_t)
|
|
corenet_tcp_sendrecv_all_if(rblsmtpd_t)
|
|
corenet_udp_sendrecv_all_if(rblsmtpd_t)
|
|
corenet_tcp_sendrecv_all_nodes(rblsmtpd_t)
|
|
corenet_udp_sendrecv_all_nodes(rblsmtpd_t)
|
|
corenet_tcp_sendrecv_all_ports(rblsmtpd_t)
|
|
corenet_udp_sendrecv_all_ports(rblsmtpd_t)
|
|
corenet_tcp_bind_all_nodes(rblsmtpd_t)
|
|
corenet_udp_bind_generic_port(rblsmtpd_t)
|
|
|
|
files_read_etc_files(rblsmtpd_t)
|
|
files_search_var(rblsmtpd_t)
|
|
|
|
libs_use_ld_so(rblsmtpd_t)
|
|
libs_use_shared_libs(rblsmtpd_t)
|
|
|
|
optional_policy(`
|
|
daemontools_ipc_domain(rblsmtpd_t)
|
|
')
|
|
|
|
########################################
|
|
#
|
|
# Local policy for tcpserver
|
|
#
|
|
|
|
allow ucspitcp_t self:capability { setgid setuid };
|
|
allow ucspitcp_t self:fifo_file { read write };
|
|
allow ucspitcp_t self:tcp_socket create_stream_socket_perms;
|
|
allow ucspitcp_t self:udp_socket create_socket_perms;
|
|
|
|
corecmd_search_bin(ucspitcp_t)
|
|
|
|
# base networking:
|
|
corenet_all_recvfrom_unlabeled(ucspitcp_t)
|
|
corenet_all_recvfrom_netlabel(ucspitcp_t)
|
|
corenet_tcp_sendrecv_all_if(ucspitcp_t)
|
|
corenet_udp_sendrecv_all_if(ucspitcp_t)
|
|
corenet_tcp_sendrecv_all_nodes(ucspitcp_t)
|
|
corenet_udp_sendrecv_all_nodes(ucspitcp_t)
|
|
corenet_tcp_sendrecv_all_ports(ucspitcp_t)
|
|
corenet_udp_sendrecv_all_ports(ucspitcp_t)
|
|
corenet_tcp_bind_all_nodes(ucspitcp_t)
|
|
corenet_udp_bind_all_nodes(ucspitcp_t)
|
|
|
|
# server ports:
|
|
corenet_tcp_bind_ftp_port(ucspitcp_t)
|
|
corenet_tcp_bind_ftp_data_port(ucspitcp_t)
|
|
corenet_tcp_bind_http_port(ucspitcp_t)
|
|
corenet_tcp_bind_smtp_port(ucspitcp_t)
|
|
corenet_tcp_bind_dns_port(ucspitcp_t)
|
|
corenet_udp_bind_dns_port(ucspitcp_t)
|
|
corenet_udp_bind_generic_port(ucspitcp_t)
|
|
|
|
# server packets:
|
|
corenet_sendrecv_ftp_server_packets(ucspitcp_t)
|
|
corenet_sendrecv_http_server_packets(ucspitcp_t)
|
|
corenet_sendrecv_smtp_server_packets(ucspitcp_t)
|
|
corenet_sendrecv_dns_server_packets(ucspitcp_t)
|
|
corenet_sendrecv_generic_server_packets(ucspitcp_t)
|
|
|
|
files_search_var(ucspitcp_t)
|
|
files_read_etc_files(ucspitcp_t)
|
|
|
|
libs_use_ld_so(ucspitcp_t)
|
|
libs_use_shared_libs(ucspitcp_t)
|
|
|
|
sysnet_read_config(ucspitcp_t)
|
|
|
|
optional_policy(`
|
|
daemontools_service_domain(ucspitcp_t,ucspitcp_exec_t)
|
|
daemontools_read_svc(ucspitcp_t)
|
|
')
|