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 3B2961395E2 for ; Tue, 6 Dec 2016 14:25:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1E4021C198; Tue, 6 Dec 2016 14:25:06 +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 694E2E0C5C for ; Tue, 6 Dec 2016 14:25:06 +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 9B654341641 for ; Tue, 6 Dec 2016 14:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1367124CD for ; Tue, 6 Dec 2016 14:25: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: <1481034025.584f2d47e1eb6d0ce23e9057899913366038f170.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: 584f2d47e1eb6d0ce23e9057899913366038f170 X-VCS-Branch: next Date: Tue, 6 Dec 2016 14:25: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: 39eb8030-0639-49be-94e9-1aa8f0c3b8e4 X-Archives-Hash: 0cdbee8382f27a0e5536e795fc0388f7 commit: 584f2d47e1eb6d0ce23e9057899913366038f170 Author: Jason Zaman perfinion com> AuthorDate: Thu May 12 16:49:07 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Tue Dec 6 14:20:25 2016 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=584f2d47 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 f7e0ce8..7d9456a 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 c45ba2d..16c2970 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)