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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E9555139694 for ; Thu, 30 Mar 2017 17:09:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5969D23403B; Thu, 30 Mar 2017 17:09:16 +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 21E5A234039 for ; Thu, 30 Mar 2017 17:09:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2F4CC341421 for ; Thu, 30 Mar 2017 17:09:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D51AC73EF for ; Thu, 30 Mar 2017 17:09:01 +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: <1490892639.15cc617da7710016c4aa47e0f9e42ed68ff36006.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/virt.fc policy/modules/contrib/virt.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 15cc617da7710016c4aa47e0f9e42ed68ff36006 X-VCS-Branch: next Date: Thu, 30 Mar 2017 17:09:01 +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: fde198a3-3985-4dce-83a3-78e2aaac5f9e X-Archives-Hash: 2914bb47ed33a204cbc61dc97b6020ba commit: 15cc617da7710016c4aa47e0f9e42ed68ff36006 Author: Jason Zaman perfinion com> AuthorDate: Thu May 12 16:49:07 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Thu Mar 30 16:50:39 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=15cc617d virt: add policy for virtlogd policy/modules/contrib/virt.fc | 1 + policy/modules/contrib/virt.te | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/policy/modules/contrib/virt.fc b/policy/modules/contrib/virt.fc index 22c1ed70..dca262ab 100644 --- a/policy/modules/contrib/virt.fc +++ b/policy/modules/contrib/virt.fc @@ -32,6 +32,7 @@ HOME_DIR/VirtualMachines/isos(/.*)? gen_context(system_u:object_r:virt_content_t /usr/sbin/libvirt-qmf -- gen_context(system_u:object_r:virt_qmf_exec_t,s0) /usr/sbin/libvirtd -- gen_context(system_u:object_r:virtd_exec_t,s0) /usr/sbin/virtlockd -- gen_context(system_u:object_r:virtlockd_exec_t,s0) +/usr/sbin/virtlogd -- gen_context(system_u:object_r:virtlogd_exec_t,s0) /var/cache/libvirt(/.*)? gen_context(system_u:object_r:virt_cache_t,s0-mls_systemhigh) diff --git a/policy/modules/contrib/virt.te b/policy/modules/contrib/virt.te index eb72843f..e1a3bcaf 100644 --- a/policy/modules/contrib/virt.te +++ b/policy/modules/contrib/virt.te @@ -208,12 +208,21 @@ files_pid_file(virtlockd_run_t) type virtlockd_var_lib_t; files_type(virtlockd_var_lib_t) +type virtlogd_t; +type virtlogd_exec_t; +init_daemon_domain(virtlogd_t, virtlogd_exec_t) + +type virtlogd_run_t; +files_pid_file(virtlogd_run_t) + ifdef(`enable_mcs',` init_ranged_daemon_domain(virtlockd_t, virtlockd_exec_t, s0 - mcs_systemhigh) + init_ranged_daemon_domain(virtlogd_t, virtlogd_exec_t, s0 - mcs_systemhigh) ') ifdef(`enable_mls',` init_ranged_daemon_domain(virtlockd_t, virtlockd_exec_t, s0 - mls_systemhigh) + init_ranged_daemon_domain(virtlogd_t, virtlogd_exec_t, s0 - mls_systemhigh) ') ######################################## @@ -234,6 +243,9 @@ allow virt_domain virtd_t:fd use; allow virt_domain virtd_t:fifo_file rw_fifo_file_perms; allow virt_domain virtd_t:process sigchld; +allow virt_domain virtlogd_t:fd use; +allow virt_domain virtlogd_t:fifo_file rw_fifo_file_perms; + dontaudit virt_domain virtd_t:unix_stream_socket { read write }; manage_dirs_pattern(virt_domain, virt_cache_t, virt_cache_t) @@ -472,6 +484,9 @@ dontaudit virtd_t virt_domain:process { siginh noatsecure rlimitinh }; allow virtd_t { virt_domain svirt_lxc_domain }:unix_stream_socket { create_stream_socket_perms connectto }; allow virtd_t svirt_lxc_domain:process signal_perms; +allow virtd_t virtlogd_t:fd use; +allow virtd_t virtlogd_t:fifo_file rw_fifo_file_perms; + allow virtd_t virtd_lxc_t:process { signal signull sigkill }; domtrans_pattern(virtd_t, virtd_lxc_exec_t, virtd_lxc_t) @@ -558,6 +573,7 @@ filetrans_pattern(virtd_t, virt_var_run_t, virtd_lxc_var_run_t, dir, "lxc") stream_connect_pattern(virtd_t, virtd_lxc_var_run_t, virtd_lxc_var_run_t, virtd_lxc_t) stream_connect_pattern(virtd_t, svirt_var_run_t, svirt_var_run_t, virt_domain) stream_connect_pattern(virtd_t, virt_var_run_t, virtlockd_run_t, virtlockd_t) +stream_connect_pattern(virtd_t, virt_var_run_t, virtlogd_run_t, virtlogd_t) can_exec(virtd_t, virt_tmp_t) @@ -1319,3 +1335,29 @@ miscfiles_read_localization(virtlockd_t) virt_append_log(virtlockd_t) virt_read_config(virtlockd_t) + +######################################## +# +# Virtlogd local policy +# + +allow virtlogd_t self:fifo_file rw_fifo_file_perms; + +allow virtlogd_t virtd_t:dir list_dir_perms; +allow virtlogd_t virtd_t:file read_file_perms; +allow virtlogd_t virtd_t:lnk_file read_lnk_file_perms; + +manage_files_pattern(virtlogd_t, virt_var_run_t, virtlogd_run_t) +manage_sock_files_pattern(virtlogd_t, virt_var_run_t, virtlogd_run_t) +filetrans_pattern(virtlogd_t, virt_var_run_t, virtlogd_run_t, sock_file) +files_pid_filetrans(virtlogd_t, virtlogd_run_t, file) + +can_exec(virtlogd_t, virtlogd_exec_t) + +files_read_etc_files(virtlogd_t) +files_list_var_lib(virtlogd_t) + +miscfiles_read_localization(virtlogd_t) + +virt_manage_log(virtlogd_t) +virt_read_config(virtlogd_t)