From: Paul Moore <paul.moore@hp.com>
To: refpolicy@oss1.tresys.com, selinux@tycho.nsa.gov
Cc: js44352@gmail.com
Subject: [RFC PATCH v2] refpol: Add netif, node and peer constraints for MCS based policies
Date: Wed, 07 Oct 2009 17:25:56 +0000 [thread overview]
Message-ID: <20091007172556.3117.39527.stgit@flek.lan> (raw)
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 )".
Signed-of-by: Paul Moore <paul.moore@hp.com>
---
policy/mcs | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/policy/mcs b/policy/mcs
index af90ef2..5aedab8 100644
--- a/policy/mcs
+++ b/policy/mcs
@@ -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
#
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
WARNING: multiple messages have this Message-ID (diff)
From: paul.moore@hp.com (Paul Moore)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [RFC PATCH v2] refpol: Add netif, node and peer constraints for MCS based policies
Date: Wed, 07 Oct 2009 17:25:56 +0000 [thread overview]
Message-ID: <20091007172556.3117.39527.stgit@flek.lan> (raw)
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 )".
Signed-of-by: Paul Moore <paul.moore@hp.com>
---
policy/mcs | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/policy/mcs b/policy/mcs
index af90ef2..5aedab8 100644
--- a/policy/mcs
+++ b/policy/mcs
@@ -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
#
next reply other threads:[~2009-10-07 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 17:25 Paul Moore [this message]
2009-10-07 17:25 ` [refpolicy] [RFC PATCH v2] refpol: Add netif, node and peer constraints for MCS based policies Paul Moore
2009-10-07 18:20 ` Christopher J. PeBenito
2009-10-07 18:20 ` Christopher J. PeBenito
2009-10-07 20:30 ` Paul Moore
2009-10-07 20:30 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091007172556.3117.39527.stgit@flek.lan \
--to=paul.moore@hp.com \
--cc=js44352@gmail.com \
--cc=refpolicy@oss1.tresys.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.