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 CBA01139694 for ; Sat, 25 Feb 2017 16:58:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0211E0DA4; Sat, 25 Feb 2017 16:58:19 +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 B9A46E0D9E for ; Sat, 25 Feb 2017 16:58: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 5CB75341026 for ; Sat, 25 Feb 2017 16:58:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CF195545C for ; Sat, 25 Feb 2017 16:58: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: <1488041849.5d09eb208d774b72835ad7b168eba163d0459524.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: 5d09eb208d774b72835ad7b168eba163d0459524 X-VCS-Branch: next Date: Sat, 25 Feb 2017 16:58: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: ade12199-7ef4-449a-8cbb-4615d8cf2061 X-Archives-Hash: d667a83ae2a373dd987938c96f25c02f commit: 5d09eb208d774b72835ad7b168eba163d0459524 Author: Jason Zaman perfinion com> AuthorDate: Thu May 12 16:49:07 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Feb 25 16:57:29 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=5d09eb20 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)