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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 628A415813A for ; Sun, 15 Dec 2024 00:30:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF5E8E09D6; Sun, 15 Dec 2024 00:30:20 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 C7B29E09D4 for ; Sun, 15 Dec 2024 00:30:19 +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 A30D4342FA6 for ; Sun, 15 Dec 2024 00:30:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 27714214E for ; Sun, 15 Dec 2024 00:30:16 +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: <1734221982.108f2dabb313b5b946cd3bd98977a5adc1683d1f.perfinion@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/systemd.fc policy/modules/system/systemd.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 108f2dabb313b5b946cd3bd98977a5adc1683d1f X-VCS-Branch: master Date: Sun, 15 Dec 2024 00:30:16 +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: bbe78eab-0b16-49d6-a29e-a4b5d2f27d8f X-Archives-Hash: 1ac3f40b2f59f3ec44ac1a5e3e357cd9 commit: 108f2dabb313b5b946cd3bd98977a5adc1683d1f Author: Rahul Sandhu sandhuservices dev> AuthorDate: Thu Nov 28 18:05:01 2024 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Dec 15 00:19:42 2024 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=108f2dab systemd_homed_record_t: new type for user records As systemd identity files contain sensitive data, such as password hashes, let's create a new type systemd_homed_record_t for them. As systemd_homework_t needs to be able to read, create, and delete these files, let's give it permissions to do so. Signed-off-by: Rahul Sandhu sandhuservices.dev> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/systemd.fc | 2 ++ policy/modules/system/systemd.te | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index ce48c7d09..6a770c502 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -64,6 +64,8 @@ HOME_DIR/\.config/systemd(/.*)? gen_context(system_u:object_r:systemd_conf_home HOME_DIR/\.local/share/systemd(/.*)? gen_context(system_u:object_r:systemd_data_home_t,s0) # homed files +HOME_DIR/\.identity -- gen_context(system_u:object_r:systemd_homed_record_t,s0) +HOME_DIR/\.identity-blob(/.*)? gen_context(system_u:object_r:systemd_homed_record_t,s0) HOME_ROOT/(.+)\.home -- gen_context(system_u:object_r:systemd_homed_storage_t,s0) /usr/lib/systemd/user(/.*)? gen_context(system_u:object_r:systemd_user_unit_t,s0) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index edc192609..fbace192f 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -126,6 +126,9 @@ domain_type(systemd_homework_t) domain_entry_file(systemd_homework_t, systemd_homework_exec_t) role system_r types systemd_homework_t; +type systemd_homed_record_t; +files_auth_file(systemd_homed_record_t) + type systemd_homed_runtime_t; files_runtime_file(systemd_homed_runtime_t) @@ -791,6 +794,10 @@ systemd_log_parse_environment(systemd_homework_t) udev_read_runtime_files(systemd_homework_t) +read_files_pattern(systemd_homework_t, systemd_homed_runtime_work_dir_t, systemd_homed_record_t) +create_files_pattern(systemd_homework_t, systemd_homed_runtime_work_dir_t, systemd_homed_record_t) +delete_files_pattern(systemd_homework_t, systemd_homed_runtime_work_dir_t, systemd_homed_record_t) + ####################################### # # Hostnamed policy