Chris PeBenito 134191
Chris PeBenito 134191
ifdef(`enable_mls',`
Chris PeBenito 134191
#
Chris PeBenito 134191
# Define sensitivities 
Chris PeBenito 134191
#
Chris PeBenito 134191
# Each sensitivity has a name and zero or more aliases.
Chris PeBenito 134191
#
Chris PeBenito 134191
sensitivity s0;
Chris PeBenito 134191
sensitivity s1;
Chris PeBenito 134191
sensitivity s2;
Chris PeBenito 134191
sensitivity s3;
Chris PeBenito 134191
sensitivity s4;
Chris PeBenito 134191
sensitivity s5;
Chris PeBenito 134191
sensitivity s6;
Chris PeBenito 134191
sensitivity s7;
Chris PeBenito 134191
sensitivity s8;
Chris PeBenito 134191
sensitivity s9;
Chris PeBenito 77f6e2
sensitivity s10;
Chris PeBenito 77f6e2
sensitivity s11;
Chris PeBenito 77f6e2
sensitivity s12;
Chris PeBenito 77f6e2
sensitivity s13;
Chris PeBenito 77f6e2
sensitivity s14;
Chris PeBenito 77f6e2
sensitivity s15;
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# Define the ordering of the sensitivity levels (least to greatest)
Chris PeBenito 134191
#
Chris PeBenito 77f6e2
dominance { s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 }
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# Define the categories
Chris PeBenito 134191
#
Chris PeBenito 134191
# Each category has a name and zero or more aliases.
Chris PeBenito 134191
#
Chris PeBenito bf080a
category c0; category c1; category c2; category c3;
Chris PeBenito bf080a
category c4; category c5; category c6; category c7;
Chris PeBenito bf080a
category c8; category c9; category c10; category c11;
Chris PeBenito bf080a
category c12; category c13; category c14; category c15;
Chris PeBenito bf080a
category c16; category c17; category c18; category c19;
Chris PeBenito bf080a
category c20; category c21; category c22; category c23;
Chris PeBenito bf080a
category c24; category c25; category c26; category c27;
Chris PeBenito bf080a
category c28; category c29; category c30; category c31;
Chris PeBenito bf080a
category c32; category c33; category c34; category c35;
Chris PeBenito bf080a
category c36; category c37; category c38; category c39;
Chris PeBenito bf080a
category c40; category c41; category c42; category c43;
Chris PeBenito bf080a
category c44; category c45; category c46; category c47;
Chris PeBenito bf080a
category c48; category c49; category c50; category c51;
Chris PeBenito bf080a
category c52; category c53; category c54; category c55;
Chris PeBenito bf080a
category c56; category c57; category c58; category c59;
Chris PeBenito bf080a
category c60; category c61; category c62; category c63;
Chris PeBenito bf080a
category c64; category c65; category c66; category c67;
Chris PeBenito bf080a
category c68; category c69; category c70; category c71;
Chris PeBenito bf080a
category c72; category c73; category c74; category c75;
Chris PeBenito bf080a
category c76; category c77; category c78; category c79;
Chris PeBenito bf080a
category c80; category c81; category c82; category c83;
Chris PeBenito bf080a
category c84; category c85; category c86; category c87;
Chris PeBenito bf080a
category c88; category c89; category c90; category c91;
Chris PeBenito bf080a
category c92; category c93; category c94; category c95;
Chris PeBenito bf080a
category c96; category c97; category c98; category c99;
Chris PeBenito bf080a
category c100; category c101; category c102; category c103;
Chris PeBenito bf080a
category c104; category c105; category c106; category c107;
Chris PeBenito bf080a
category c108; category c109; category c110; category c111;
Chris PeBenito bf080a
category c112; category c113; category c114; category c115;
Chris PeBenito bf080a
category c116; category c117; category c118; category c119;
Chris PeBenito bf080a
category c120; category c121; category c122; category c123;
Chris PeBenito bf080a
category c124; category c125; category c126; category c127;
Chris PeBenito bf080a
category c128; category c129; category c130; category c131;
Chris PeBenito bf080a
category c132; category c133; category c134; category c135;
Chris PeBenito bf080a
category c136; category c137; category c138; category c139;
Chris PeBenito bf080a
category c140; category c141; category c142; category c143;
Chris PeBenito bf080a
category c144; category c145; category c146; category c147;
Chris PeBenito bf080a
category c148; category c149; category c150; category c151;
Chris PeBenito bf080a
category c152; category c153; category c154; category c155;
Chris PeBenito bf080a
category c156; category c157; category c158; category c159;
Chris PeBenito bf080a
category c160; category c161; category c162; category c163;
Chris PeBenito bf080a
category c164; category c165; category c166; category c167;
Chris PeBenito bf080a
category c168; category c169; category c170; category c171;
Chris PeBenito bf080a
category c172; category c173; category c174; category c175;
Chris PeBenito bf080a
category c176; category c177; category c178; category c179;
Chris PeBenito bf080a
category c180; category c181; category c182; category c183;
Chris PeBenito bf080a
category c184; category c185; category c186; category c187;
Chris PeBenito bf080a
category c188; category c189; category c190; category c191;
Chris PeBenito bf080a
category c192; category c193; category c194; category c195;
Chris PeBenito bf080a
category c196; category c197; category c198; category c199;
Chris PeBenito bf080a
category c200; category c201; category c202; category c203;
Chris PeBenito bf080a
category c204; category c205; category c206; category c207;
Chris PeBenito bf080a
category c208; category c209; category c210; category c211;
Chris PeBenito bf080a
category c212; category c213; category c214; category c215;
Chris PeBenito bf080a
category c216; category c217; category c218; category c219;
Chris PeBenito bf080a
category c220; category c221; category c222; category c223;
Chris PeBenito bf080a
category c224; category c225; category c226; category c227;
Chris PeBenito bf080a
category c228; category c229; category c230; category c231;
Chris PeBenito bf080a
category c232; category c233; category c234; category c235;
Chris PeBenito bf080a
category c236; category c237; category c238; category c239;
Chris PeBenito bf080a
category c240; category c241; category c242; category c243;
Chris PeBenito bf080a
category c244; category c245; category c246; category c247;
Chris PeBenito bf080a
category c248; category c249; category c250; category c251;
Chris PeBenito bf080a
category c252; category c253; category c254; category c255;
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# Each MLS level specifies a sensitivity and zero or more categories which may
Chris PeBenito 134191
# be associated with that sensitivity.
Chris PeBenito 134191
#
Chris PeBenito 77f6e2
level s0:c0.c255;
Chris PeBenito 77f6e2
level s1:c0.c255;
Chris PeBenito 77f6e2
level s2:c0.c255;
Chris PeBenito 77f6e2
level s3:c0.c255;
Chris PeBenito 77f6e2
level s4:c0.c255;
Chris PeBenito 77f6e2
level s5:c0.c255;
Chris PeBenito 77f6e2
level s6:c0.c255;
Chris PeBenito 77f6e2
level s7:c0.c255;
Chris PeBenito 77f6e2
level s8:c0.c255;
Chris PeBenito 77f6e2
level s9:c0.c255;
Chris PeBenito 77f6e2
level s10:c0.c255;
Chris PeBenito 77f6e2
level s11:c0.c255;
Chris PeBenito 77f6e2
level s12:c0.c255;
Chris PeBenito 77f6e2
level s13:c0.c255;
Chris PeBenito 77f6e2
level s14:c0.c255;
Chris PeBenito 77f6e2
level s15:c0.c255;
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# Define the MLS policy
Chris PeBenito 134191
#
Chris PeBenito 134191
# mlsconstrain class_set perm_set expression ;
Chris PeBenito 134191
#
Chris PeBenito 134191
# mlsvalidatetrans class_set expression ;
Chris PeBenito 134191
#
Chris PeBenito 134191
# expression : ( expression )
Chris PeBenito 134191
#	     | not expression
Chris PeBenito 134191
#	     | expression and expression
Chris PeBenito 134191
#	     | expression or expression
Chris PeBenito 134191
#	     | u1 op u2
Chris PeBenito 134191
#	     | r1 role_mls_op r2
Chris PeBenito 134191
#	     | t1 op t2
Chris PeBenito 134191
#	     | l1 role_mls_op l2
Chris PeBenito 134191
#	     | l1 role_mls_op h2
Chris PeBenito 134191
#	     | h1 role_mls_op l2
Chris PeBenito 134191
#	     | h1 role_mls_op h2
Chris PeBenito 134191
#	     | l1 role_mls_op h1
Chris PeBenito 134191
#	     | l2 role_mls_op h2
Chris PeBenito 134191
#	     | u1 op names
Chris PeBenito 134191
#	     | u2 op names
Chris PeBenito 134191
#	     | r1 op names
Chris PeBenito 134191
#	     | r2 op names
Chris PeBenito 134191
#	     | t1 op names
Chris PeBenito 134191
#	     | t2 op names
Chris PeBenito 134191
#	     | u3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191
#	     | r3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191
#	     | t3 op names (NOTE: this is only available for mlsvalidatetrans)
Chris PeBenito 134191
#
Chris PeBenito 134191
# op : == | !=
Chris PeBenito 134191
# role_mls_op : == | != | eq | dom | domby | incomp
Chris PeBenito 134191
#
Chris PeBenito 134191
# names : name | { name_list }
Chris PeBenito 2705f9
# name_list : name | name_list name
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the file classes
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# make sure these file classes are "single level"
Chris PeBenito 134191
mlsconstrain { file lnk_file fifo_file } { create relabelto }
Chris PeBenito 134191
	( l2 eq h2 );
Chris PeBenito 134191
Chris PeBenito bf080a
# new file labels must be dominated by the relabeling subjects clearance
Chris PeBenito 134191
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } relabelto
Chris PeBenito 134191
	( h1 dom h2 );
