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 6AA3A15802F for ; Fri, 31 Mar 2023 23:07:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 00E61E08C8; Fri, 31 Mar 2023 23:07:15 +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 D55A0E08C8 for ; Fri, 31 Mar 2023 23:07:14 +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 CB7FB340FA3 for ; Fri, 31 Mar 2023 23:07:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 06293A1E for ; Fri, 31 Mar 2023 23:07:11 +0000 (UTC) From: "Kenton Groombridge" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kenton Groombridge" Message-ID: <1680282692.5979688e9262dcd53700afcc47f3a053d906ec3b.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/logging.te policy/modules/system/systemd.if X-VCS-Directories: policy/modules/system/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: 5979688e9262dcd53700afcc47f3a053d906ec3b X-VCS-Branch: master Date: Fri, 31 Mar 2023 23:07:11 +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: 7e218998-0089-4502-b647-aaa27c5f477e X-Archives-Hash: 79c4b01474700e031c9f63f8a0244074 commit: 5979688e9262dcd53700afcc47f3a053d906ec3b Author: Kenton Groombridge concord sh> AuthorDate: Mon Mar 6 18:23:11 2023 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Fri Mar 31 17:11:32 2023 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=5979688e logging, systemd: allow relabelfrom,relabelto on systemd journal files by systemd-journald journald's journal-offline will relabel log files. It should be noted however that this happens even if the files already have the correct label. avc: granted { relabelfrom } for pid=11440 comm="journal-offline" name=".#system 97c1c6b7d7ed4333b671d09d9deee851-00000000003d4f26-0005f63f0972fd4c.journalb23e70204ab1737e" dev="dm-0" ino=418415 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=0 avc: granted { relabelto } for pid=11440 comm="journal-offline" name=".#system 97c1c6b7d7ed4333b671d09d9deee851-00000000003d4f26-0005f63f0972fd4c.journalb23e70204ab1737e" dev="dm-0" ino=418415 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file permissive=0 Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Kenton Groombridge gentoo.org> policy/modules/system/logging.te | 2 ++ policy/modules/system/systemd.if | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te index aa436b639..227dc6776 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -566,6 +566,8 @@ ifdef(`init_systemd',` systemd_manage_journal_files(syslogd_t) systemd_watch_journal_dirs(syslogd_t) + systemd_relabelfrom_journal_files(syslogd_t) + systemd_relabelto_journal_files(syslogd_t) udev_read_runtime_files(syslogd_t) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index a903282f0..77a59c662 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -1775,6 +1775,24 @@ interface(`systemd_watch_journal_dirs',` allow $1 systemd_journal_t:dir watch; ') +######################################## +## +## Relabel from systemd-journald file type. +## +## +## +## Domain allowed access. +## +## +# +interface(`systemd_relabelfrom_journal_files',` + gen_require(` + type systemd_journal_t; + ') + + allow $1 systemd_journal_t:file relabelfrom_file_perms; +') + ######################################## ## ## Relabel to systemd-journald directory type.