Chris PeBenito 134191b
# Copyright (C) 2005 Tresys Technology, LLC
Chris PeBenito 134191b
Chris PeBenito 134191b
ifdef(`enable_mls',`
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Define sensitivities 
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Each sensitivity has a name and zero or more aliases.
Chris PeBenito 134191b
#
Chris PeBenito 134191b
sensitivity s0;
Chris PeBenito 134191b
sensitivity s1;
Chris PeBenito 134191b
sensitivity s2;
Chris PeBenito 134191b
sensitivity s3;
Chris PeBenito 134191b
sensitivity s4;
Chris PeBenito 134191b
sensitivity s5;
Chris PeBenito 134191b
sensitivity s6;
Chris PeBenito 134191b
sensitivity s7;
Chris PeBenito 134191b
sensitivity s8;
Chris PeBenito 134191b
sensitivity s9;
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Define the ordering of the sensitivity levels (least to greatest)
Chris PeBenito 134191b
#
Chris PeBenito 134191b
dominance { s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 }
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Define the categories
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Each category has a name and zero or more aliases.
Chris PeBenito 134191b
#
Chris PeBenito 134191b
category c0;
Chris PeBenito 134191b
category c1;
Chris PeBenito 134191b
category c2;
Chris PeBenito 134191b
category c3;
Chris PeBenito 134191b
category c4;
Chris PeBenito 134191b
category c5;
Chris PeBenito 134191b
category c6;
Chris PeBenito 134191b
category c7;
Chris PeBenito 134191b
category c8;
Chris PeBenito 134191b
category c9;
Chris PeBenito 134191b
category c10;
Chris PeBenito 134191b
category c11;
Chris PeBenito 134191b
category c12;
Chris PeBenito 134191b
category c13;
Chris PeBenito 134191b
category c14;
Chris PeBenito 134191b
category c15;
Chris PeBenito 134191b
category c16;
Chris PeBenito 134191b
category c17;
Chris PeBenito 134191b
category c18;
Chris PeBenito 134191b
category c19;
Chris PeBenito 134191b
category c20;
Chris PeBenito 134191b
category c21;
Chris PeBenito 134191b
category c22;
Chris PeBenito 134191b
category c23;
Chris PeBenito 134191b
category c24;
Chris PeBenito 134191b
category c25;
Chris PeBenito 134191b
category c26;
Chris PeBenito 134191b
category c27;
Chris PeBenito 134191b
category c28;
Chris PeBenito 134191b
category c29;
Chris PeBenito 134191b
category c30;
Chris PeBenito 134191b
category c31;
Chris PeBenito 134191b
category c32;
Chris PeBenito 134191b
category c33;
Chris PeBenito 134191b
category c34;
Chris PeBenito 134191b
category c35;
Chris PeBenito 134191b
category c36;
Chris PeBenito 134191b
category c37;
Chris PeBenito 134191b
category c38;
Chris PeBenito 134191b
category c39;
Chris PeBenito 134191b
category c40;
Chris PeBenito 134191b
category c41;
Chris PeBenito 134191b
category c42;
Chris PeBenito 134191b
category c43;
Chris PeBenito 134191b
category c44;
Chris PeBenito 134191b
category c45;
Chris PeBenito 134191b
category c46;
Chris PeBenito 134191b
category c47;
Chris PeBenito 134191b
category c48;
Chris PeBenito 134191b
category c49;
Chris PeBenito 134191b
category c50;
Chris PeBenito 134191b
category c51;
Chris PeBenito 134191b
category c52;
Chris PeBenito 134191b
category c53;
Chris PeBenito 134191b
category c54;
Chris PeBenito 134191b
category c55;
Chris PeBenito 134191b
category c56;
Chris PeBenito 134191b
category c57;
Chris PeBenito 134191b
category c58;
Chris PeBenito 134191b
category c59;
Chris PeBenito 134191b
category c60;
Chris PeBenito 134191b
category c61;
Chris PeBenito 134191b
category c62;
Chris PeBenito 134191b
category c63;
Chris PeBenito 134191b
category c64;
Chris PeBenito 134191b
category c65;
Chris PeBenito 134191b
category c66;
Chris PeBenito 134191b
category c67;
Chris PeBenito 134191b
category c68;
Chris PeBenito 134191b
category c69;
Chris PeBenito 134191b
category c70;
Chris PeBenito 134191b
category c71;
Chris PeBenito 134191b
category c72;
Chris PeBenito 134191b
category c73;
Chris PeBenito 134191b
category c74;
Chris PeBenito 134191b
category c75;
Chris PeBenito 134191b
category c76;
Chris PeBenito 134191b
category c77;
Chris PeBenito 134191b
category c78;
Chris PeBenito 134191b
category c79;
Chris PeBenito 134191b
category c80;
Chris PeBenito 134191b
category c81;
Chris PeBenito 134191b
category c82;
Chris PeBenito 134191b
category c83;
Chris PeBenito 134191b
category c84;
Chris PeBenito 134191b
category c85;
Chris PeBenito 134191b
category c86;
Chris PeBenito 134191b
category c87;
Chris PeBenito 134191b
category c88;
Chris PeBenito 134191b
category c89;
Chris PeBenito 134191b
category c90;
Chris PeBenito 134191b
category c91;
Chris PeBenito 134191b
category c92;
Chris PeBenito 134191b
category c93;
Chris PeBenito 134191b
category c94;
Chris PeBenito 134191b
category c95;
Chris PeBenito 134191b
category c96;
Chris PeBenito 134191b
category c97;
Chris PeBenito 134191b
category c98;
Chris PeBenito 134191b
category c99;
Chris PeBenito 134191b
category c100;
Chris PeBenito 134191b
category c101;
Chris PeBenito 134191b
category c102;
Chris PeBenito 134191b
category c103;
Chris PeBenito 134191b
category c104;
Chris PeBenito 134191b
category c105;
Chris PeBenito 134191b
category c106;
Chris PeBenito 134191b
category c107;
Chris PeBenito 134191b
category c108;
Chris PeBenito 134191b
category c109;
Chris PeBenito 134191b
category c110;
Chris PeBenito 134191b
category c111;
Chris PeBenito 134191b
category c112;
Chris PeBenito 134191b
category c113;
Chris PeBenito 134191b
category c114;
Chris PeBenito 134191b
category c115;
Chris PeBenito 134191b
category c116;
Chris PeBenito 134191b
category c117;
Chris PeBenito 134191b
category c118;
Chris PeBenito 134191b
category c119;
Chris PeBenito 134191b
category c120;
Chris PeBenito 134191b
category c121;
Chris PeBenito 134191b
category c122;
Chris PeBenito 134191b
category c123;
Chris PeBenito 134191b
category c124;
Chris PeBenito 134191b
category c125;
Chris PeBenito 134191b
category c126;
Chris PeBenito 134191b
category c127;
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Each MLS level specifies a sensitivity and zero or more categories which may
Chris PeBenito 134191b
# be associated with that sensitivity.
Chris PeBenito 134191b
#
Chris PeBenito 134191b
level s0:c0.c127;
Chris PeBenito 134191b
level s1:c0.c127;
Chris PeBenito 134191b
level s2:c0.c127;
Chris PeBenito 134191b
level s3:c0.c127;
Chris PeBenito 134191b
level s4:c0.c127;
Chris PeBenito 134191b
level s5:c0.c127;
Chris PeBenito 134191b
level s6:c0.c127;
Chris PeBenito 134191b
level s7:c0.c127;
Chris PeBenito 134191b
level s8:c0.c127;
Chris PeBenito 134191b
level s9:c0.c127;
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# Define the MLS policy
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# mlsconstrain class_set perm_set expression ;
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# mlsvalidatetrans class_set expression ;
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# expression : ( expression )
Chris PeBenito 134191b
#	     | not expression
Chris PeBenito 134191b
#	     | expression and expression
Chris PeBenito 134191b
#	     | expression or expression
Chris PeBenito 134191b
#	     | u1 op u2
Chris PeBenito 134191b
#	     | r1 role_mls_op r2
Chris PeBenito 134191b
#	     | t1 op t2
Chris PeBenito 134191b
#	     | l1 role_mls_op l2
Chris PeBenito 134191b
#	     | l1 role_mls_op h2
Chris PeBenito 134191b
#	     | h1 role_mls_op l2
Chris PeBenito 134191b
#	     | h1 role_mls_op h2
Chris PeBenito 134191b
#	     | l1 role_mls_op h1
Chris PeBenito 134191b
#	     | l2 role_mls_op h2
Chris PeBenito 134191b
#	     | u1 op names
Chris PeBenito 134191b
#	     | u2 op names
Chris PeBenito 134191b
#	     | r1 op names
Chris PeBenito 134191b
#	     | r2 op names
Chris PeBenito 134191b
#	     | t1 op names
Chris PeBenito 134191b
#	     | t2 op names
Chris PeBenito 134191b
#	     | u3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191b
#	     | r3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191b
#	     | t3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# op : == | !=
Chris PeBenito 134191b
# role_mls_op : == | != | eq | dom | domby | incomp
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# names : name | { name_list }
Chris PeBenito 134191b
# name_list : name | name_list name#
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the file classes
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# make sure these file classes are "single level"
Chris PeBenito 134191b
mlsconstrain { file lnk_file fifo_file } { create relabelto }
Chris PeBenito 134191b
	( l2 eq h2 );
Chris PeBenito 134191b
Chris PeBenito 134191b
# new file labels must be dominated by the relabling subject clearance
Chris PeBenito 134191b
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } relabelto
Chris PeBenito 134191b
	( h1 dom h2 );
Chris PeBenito 134191b
Chris PeBenito 134191b
# the file "read" ops (note the check is dominance of the low level)
Chris PeBenito 134191b
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { read getattr execute }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfileread ) or
Chris PeBenito 134191b
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain dir search
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfileread ) or
Chris PeBenito 134191b
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the "single level" file "write" ops
Chris PeBenito 134191b
mlsconstrain { file lnk_file fifo_file } { write create setattr relabelfrom append unlink link rename mounton }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfilewrite ) or
Chris PeBenito 134191b
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the "ranged" file "write" ops
Chris PeBenito 134191b
mlsconstrain { dir chr_file blk_file sock_file } { write create setattr relabelfrom append unlink link rename mounton }
Chris PeBenito 134191b
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191b
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfilewrite ) or
Chris PeBenito 134191b
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain dir { add_name remove_name reparent rmdir }
Chris PeBenito 134191b
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191b
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfilewrite ) or
Chris PeBenito 134191b
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# { dir file lnk_file chr_file blk_file sock_file fifo_file } { ioctl lock swapon quotaon }
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# file { execute_no_trans entrypoint }
Chris PeBenito 134191b
Chris PeBenito 134191b
# the file upgrade/downgrade rule
Chris PeBenito 134191b
mlsvalidatetrans { file lnk_file chr_file blk_file sock_file fifo_file }
Chris PeBenito 134191b
	((( l1 eq l2 ) or
Chris PeBenito 134191b
	  (( t3 == mlsfileupgrade ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	  (( t3 == mlsfiledowngrade ) and ( l1 dom l2 )) or
Chris PeBenito 134191b
	  (( t3 == mlsfiledowngrade ) and ( l1 incomp l2 ))) and
Chris PeBenito 134191b
	 (( h1 eq h2 ) or
Chris PeBenito 134191b
	  (( t3 == mlsfileupgrade ) and ( h1 domby h2 )) or
Chris PeBenito 134191b
	  (( t3 == mlsfiledowngrade ) and ( h1 dom h2 )) or
Chris PeBenito 134191b
	  (( t3 == mlsfiledowngrade ) and ( h1 incomp h2 ))));
Chris PeBenito 134191b
Chris PeBenito 134191b
# create can also require the upgrade/downgrade checks if the creating process
Chris PeBenito 134191b
# has used setfscreate (note that both the high and low level of the object
Chris PeBenito 134191b
# default to the process sensitivity level)
Chris PeBenito 134191b
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } create
Chris PeBenito 134191b
	((( l1 eq l2 ) or
Chris PeBenito 134191b
	  (( t1 == mlsfileupgrade ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	  (( t1 == mlsfiledowngrade ) and ( l1 dom l2 )) or
Chris PeBenito 134191b
	  (( t1 == mlsfiledowngrade ) and ( l1 incomp l2 ))) and
Chris PeBenito 134191b
	 (( l1 eq h2 ) or
Chris PeBenito 134191b
	  (( t1 == mlsfileupgrade ) and ( l1 domby h2 )) or
Chris PeBenito 134191b
	  (( t1 == mlsfiledowngrade ) and ( l1 dom h2 )) or
Chris PeBenito 134191b
	  (( t1 == mlsfiledowngrade ) and ( l1 incomp h2 ))));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the filesystem class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# new filesystem labels must be dominated by the relabling subject clearance
Chris PeBenito 134191b
mlsconstrain filesystem relabelto
Chris PeBenito 134191b
	( h1 dom h2 );
Chris PeBenito 134191b
Chris PeBenito 134191b
# the filesystem "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain filesystem { getattr quotaget }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfileread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# all the filesystem "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain filesystem { mount remount unmount relabelfrom quotamod }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsfilewrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# filesystem { transition associate }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the socket classes
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# new socket labels must be dominated by the relabling subject clearance
Chris PeBenito 134191b
mlsconstrain { socket tcp_socket udp_socket rawip_socket netlink_socket packet_socket key_socket unix_stream_socket unix_dgram_socket netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_nflog_socket netlink_xfrm_socket netlink_selinux_socket netlink_audit_socket netlink_ip6fw_socket netlink_dnrt_socket } relabelto
Chris PeBenito 134191b
	( h1 dom h2 );
Chris PeBenito 134191b
Chris PeBenito 134191b
# the socket "read" ops (note that the we check dominance of the low level)
Chris PeBenito 134191b
mlsconstrain { socket tcp_socket udp_socket rawip_socket netlink_socket packet_socket key_socket unix_stream_socket unix_dgram_socket netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_nflog_socket netlink_xfrm_socket netlink_selinux_socket netlink_audit_socket netlink_ip6fw_socket netlink_dnrt_socket } { read getattr listen accept getopt recvfrom recv_msg }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsnetread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain { tcp_socket unix_stream_socket } acceptfrom
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsnetread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain { netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_xfrm_socket netlink_audit_socket netlink_ip6fw_socket } nlmsg_read
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsnetread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the socket "write" ops
Chris PeBenito 134191b
mlsconstrain { socket tcp_socket udp_socket rawip_socket netlink_socket packet_socket key_socket unix_stream_socket unix_dgram_socket netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_nflog_socket netlink_xfrm_socket netlink_selinux_socket netlink_audit_socket netlink_ip6fw_socket netlink_dnrt_socket } { setattr relabelfrom connect setopt shutdown }
Chris PeBenito 134191b
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191b
	 (( t1 == mlsnetwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsnetwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain { tcp_socket unix_stream_socket } { connectto newconn }
Chris PeBenito 134191b
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191b
	 (( t1 == mlsnetwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsnetwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# { socket tcp_socket udp_socket rawip_socket netlink_socket packet_socket key_socket unix_stream_socket unix_dgram_socket netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_nflog_socket netlink_xfrm_socket netlink_selinux_socket netlink_audit_socket netlink_ip6fw_socket netlink_dnrt_socket } { ioctl write create lock append bind sendto send_msg name_bind }
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# { tcp_socket udp_socket rawip_socket } node_bind
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# { netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_xfrm_socket netlink_audit_socket netlink_ip6fw_socket } nlmsg_write
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the ipc classes
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the ipc "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain { ipc sem msgq shm } { getattr read unix_read }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain msg receive
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the ipc "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain { ipc sem msgq shm } { create destroy setattr write unix_write }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain msgq enqueue
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain shm lock
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
mlsconstrain msg send
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# { ipc sem msgq shm } associate
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the fd class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# fd use
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the node class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send enforce_dest }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the netif class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send enforce_dest }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the process class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# new process labels must be dominated by the relabling subject clearance and
Chris PeBenito 134191b
# sensitivity level changes require privilege
Chris PeBenito 134191b
mlsconstrain process { transition dyntransition }
Chris PeBenito 134191b
	(( h1 dom h2 ) and
Chris PeBenito 134191b
	 (( l1 eq l2 ) or ( t1 == mlsprocsetsl )));
Chris PeBenito 134191b
Chris PeBenito 134191b
# all the process "read" ops
Chris PeBenito 134191b
mlsconstrain process { getsched getsession getpgid getcap getattr ptrace share }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsprocreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsprocread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# all the process "write" ops (note the check is equality on the low level)
Chris PeBenito 134191b
mlsconstrain process { sigkill sigstop signal setsched setpgid setcap setexec setfscreate setcurrent ptrace share }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsprocwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsprocwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# process { fork sigchld signull noatsecure siginh setrlimit rlimitinh}
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the security class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# security *
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the system class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# system *
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the capability class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# capability *
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the passwd class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# passwd *
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the drawable class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the drawable "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain drawable { getattr copy }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the drawable "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain drawable { create destroy draw copy }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the gc class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the gc "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain gc getattr
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the gc "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain gc { create free setattr }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the window class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the window "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain window { listprop getattr enumerate mousemotion inputevent drawevent windowchangeevent windowchangerequest serverchangeevent extensionevent }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the window "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain window { addchild create destroy chstack chproplist chprop setattr setfocus move chselection chparent ctrllife transparent clientcomevent }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# window { map unmap }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the font class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the font "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain font { load getattr }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the font "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain font free
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# font use
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the colormap class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the colormap "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain colormap { list read getattr }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the colormap "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain colormap { create free install uninstall store setattr }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the property class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the property "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain property { read }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the property "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain property { create free write }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the cursor class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the cursor "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain cursor { create createglyph free assign setattr }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the xclient class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xclient "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xclient kill
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the xinput class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xinput "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xinput { lookup getattr mousemotion }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xinput "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xinput { setattr setfocus warppointer activegrab passivegrab ungrab bell relabelinput }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the xserver class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xserver "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xserver { gethostlist getfontpath getattr screensaver }
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xserver "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xserver { sethostlist setfontpath grab ungrab screensaver }
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the xextension class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xextension "read" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xextension query
Chris PeBenito 134191b
	(( l1 dom l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191b
Chris PeBenito 134191b
# the xextension "write" ops (implicit single level)
Chris PeBenito 134191b
mlsconstrain xextension use
Chris PeBenito 134191b
	(( l1 eq l2 ) or
Chris PeBenito 134191b
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191b
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the pax class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# pax { pageexec emutramp mprotect randmmap randexec segmexec }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the dbus class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# dbus { acquire_svc send_msg }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the nscd class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# nscd { getpwd getgrp gethost getstat admin shmempwd shmemgrp shmemhost }
Chris PeBenito 134191b
Chris PeBenito 134191b
Chris PeBenito 134191b
#
Chris PeBenito 134191b
# MLS policy for the association class
Chris PeBenito 134191b
#
Chris PeBenito 134191b
Chris PeBenito 134191b
# these access vectors have no MLS restrictions
Chris PeBenito 134191b
# association { sendto recvfrom }
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlsfileread;
Chris PeBenito 134191b
attribute mlsfilereadtoclr;
Chris PeBenito 134191b
attribute mlsfilewrite;
Chris PeBenito 134191b
attribute mlsfilewritetoclr;
Chris PeBenito 134191b
attribute mlsfileupgrade;
Chris PeBenito 134191b
attribute mlsfiledowngrade;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlsnetread;
Chris PeBenito 134191b
attribute mlsnetreadtoclr;
Chris PeBenito 134191b
attribute mlsnetwrite;
Chris PeBenito 134191b
attribute mlsnetwritetoclr;
Chris PeBenito 134191b
attribute mlsnetupgrade;
Chris PeBenito 134191b
attribute mlsnetdowngrade;
Chris PeBenito 134191b
attribute mlsnetbindall;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlsipcread;
Chris PeBenito 134191b
attribute mlsipcreadtoclr;
Chris PeBenito 134191b
attribute mlsipcwrite;
Chris PeBenito 134191b
attribute mlsipcwritetoclr;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlsprocread;
Chris PeBenito 134191b
attribute mlsprocreadtoclr;
Chris PeBenito 134191b
attribute mlsprocwrite;
Chris PeBenito 134191b
attribute mlsprocwritetoclr;
Chris PeBenito 134191b
attribute mlsprocsetsl;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlsxwinread;
Chris PeBenito 134191b
attribute mlsxwinreadtoclr;
Chris PeBenito 134191b
attribute mlsxwinwrite;
Chris PeBenito 134191b
attribute mlsxwinwritetoclr;
Chris PeBenito 134191b
attribute mlsxwinupgrade;
Chris PeBenito 134191b
attribute mlsxwindowngrade;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute mlstrustedobject;
Chris PeBenito 134191b
Chris PeBenito 134191b
attribute privrangetrans;
Chris PeBenito 134191b
attribute mlsrangetrans;
Chris PeBenito 134191b
Chris PeBenito 134191b
') dnl end enable_mls