Chris PeBenito 134191
Chris PeBenito 134191
# the file "read" ops (note the check is dominance of the low level)
Chris PeBenito 134191
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { read getattr execute }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfileread ) or
Chris PeBenito 134191
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain dir search
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfileread ) or
Chris PeBenito 134191
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191
Chris PeBenito 134191
# the "single level" file "write" ops
Chris PeBenito a5e213
mlsconstrain { file lnk_file fifo_file dir chr_file blk_file sock_file } { write create setattr relabelfrom append unlink link rename mounton }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfilewrite ) or
Chris PeBenito 134191
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain dir { add_name remove_name reparent rmdir }
Chris PeBenito 134191
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfilewrite ) or
Chris PeBenito 134191
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# { dir file lnk_file chr_file blk_file sock_file fifo_file } { ioctl lock swapon quotaon }
Chris PeBenito 134191
#
Chris PeBenito 2705f9
# { file chr_file } { execute_no_trans entrypoint execmod }
Chris PeBenito 134191
Chris PeBenito 134191
# the file upgrade/downgrade rule
Chris PeBenito 2705f9
mlsvalidatetrans { dir file lnk_file chr_file blk_file sock_file fifo_file }
Chris PeBenito 134191
	((( l1 eq l2 ) or
Chris PeBenito 134191
	  (( t3 == mlsfileupgrade ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	  (( t3 == mlsfiledowngrade ) and ( l1 dom l2 )) or
Chris PeBenito 134191
	  (( t3 == mlsfiledowngrade ) and ( l1 incomp l2 ))) and
Chris PeBenito 134191
	 (( h1 eq h2 ) or
Chris PeBenito 134191
	  (( t3 == mlsfileupgrade ) and ( h1 domby h2 )) or
Chris PeBenito 134191
	  (( t3 == mlsfiledowngrade ) and ( h1 dom h2 )) or
Chris PeBenito 134191
	  (( t3 == mlsfiledowngrade ) and ( h1 incomp h2 ))));
Chris PeBenito 134191
Chris PeBenito 134191
# create can also require the upgrade/downgrade checks if the creating process
Chris PeBenito 134191
# has used setfscreate (note that both the high and low level of the object
Chris PeBenito 134191
# default to the process sensitivity level)
Chris PeBenito 134191
mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } create
Chris PeBenito 134191
	((( l1 eq l2 ) or
Chris PeBenito 134191
	  (( t1 == mlsfileupgrade ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	  (( t1 == mlsfiledowngrade ) and ( l1 dom l2 )) or
Chris PeBenito 134191
	  (( t1 == mlsfiledowngrade ) and ( l1 incomp l2 ))) and
Chris PeBenito 134191
	 (( l1 eq h2 ) or
Chris PeBenito 134191
	  (( t1 == mlsfileupgrade ) and ( l1 domby h2 )) or
Chris PeBenito 134191
	  (( t1 == mlsfiledowngrade ) and ( l1 dom h2 )) or
Chris PeBenito 134191
	  (( t1 == mlsfiledowngrade ) and ( l1 incomp h2 ))));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the filesystem class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# new filesystem labels must be dominated by the relabeling subjects clearance
Chris PeBenito 134191
mlsconstrain filesystem relabelto
Chris PeBenito 134191
	( h1 dom h2 );
Chris PeBenito 134191
Chris PeBenito 134191
# the filesystem "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain filesystem { getattr quotaget }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsfilereadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfileread ));
Chris PeBenito 134191
Chris PeBenito 134191
# all the filesystem "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain filesystem { mount remount unmount relabelfrom quotamod }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsfilewritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsfilewrite ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# filesystem { transition associate }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the socket classes
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# new socket labels must be dominated by the relabeling subjects clearance
Chris PeBenito 134191
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 134191
	( h1 dom h2 );
Chris PeBenito 134191
Chris PeBenito 2705f9
# the socket "read" ops (note the check is dominance of the low level)
Chris PeBenito 134191
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 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsnetread ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain { netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_xfrm_socket netlink_audit_socket netlink_ip6fw_socket } nlmsg_read
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsnetread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the socket "write" ops
Chris PeBenito 2705f9
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 } { write setattr relabelfrom connect setopt shutdown }
Chris PeBenito 134191
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 134191
	 (( t1 == mlsnetwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsnetwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 2705f9
# { 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 create lock append bind sendto send_msg name_bind }
Chris PeBenito 134191
#
Chris PeBenito 134191
# { tcp_socket udp_socket rawip_socket } node_bind
Chris PeBenito 134191
#
Chris PeBenito 2705f9
# { tcp_socket unix_stream_socket } { connectto newconn acceptfrom }
Chris PeBenito 2705f9
#
Chris PeBenito 63e0a1
# tcp_socket name_connect
Chris PeBenito 63e0a1
#
Chris PeBenito 134191
# { netlink_route_socket netlink_firewall_socket netlink_tcpdiag_socket netlink_xfrm_socket netlink_audit_socket netlink_ip6fw_socket } nlmsg_write
Chris PeBenito 134191
#
Chris PeBenito 63e0a1
# netlink_audit_socket { nlmsg_relay nlmsg_readpriv }
Chris PeBenito 63e0a1
#
Chris PeBenito 63e0a1
# netlink_kobject_uevent_socket *
Chris PeBenito 63e0a1
#
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the ipc classes
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the ipc "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain { ipc sem msgq shm } { getattr read unix_read }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcread ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain msg receive
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the ipc "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain { ipc sem msgq shm } { create destroy setattr write unix_write }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain msgq enqueue
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain shm lock
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
mlsconstrain msg send
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsipcwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsipcwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# { ipc sem msgq shm } associate
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the fd class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# fd use
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 2705f9
# MLS policy for the network object classes
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 2705f9
# the netif/node "read" ops (implicit single level socket doing the read)
Chris PeBenito 2705f9
#                           (note the check is dominance of the low level)
Chris PeBenito 2705f9
mlsconstrain { node netif } { tcp_recv udp_recv rawip_recv }
Chris PeBenito 2705f9
	(( l1 dom l2 ) or ( t1 == mlsnetrecvall ));
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# the netif/node "write" ops (implicit single level socket doing the write)
Chris PeBenito 2705f9
mlsconstrain { netif node } { tcp_send udp_send rawip_send }
Chris PeBenito 2705f9
	(( l1 dom l2 ) and ( l1 domby h2 ));
Chris PeBenito 2705f9
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 63e0a1
# node enforce_dest
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the process class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# new process labels must be dominated by the relabeling subjects clearance
Chris PeBenito 2705f9
# and sensitivity level changes require privilege
Chris PeBenito 2705f9
mlsconstrain process transition
Chris PeBenito 2705f9
	(( h1 dom h2 ) and
Chris PeBenito 2705f9
	 (( l1 eq l2 ) or ( t1 == mlsprocsetsl ) or
Chris PeBenito 2705f9
	  (( t1 == privrangetrans ) and ( t2 == mlsrangetrans ))));
Chris PeBenito 2705f9
mlsconstrain process dyntransition
Chris PeBenito 134191
	(( h1 dom h2 ) and
Chris PeBenito 134191
	 (( l1 eq l2 ) or ( t1 == mlsprocsetsl )));
Chris PeBenito 134191
Chris PeBenito 134191
# all the process "read" ops
Chris PeBenito 134191
mlsconstrain process { getsched getsession getpgid getcap getattr ptrace share }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsprocreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsprocread ));
Chris PeBenito 134191
Chris PeBenito 134191
# all the process "write" ops (note the check is equality on the low level)
Chris PeBenito 134191
mlsconstrain process { sigkill sigstop signal setsched setpgid setcap setexec setfscreate setcurrent ptrace share }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsprocwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsprocwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 63e0a1
# process { fork sigchld signull noatsecure siginh setrlimit rlimitinh execmem execstack execheap }
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the security class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# security *
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the system class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# system *
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the capability class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# capability *
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the passwd class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# passwd *
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the drawable class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the drawable "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain drawable { getattr copy }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the drawable "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain drawable { create destroy draw copy }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the gc class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the gc "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain gc getattr
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the gc "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain gc { create free setattr }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the window class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the window "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain window { listprop getattr enumerate mousemotion inputevent drawevent windowchangeevent windowchangerequest serverchangeevent extensionevent }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the window "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain window { addchild create destroy chstack chproplist chprop setattr setfocus move chselection chparent ctrllife transparent clientcomevent }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinwrite ) or
Chris PeBenito bf080a
	 ( t2 == mlstrustedobject ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# window { map unmap }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the font class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the font "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain font { load getattr }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the font "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain font free
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# font use
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the colormap class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the colormap "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain colormap { list read getattr }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinreadcolormap ) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the colormap "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain colormap { create free install uninstall store setattr }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinwritecolormap ) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the property class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the property "read" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain property { read }
Chris PeBenito 134191
	(( l1 dom l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinreadproperty ) or
Chris PeBenito 134191
	 ( t1 == mlsxwinread ));
Chris PeBenito 134191
Chris PeBenito 134191
# the property "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain property { create free write }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinwriteproperty ) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the cursor class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the cursor "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain cursor { create createglyph free assign setattr }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the xclient class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# the xclient "write" ops (implicit single level)
Chris PeBenito 134191
mlsconstrain xclient kill
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the xinput class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# these access vectors have no MLS restrictions
Chris PeBenito bf080a
# xinput ~{ relabelinput setattr }
Chris PeBenito 134191
Chris PeBenito 134191
# the xinput "write" ops (implicit single level)
Chris PeBenito bf080a
mlsconstrain xinput { setattr relabelinput }
Chris PeBenito 134191
	(( l1 eq l2 ) or
Chris PeBenito 134191
	 (( t1 == mlsxwinwritetoclr ) and ( h1 dom l2 ) and ( l1 domby l2 )) or
Chris PeBenito bf080a
	 ( t1 == mlsxwinwritexinput ) or
Chris PeBenito 134191
	 ( t1 == mlsxwinwrite ));
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the xserver class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# these access vectors have no MLS restrictions
Chris PeBenito bf080a
# xserver *
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the xextension class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito bf080a
# these access vectors have no MLS restrictions
Chris PeBenito bf080a
# xextension { query use }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the pax class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# pax { pageexec emutramp mprotect randmmap randexec segmexec }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the dbus class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# dbus { acquire_svc send_msg }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the nscd class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
# these access vectors have no MLS restrictions
Chris PeBenito 134191
# nscd { getpwd getgrp gethost getstat admin shmempwd shmemgrp shmemhost }
Chris PeBenito 134191
Chris PeBenito 134191
Chris PeBenito 2705f9
Chris PeBenito 2705f9
Chris PeBenito 134191
#
Chris PeBenito 134191
# MLS policy for the association class
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 9b45c6
mlsconstrain association { recvfrom }
Chris PeBenito 9b45c6
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 9b45c6
	 (( t1 == mlsnetreadtoclr ) and ( h1 dom l2 )) or
Chris PeBenito 9b45c6
	 ( t1 == mlsnetread ) or
Chris PeBenito 9b45c6
	 ( t2 == unlabeled_t ));
Chris PeBenito 9b45c6
Chris PeBenito 9b45c6
mlsconstrain association { sendto }
Chris PeBenito 9b45c6
	((( l1 dom l2 ) and ( l1 domby h2 )) or
Chris PeBenito 9b45c6
	 ( t2 == unlabeled_t ));
Chris PeBenito 9b45c6
Chris PeBenito 9b45c6
mlsconstrain association { polmatch }
Chris PeBenito 9b45c6
	((( l1 dom l2 ) and ( h1 domby h2 )) or
Chris PeBenito 9b45c6
	 ( t2 == unlabeled_t ));
Chris PeBenito 134191
Chris PeBenito 134191
') dnl end enable_mls