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 F04FF138010 for ; Wed, 17 Oct 2012 17:42:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 42DB6E01A3; Wed, 17 Oct 2012 17:41:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A9421E01A3 for ; Wed, 17 Oct 2012 17:41:14 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D560733D7D5 for ; Wed, 17 Oct 2012 17:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8A9C6E5441 for ; Wed, 17 Oct 2012 17:41:12 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1350495427.4aa4bb6567da69b4b6a657b17bcc6cb6a8fb23e5.SwifT@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: / X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: pacemaker.fc pacemaker.if pacemaker.te X-VCS-Directories: / X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 4aa4bb6567da69b4b6a657b17bcc6cb6a8fb23e5 X-VCS-Branch: master Date: Wed, 17 Oct 2012 17:41:12 +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: 0d18121a-ab35-46b0-83e1-5771f9239d74 X-Archives-Hash: c2083ffb068e74c810228cb9698a0c3c commit: 4aa4bb6567da69b4b6a657b17bcc6cb6a8fb23e5 Author: Dominick Grift gmail com> AuthorDate: Tue Oct 16 13:55:50 2012 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Wed Oct 17 17:37:07 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=4aa4bb65 Initial pacemaker policy module Pacemaker is an Open Source, High Availability resource manager suitable for both small and large clusters Ported from Fedora with changes Signed-off-by: Dominick Grift gmail.com> --- pacemaker.fc | 9 +++++++++ pacemaker.if | 39 +++++++++++++++++++++++++++++++++++++++ pacemaker.te | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 0 deletions(-) diff --git a/pacemaker.fc b/pacemaker.fc new file mode 100644 index 0000000..a66d7be --- /dev/null +++ b/pacemaker.fc @@ -0,0 +1,9 @@ +/etc/rc\.d/init\.d/pacemaker -- gen_context(system_u:object_r:pacemaker_initrc_exec_t,s0) + +/usr/sbin/pacemakerd -- gen_context(system_u:object_r:pacemaker_exec_t,s0) + +/var/lib/heartbeat/crm(/.*)? gen_context(system_u:object_r:pacemaker_var_lib_t,s0) + +/var/lib/pengine(/.*)? gen_context(system_u:object_r:pacemaker_var_lib_t,s0) + +/var/run/crm(/.*)? gen_context(system_u:object_r:pacemaker_var_run_t,s0) diff --git a/pacemaker.if b/pacemaker.if new file mode 100644 index 0000000..9682d9a --- /dev/null +++ b/pacemaker.if @@ -0,0 +1,39 @@ +## A scalable high-availability cluster resource manager. + +######################################## +## +## All of the rules required to +## administrate an pacemaker environment. +## +## +## +## Domain allowed access. +## +## +## +## +## Role allowed access. +## +## +## +# +interface(`pacemaker_admin',` + gen_require(` + type pacemaker_t, pacemaker_initrc_exec_t, pacemaker_var_lib_t; + type pacemaker_var_run_t; + ') + + allow $1 pacemaker_t:process { ptrace signal_perms }; + ps_process_pattern($1, pacemaker_t) + + init_labeled_script_domtrans($1, pacemaker_initrc_exec_t) + domain_system_change_exemption($1) + role_transition $2 pacemaker_initrc_exec_t system_r; + allow $2 system_r; + + files_search_var_lib($1) + admin_pattern($1, pacemaker_var_lib_t) + + files_search_pids($1) + admin_pattern($1, pacemaker_var_run_t) +') diff --git a/pacemaker.te b/pacemaker.te new file mode 100644 index 0000000..8a17a11 --- /dev/null +++ b/pacemaker.te @@ -0,0 +1,49 @@ +policy_module(pacemaker, 1.0.0) + +######################################## +# +# Declarations +# + +type pacemaker_t; +type pacemaker_exec_t; +init_daemon_domain(pacemaker_t, pacemaker_exec_t) + +type pacemaker_initrc_exec_t; +init_script_file(pacemaker_initrc_exec_t) + +type pacemaker_var_lib_t; +files_type(pacemaker_var_lib_t) + +type pacemaker_var_run_t; +files_pid_file(pacemaker_var_run_t) + +######################################## +# +# Local policy +# + +allow pacemaker_t self:capability { chown dac_override setuid }; +allow pacemaker_t self:process { setrlimit signal }; +allow pacemaker_t self:fifo_file rw_fifo_file_perms; +allow pacemaker_t self:unix_stream_socket { accept listen }; + +manage_dirs_pattern(pacemaker_t, pacemaker_var_lib_t, pacemaker_var_lib_t) +manage_files_pattern(pacemaker_t, pacemaker_var_lib_t, pacemaker_var_lib_t) +files_var_lib_filetrans(pacemaker_t, pacemaker_var_lib_t, { dir file }) + +manage_dirs_pattern(pacemaker_t, pacemaker_var_run_t, pacemaker_var_run_t) +manage_files_pattern(pacemaker_t, pacemaker_var_run_t, pacemaker_var_run_t) +files_pid_filetrans(pacemaker_t, pacemaker_var_run_t, { dir file }) + +domain_use_interactive_fds(pacemaker_t) + +auth_use_nsswitch(pacemaker_t) + +logging_send_syslog_msg(pacemaker_t) + +miscfiles_read_localization(pacemaker_t) + +optional_policy(` + corosync_stream_connect(pacemaker_t) +')