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 94F04138010 for ; Sat, 27 Oct 2012 11:48:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E8CF721C0AB; Sat, 27 Oct 2012 11:47:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EFFA921C0A9 for ; Sat, 27 Oct 2012 11:47:31 +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 E667733D92A for ; Sat, 27 Oct 2012 11:47:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9CA1AE544E for ; Sat, 27 Oct 2012 11:47:28 +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: <1351338231.9883eb3681ca2cb53ec218e58ef7698242f32af7.SwifT@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/setroubleshoot.if policy/modules/contrib/setroubleshoot.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 9883eb3681ca2cb53ec218e58ef7698242f32af7 X-VCS-Branch: master Date: Sat, 27 Oct 2012 11:47:28 +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: bc1cb195-e535-404f-9131-4087685164a2 X-Archives-Hash: fb78184a44aeb7b33522fe366dd37dde commit: 9883eb3681ca2cb53ec218e58ef7698242f32af7 Author: Dominick Grift gmail com> AuthorDate: Sat Oct 27 09:56:54 2012 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Sat Oct 27 11:43:51 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=9883eb36 Changes to the setroubleshoot policy module Ported from Fedora with changes Signed-off-by: Dominick Grift gmail.com> --- policy/modules/contrib/setroubleshoot.if | 22 ++++---- policy/modules/contrib/setroubleshoot.te | 81 ++++++++++++++++++------------ 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/policy/modules/contrib/setroubleshoot.if b/policy/modules/contrib/setroubleshoot.if index bcdd16c..3a9a70b 100644 --- a/policy/modules/contrib/setroubleshoot.if +++ b/policy/modules/contrib/setroubleshoot.if @@ -1,8 +1,9 @@ -## SELinux troubleshooting service +## SELinux troubleshooting service. ######################################## ## -## Connect to setroubleshootd over an unix stream socket. +## Connect to setroubleshootd with a +## unix domain stream socket. ## ## ## @@ -22,8 +23,9 @@ interface(`setroubleshoot_stream_connect',` ######################################## ## -## Dontaudit attempts to connect to setroubleshootd -## over an unix stream socket. +## Do not audit attempts to connect to +## setroubleshootd with a unix +## domain stream socket. ## ## ## @@ -105,8 +107,8 @@ interface(`setroubleshoot_dbus_chat_fixit',` ######################################## ## -## All of the rules required to administrate -## an setroubleshoot environment +## All of the rules required to +## administrate an setroubleshoot environment. ## ## ## @@ -117,15 +119,15 @@ interface(`setroubleshoot_dbus_chat_fixit',` # interface(`setroubleshoot_admin',` gen_require(` - type setroubleshootd_t, setroubleshoot_log_t; + type setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_fixit_t; type setroubleshoot_var_lib_t, setroubleshoot_var_run_t; ') - allow $1 setroubleshootd_t:process { ptrace signal_perms }; - ps_process_pattern($1, setroubleshootd_t) + allow $1 { setroubleshoot_fixit_t setroubleshootd_t }:process { ptrace signal_perms }; + ps_process_pattern($1, { setroubleshootd_t setroubleshoot_fixit_t }) logging_list_logs($1) - admin_pattern($1, setroubleshoot_log_t) + admin_pattern($1, setroubleshoot_var_log_t) files_list_var_lib($1) admin_pattern($1, setroubleshoot_var_lib_t) diff --git a/policy/modules/contrib/setroubleshoot.te b/policy/modules/contrib/setroubleshoot.te index 086cd5f..5702d59 100644 --- a/policy/modules/contrib/setroubleshoot.te +++ b/policy/modules/contrib/setroubleshoot.te @@ -1,4 +1,4 @@ -policy_module(setroubleshoot, 1.11.0) +policy_module(setroubleshoot, 1.11.1) ######################################## # @@ -7,84 +7,85 @@ policy_module(setroubleshoot, 1.11.0) type setroubleshootd_t alias setroubleshoot_t; type setroubleshootd_exec_t; -domain_type(setroubleshootd_t) -init_daemon_domain(setroubleshootd_t, setroubleshootd_exec_t) +init_system_domain(setroubleshootd_t, setroubleshootd_exec_t) type setroubleshoot_fixit_t; type setroubleshoot_fixit_exec_t; -dbus_system_domain(setroubleshoot_fixit_t, setroubleshoot_fixit_exec_t) +init_system_domain(setroubleshoot_fixit_t, setroubleshoot_fixit_exec_t) type setroubleshoot_var_lib_t; files_type(setroubleshoot_var_lib_t) -# log files type setroubleshoot_var_log_t; logging_log_file(setroubleshoot_var_log_t) -# pid files type setroubleshoot_var_run_t; files_pid_file(setroubleshoot_var_run_t) ######################################## # -# setroubleshootd local policy +# Local policy # -allow setroubleshootd_t self:capability { dac_override sys_nice sys_tty_config }; -allow setroubleshootd_t self:process { getattr getsched setsched sigkill signull signal }; +allow setroubleshootd_t self:capability { dac_override sys_nice sys_ptrace sys_tty_config }; +allow setroubleshootd_t self:process { getattr getsched setsched sigkill signull signal execmem execstack }; allow setroubleshootd_t self:fifo_file rw_fifo_file_perms; -allow setroubleshootd_t self:tcp_socket create_stream_socket_perms; -allow setroubleshootd_t self:unix_stream_socket { create_stream_socket_perms connectto }; -allow setroubleshootd_t self:unix_dgram_socket create_socket_perms; +allow setroubleshootd_t self:tcp_socket { accept listen }; +allow setroubleshootd_t self:unix_stream_socket { accept connectto listen }; -# database files -allow setroubleshootd_t setroubleshoot_var_lib_t:dir setattr; +allow setroubleshootd_t setroubleshoot_var_lib_t:dir setattr_dir_perms; manage_files_pattern(setroubleshootd_t, setroubleshoot_var_lib_t, setroubleshoot_var_lib_t) files_var_lib_filetrans(setroubleshootd_t, setroubleshoot_var_lib_t, { file dir }) -# log files -allow setroubleshootd_t setroubleshoot_var_log_t:dir setattr; -manage_files_pattern(setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_log_t) +allow setroubleshootd_t setroubleshoot_var_log_t:dir setattr_dir_perms; +append_files_pattern(setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_log_t) +create_files_pattern(setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_log_t) +setattr_files_pattern(setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_log_t) manage_sock_files_pattern(setroubleshootd_t, setroubleshoot_var_log_t, setroubleshoot_var_log_t) logging_log_filetrans(setroubleshootd_t, setroubleshoot_var_log_t, { file dir }) -# pid file +manage_dirs_pattern(setroubleshootd_t, setroubleshoot_var_run_t, setroubleshoot_var_run_t) manage_files_pattern(setroubleshootd_t, setroubleshoot_var_run_t, setroubleshoot_var_run_t) manage_sock_files_pattern(setroubleshootd_t, setroubleshoot_var_run_t, setroubleshoot_var_run_t) -files_pid_filetrans(setroubleshootd_t, setroubleshoot_var_run_t, { file sock_file }) +files_pid_filetrans(setroubleshootd_t, setroubleshoot_var_run_t, { file sock_file dir }) kernel_read_kernel_sysctls(setroubleshootd_t) kernel_read_system_state(setroubleshootd_t) kernel_read_net_sysctls(setroubleshootd_t) kernel_read_network_state(setroubleshootd_t) +kernel_dontaudit_list_all_proc(setroubleshootd_t) +kernel_read_irq_sysctls(setroubleshootd_t) +kernel_read_unlabeled_state(setroubleshootd_t) corecmd_exec_bin(setroubleshootd_t) corecmd_exec_shell(setroubleshootd_t) +corecmd_read_all_executables(setroubleshootd_t) corenet_all_recvfrom_unlabeled(setroubleshootd_t) corenet_all_recvfrom_netlabel(setroubleshootd_t) corenet_tcp_sendrecv_generic_if(setroubleshootd_t) corenet_tcp_sendrecv_generic_node(setroubleshootd_t) -corenet_tcp_sendrecv_all_ports(setroubleshootd_t) -corenet_tcp_bind_generic_node(setroubleshootd_t) -corenet_tcp_connect_smtp_port(setroubleshootd_t) + corenet_sendrecv_smtp_client_packets(setroubleshootd_t) +corenet_tcp_connect_smtp_port(setroubleshootd_t) +corenet_tcp_sendrecv_smtp_port(setroubleshootd_t) dev_read_urand(setroubleshootd_t) dev_read_sysfs(setroubleshootd_t) dev_getattr_all_blk_files(setroubleshootd_t) dev_getattr_all_chr_files(setroubleshootd_t) +dev_getattr_mtrr_dev(setroubleshootd_t) domain_dontaudit_search_all_domains_state(setroubleshootd_t) domain_signull_all_domains(setroubleshootd_t) files_read_usr_files(setroubleshootd_t) -files_read_etc_files(setroubleshootd_t) files_list_all(setroubleshootd_t) files_getattr_all_files(setroubleshootd_t) files_getattr_all_pipes(setroubleshootd_t) files_getattr_all_sockets(setroubleshootd_t) files_read_all_symlinks(setroubleshootd_t) +files_read_mnt_files(setroubleshootd_t) fs_getattr_all_dirs(setroubleshootd_t) fs_getattr_all_files(setroubleshootd_t) @@ -95,6 +96,7 @@ fs_dontaudit_read_cifs_files(setroubleshootd_t) selinux_get_enforce_mode(setroubleshootd_t) selinux_validate_context(setroubleshootd_t) +selinux_read_policy(setroubleshootd_t) term_dontaudit_use_all_ptys(setroubleshootd_t) term_dontaudit_use_all_ttys(setroubleshootd_t) @@ -104,7 +106,7 @@ auth_use_nsswitch(setroubleshootd_t) init_read_utmp(setroubleshootd_t) init_dontaudit_write_utmp(setroubleshootd_t) -miscfiles_read_localization(setroubleshootd_t) +libs_exec_ld_so(setroubleshootd_t) locallogin_dontaudit_use_fds(setroubleshootd_t) @@ -112,7 +114,7 @@ logging_send_audit_msgs(setroubleshootd_t) logging_send_syslog_msg(setroubleshootd_t) logging_stream_connect_dispatcher(setroubleshootd_t) -modutils_read_module_config(setroubleshootd_t) +miscfiles_read_localization(setroubleshootd_t) seutil_read_config(setroubleshootd_t) seutil_read_file_contexts(setroubleshootd_t) @@ -125,6 +127,15 @@ optional_policy(` ') optional_policy(` + locate_read_lib_files(setroubleshootd_t) +') + +optional_policy(` + modutils_read_module_config(setroubleshootd_t) +') + +optional_policy(` + rpm_exec(setroubleshootd_t) rpm_signull(setroubleshootd_t) rpm_read_db(setroubleshootd_t) rpm_dontaudit_manage_db(setroubleshootd_t) @@ -133,13 +144,12 @@ optional_policy(` ######################################## # -# setroubleshoot_fixit local policy +# Fixit local policy # allow setroubleshoot_fixit_t self:capability sys_nice; allow setroubleshoot_fixit_t self:process { setsched getsched }; allow setroubleshoot_fixit_t self:fifo_file rw_fifo_file_perms; -allow setroubleshoot_fixit_t self:unix_dgram_socket create_socket_perms; allow setroubleshoot_fixit_t setroubleshootd_t:process signull; @@ -154,7 +164,6 @@ corecmd_exec_shell(setroubleshoot_fixit_t) seutil_domtrans_setfiles(setroubleshoot_fixit_t) files_read_usr_files(setroubleshoot_fixit_t) -files_read_etc_files(setroubleshoot_fixit_t) files_list_tmp(setroubleshoot_fixit_t) auth_use_nsswitch(setroubleshoot_fixit_t) @@ -164,14 +173,20 @@ logging_send_syslog_msg(setroubleshoot_fixit_t) miscfiles_read_localization(setroubleshoot_fixit_t) +userdom_read_all_users_state(setroubleshoot_fixit_t) +userdom_signull_unpriv_users(setroubleshoot_fixit_t) + +optional_policy(` + dbus_system_domain(setroubleshoot_fixit_t, setroubleshoot_fixit_exec_t) + + optional_policy(` + policykit_dbus_chat(setroubleshoot_fixit_t) + ') +') + optional_policy(` rpm_signull(setroubleshoot_fixit_t) rpm_read_db(setroubleshoot_fixit_t) rpm_dontaudit_manage_db(setroubleshoot_fixit_t) rpm_use_script_fds(setroubleshoot_fixit_t) ') - -optional_policy(` - policykit_dbus_chat(setroubleshoot_fixit_t) - userdom_read_all_users_state(setroubleshoot_fixit_t) -')