From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AC09513829C for ; Thu, 2 Jun 2016 06:32:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E766714231; Thu, 2 Jun 2016 06:32:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E9DED141AD for ; Thu, 2 Jun 2016 06:32:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 80339340C50 for ; Thu, 2 Jun 2016 06:32:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 46A3B17B4 for ; Thu, 2 Jun 2016 06:32:11 +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: <1464805207.33b0d446f0d55311b674932b135b7ce0fe4e7b8b.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: 33b0d446f0d55311b674932b135b7ce0fe4e7b8b X-VCS-Branch: master Date: Thu, 2 Jun 2016 06:32: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-Archives-Salt: 0c83c206-eb20-4344-aa54-5e3ee2ae822c X-Archives-Hash: 7c5efba4eb24754798870b199d57c796 commit: 33b0d446f0d55311b674932b135b7ce0fe4e7b8b Author: Laurent Bigonville bigon be> AuthorDate: Thu May 26 12:43:10 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Wed Jun 1 18:20:07 2016 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=33b0d446 Add policy for systemd-resolved Initial policy for systemd-resolved, tested with systemd 230 on debian policy/modules/system/systemd.fc | 2 ++ policy/modules/system/systemd.te | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index a0b5f0b..a987681 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -17,6 +17,7 @@ /usr/lib/systemd/systemd-localed -- gen_context(system_u:object_r:systemd_locale_exec_t,s0) /usr/lib/systemd/systemd-logind -- gen_context(system_u:object_r:systemd_logind_exec_t,s0) /usr/lib/systemd/systemd-machined -- gen_context(system_u:object_r:systemd_machined_exec_t,s0) +/usr/lib/systemd/systemd-resolved -- gen_context(system_u:object_r:systemd_resolved_exec_t,s0) /usr/lib/systemd/systemd-user-sessions -- gen_context(system_u:object_r:systemd_sessions_exec_t,s0) # Systemd unit files @@ -33,6 +34,7 @@ /var/run/\.nologin[^/]* -- gen_context(system_u:object_r:systemd_sessions_var_run_t,s0) /var/run/nologin -- gen_context(system_u:object_r:systemd_sessions_var_run_t,s0) +/var/run/systemd/resolve(/.*)? gen_context(system_u:object_r:systemd_resolved_var_run_t,s0) /var/run/systemd/seats(/.*)? gen_context(system_u:object_r:systemd_logind_var_run_t,s0) /var/run/systemd/sessions(/.*)? gen_context(system_u:object_r:systemd_logind_var_run_t,s0) /var/run/systemd/users(/.*)? gen_context(system_u:object_r:systemd_logind_var_run_t,s0) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 0bed23c..e42f3ca 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -80,6 +80,13 @@ type systemd_nspawn_t; type systemd_nspawn_exec_t; init_system_domain(systemd_nspawn_t, systemd_nspawn_exec_t) +type systemd_resolved_t; +type systemd_resolved_exec_t; +init_system_domain(systemd_resolved_t, systemd_resolved_exec_t) + +type systemd_resolved_var_run_t; +files_pid_file(systemd_resolved_var_run_t) + type systemd_run_t; type systemd_run_exec_t; init_daemon_domain(systemd_run_t, systemd_run_exec_t) @@ -244,6 +251,39 @@ optional_policy(` ######################################### # +# Resolved local policy +# + +allow systemd_resolved_t self:capability { chown setgid setpcap setuid }; +allow systemd_resolved_t self:process { getcap setcap setfscreate signal }; + +allow systemd_resolved_t self:tcp_socket { accept listen }; + +manage_dirs_pattern(systemd_resolved_t, systemd_resolved_var_run_t, systemd_resolved_var_run_t) +manage_files_pattern(systemd_resolved_t, systemd_resolved_var_run_t, systemd_resolved_var_run_t) +init_pid_filetrans(systemd_resolved_t, systemd_resolved_var_run_t, dir) + +kernel_read_crypto_sysctls(systemd_resolved_t) +kernel_read_kernel_sysctls(systemd_resolved_t) +kernel_read_system_state(systemd_resolved_t) + +corenet_tcp_bind_generic_node(systemd_resolved_t) +corenet_tcp_bind_llmnr_port(systemd_resolved_t) +corenet_udp_bind_generic_node(systemd_resolved_t) +corenet_udp_bind_llmnr_port(systemd_resolved_t) + +auth_use_nsswitch(systemd_resolved_t) + +seutil_read_file_contexts(systemd_resolved_t) + +systemd_log_parse_environment(systemd_resolved_t) + +optional_policy(` + dbus_system_bus_client(systemd_resolved_t) +') + +######################################### +# # Sessions local policy #