From: "Jason Zaman" <perfinion@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/
Date: Sat, 3 Sep 2022 19:54:05 +0000 (UTC) [thread overview]
Message-ID: <1662230515.2de290b85e9d1c50e4e6f076a16fc803dfab4adc.perfinion@gentoo> (raw)
commit: 2de290b85e9d1c50e4e6f076a16fc803dfab4adc
Author: Chris PeBenito <chpebeni <AT> linux <DOT> microsoft <DOT> com>
AuthorDate: Thu Jun 23 19:29:50 2022 +0000
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sat Sep 3 18:41:55 2022 +0000
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2de290b8
mcs: Reorganize file.
Add more comments.
Signed-off-by: Chris PeBenito <chpebeni <AT> linux.microsoft.com>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
policy/mcs | 53 ++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/policy/mcs b/policy/mcs
index c3d76d09..30129dcb 100644
--- a/policy/mcs
+++ b/policy/mcs
@@ -82,10 +82,15 @@ mlsconstrain { file lnk_file fifo_file } { create relabelto }
((( h1 dom h2 ) and ( l2 eq h2 )) or
( t1 != mcs_constrained_type ));
-
+#
+# MCS policy for process classes
+#
mlsconstrain process { transition dyntransition ptrace sigkill sigstop signal getsession getattr getsched setsched getrlimit setrlimit getpgid setpgid getcap setcap share setexec setfscreate setcurrent setsockcreate }
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
+#
+# MCS policy for socket classes
+#
mlsconstrain socket_class_set { create ioctl read write setattr append bind connect getopt setopt shutdown }
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
@@ -101,9 +106,16 @@ mlsconstrain unix_stream_socket connectto
mlsconstrain unix_dgram_socket sendto
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
+
+#
+# MCS policy for key class
+#
mlsconstrain key { create link read search setattr view write }
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
+#
+# MCS policy for SysV IPC
+#
mlsconstrain { ipc sem msgq shm } { create destroy setattr read unix_read write unix_write }
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
@@ -116,9 +128,32 @@ mlsconstrain msgq enqueue
mlsconstrain shm lock
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
+#
+# MCS policy for context class
+#
mlsconstrain context contains
((( h1 dom h2 ) and ( l1 domby l2 )) or ( t1 != mcs_constrained_type ));
+#
+# MCS policy for network classes
+#
+
+# 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 sendto }
+ (( l1 dom l2 ) or ( t1 != mcs_constrained_type ));
+
+mlsconstrain { packet peer } { recv }
+ (( l1 dom l2 ) or
+ (( t1 != mcs_constrained_type ) and ( t2 != mcs_constrained_type )));
+
+# 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 } { egress ingress }
+ (( l1 dom l2 ) or ( t1 != mcs_constrained_type ));
+
#
# MCS policy for SELinux-enabled databases
#
@@ -162,20 +197,4 @@ mlsconstrain db_language { drop getattr setattr relabelfrom execute }
mlsconstrain db_blob { drop getattr setattr relabelfrom read write import export }
(( h1 dom h2 ) or ( t1 != mcs_constrained_type ));
-# 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 sendto }
- (( l1 dom l2 ) or ( t1 != mcs_constrained_type ));
-
-mlsconstrain { packet peer } { recv }
- (( l1 dom l2 ) or
- (( t1 != mcs_constrained_type ) and ( t2 != mcs_constrained_type )));
-
-# 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 } { egress ingress }
- (( l1 dom l2 ) or ( t1 != mcs_constrained_type ));
-
') dnl end enable_mcs
next reply other threads:[~2022-09-03 19:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-03 19:54 Jason Zaman [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-01 19:56 [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/ Kenton Groombridge
2022-09-03 19:54 Jason Zaman
2022-09-03 19:54 Jason Zaman
2022-09-03 19:54 Jason Zaman
2022-09-03 19:54 Jason Zaman
2022-09-03 19:54 Jason Zaman
2022-09-03 19:54 Jason Zaman
2022-03-31 3:31 Jason Zaman
2022-02-07 2:14 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2021-11-21 3:00 Jason Zaman
2018-01-18 16:37 Sven Vermeulen
2016-01-30 17:21 Jason Zaman
2015-02-15 17:39 Sven Vermeulen
2014-04-30 17:14 Sven Vermeulen
2013-09-24 17:10 Sven Vermeulen
2012-06-23 13:40 Sven Vermeulen
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=1662230515.2de290b85e9d1c50e4e6f076a16fc803dfab4adc.perfinion@gentoo \
--to=perfinion@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox