Skip to contentSkip to conversation

refpol: Add netif, node and peer constraints for MCS based policies

RFC PATCH In review Paul Moore 2 participants 3 messages Oct 7, 2009 SELinux security module

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

RFC PATCH v2 1/1 refpol: Add netif, node and peer constraints for MCS based policies

Adapt the MLS netif, node and peer networking constraints for MCS. This patch preserves the basic structure of the MLS constraints and converts them to use the MCS model which means the "(( l1 dom l2 ) and ( l1 domby h2 ))" constraints are converted to "( h1 dom h2 )".

---

 policy/mcs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
policy/mcs +36 -0
index af90ef2..5aedab8 100644
@@ -102,6 +102,42 @@ mlsconstrain process { sigkill sigstop }
 	(( h1 dom h2 ) or ( t1 == mcskillall ));
 
 #
+# MCS policy for the network ingress/egress controls
+#
+
+# the netif ingress/egress ops, the ingress permission is a "write" operation
+# because the subject in this particular case is the remote domain which is
+# writing data out the network interface which is acting as the object
+mlsconstrain { netif } { ingress }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { netif } { egress }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the node recvfrom/sendto ops, the recvfrom permission is a "write" operation
+# because the subject in this particular case is the remote domain which is
+# writing data out the network node which is acting as the object
+mlsconstrain { node } { recvfrom }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { node } { sendto }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the forward ops, the forward_in permission is a "write" operation because the
+# subject in this particular case is the remote domain which is writing data
+# to the network with a secmark label, the object in this case
+mlsconstrain { packet } { forward_in }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { packet } { forward_out }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ) or ( t1 == unlabeled_t ));
+
+#
+# MCS policy for the secmark and peer controls
+#
+
+# the peer/packet recv op
+mlsconstrain { peer packet } { recv }
+	(( h1 dom h2 ) or ( t1 == mcsnetread ));
+
+#
 # MCS policy for SELinux-enabled databases
 #
 
#1 lore raw
Quoted 4 lines · Paul Moore

Adapt the MLS netif, node and peer networking constraints for MCS. This patch preserves the basic structure of the MLS constraints and converts them to use the MCS model which means the "(( l1 dom l2 ) and ( l1 domby h2 ))" constraints are converted to "( h1 dom h2 )".

It still needs the attribute declarations, along with interfaces for each of them.

Quoted 58 lines

---

 policy/mcs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
policy/mcs +36 -0
index af90ef2..5aedab8 100644
@@ -102,6 +102,42 @@ mlsconstrain process { sigkill sigstop }
 	(( h1 dom h2 ) or ( t1 == mcskillall ));
 
 #
+# MCS policy for the network ingress/egress controls
+#
+
+# the netif ingress/egress ops, the ingress permission is a "write" operation
+# because the subject in this particular case is the remote domain which is
+# writing data out the network interface which is acting as the object
+mlsconstrain { netif } { ingress }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { netif } { egress }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the node recvfrom/sendto ops, the recvfrom permission is a "write" operation
+# because the subject in this particular case is the remote domain which is
+# writing data out the network node which is acting as the object
+mlsconstrain { node } { recvfrom }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { node } { sendto }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the forward ops, the forward_in permission is a "write" operation because the
+# subject in this particular case is the remote domain which is writing data
+# to the network with a secmark label, the object in this case
+mlsconstrain { packet } { forward_in }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { packet } { forward_out }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ) or ( t1 == unlabeled_t ));
+
+#
+# MCS policy for the secmark and peer controls
+#
+
+# the peer/packet recv op
+mlsconstrain { peer packet } { recv }
+	(( h1 dom h2 ) or ( t1 == mcsnetread ));
+
+#
 # MCS policy for SELinux-enabled databases
 #
 

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
author
#2 lore raw
Quoted 8 lines · Christopher J. PeBenito
Quoted 4 lines · Paul Moore

Adapt the MLS netif, node and peer networking constraints for MCS. This patch preserves the basic structure of the MLS constraints and converts them to use the MCS model which means the "(( l1 dom l2 ) and ( l1 domby h2 ))" constraints are converted to "( h1 dom h2 )".

It still needs the attribute declarations, along with interfaces for each of them.

Ah yes, of course it does ...

Quoted 60 lines
Quoted 59 lines

---

 policy/mcs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
policy/mcs +4 -0
index af90ef2..5aedab8 100644
@@ -102,6 +102,42 @@ mlsconstrain process { sigkill sigstop }
 	(( h1 dom h2 ) or ( t1 == mcskillall ));
 
 #
+# MCS policy for the network ingress/egress controls
+#
+
+# the netif ingress/egress ops, the ingress permission is a "write"

operation +# because the subject in this particular case is the remote domain which is +# writing data out the network interface which is acting as the object +mlsconstrain { netif } { ingress }

policy/mcs +5 -0
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { netif } { egress }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the node recvfrom/sendto ops, the recvfrom permission is a "write"

operation +# because the subject in this particular case is the remote domain which is +# writing data out the network node which is acting as the object +mlsconstrain { node } { recvfrom }

policy/mcs +5 -0
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { node } { sendto }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ));
+
+# the forward ops, the forward_in permission is a "write" operation

because the +# subject in this particular case is the remote domain which is writing data +# to the network with a secmark label, the object in this case

policy/mcs +14 -0
+mlsconstrain { packet } { forward_in }
+	(( h1 dom h2 ) or ( t1 == mcsnetinbound ) or ( t1 == unlabeled_t ));
+mlsconstrain { packet } { forward_out }
+	(( h1 dom h2 ) or ( t1 == mcsnetoutbound ) or ( t1 == unlabeled_t ));
+
+#
+# MCS policy for the secmark and peer controls
+#
+
+# the peer/packet recv op
+mlsconstrain { peer packet } { recv }
+	(( h1 dom h2 ) or ( t1 == mcsnetread ));
+
+#
 # MCS policy for SELinux-enabled databases
 #

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 2 lines
paul moore
linux @ hp