From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D0407158095 for ; Sat, 3 Sep 2022 19:54:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 23B52E0837; Sat, 3 Sep 2022 19:54:09 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 093A8E0837 for ; Sat, 3 Sep 2022 19:54:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2A041340F52 for ; Sat, 3 Sep 2022 19:54:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 70B625BD for ; Sat, 3 Sep 2022 19:54:05 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1662230515.2de290b85e9d1c50e4e6f076a16fc803dfab4adc.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/mcs X-VCS-Directories: policy/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 2de290b85e9d1c50e4e6f076a16fc803dfab4adc X-VCS-Branch: master Date: Sat, 3 Sep 2022 19:54:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d0456490-b3b0-4af4-97e6-8e31497172f3 X-Archives-Hash: eb6be0a69a455fd8bbe593b262ce65d0 commit: 2de290b85e9d1c50e4e6f076a16fc803dfab4adc Author: Chris PeBenito linux microsoft com> AuthorDate: Thu Jun 23 19:29:50 2022 +0000 Commit: Jason Zaman gentoo 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 linux.microsoft.com> Signed-off-by: Jason Zaman 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