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 436D8138010 for ; Fri, 2 Nov 2012 19:13:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8093521C0D1; Fri, 2 Nov 2012 19:12:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8967021C0D2 for ; Fri, 2 Nov 2012 19:12:16 +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 8BC2233D81F for ; Fri, 2 Nov 2012 19:12:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 94D6CE545A for ; Fri, 2 Nov 2012 19:12:13 +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: <1351883310.5699bcbafb5cd98151592c881e49b653fa640352.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/mysql.if policy/modules/contrib/mysql.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 5699bcbafb5cd98151592c881e49b653fa640352 X-VCS-Branch: master Date: Fri, 2 Nov 2012 19:12:13 +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: 2d5898a4-09fa-43ee-8467-359b795dd316 X-Archives-Hash: a9735e332789e4918c586fe5c9d8ad27 commit: 5699bcbafb5cd98151592c881e49b653fa640352 Author: Dominick Grift gmail com> AuthorDate: Fri Nov 2 15:31:04 2012 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Fri Nov 2 19:08:30 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=5699bcba Changes to the mysql policy module Adda mysql_run_mysqld for mysql_admin() so that caller can run script to create initial database. Script runs mysqld and mysqld needs setuid Script also checks for write on root_t needs to be dontaudited/audit_access in dbadm policy module Signed-off-by: Dominick Grift gmail.com> --- policy/modules/contrib/mysql.if | 31 ++++++++++++++++++++++++++++--- policy/modules/contrib/mysql.te | 6 +++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/policy/modules/contrib/mysql.if b/policy/modules/contrib/mysql.if index c55d58c..590748a 100644 --- a/policy/modules/contrib/mysql.if +++ b/policy/modules/contrib/mysql.if @@ -40,6 +40,31 @@ interface(`mysql_domtrans',` ######################################## ## +## Execute mysqld in the mysqld domain, and +## allow the specified role the mysqld domain. +## +## +## +## Domain allowed to transition. +## +## +## +## +## Role allowed access. +## +## +# +interface(`mysql_run_mysqld',` + gen_require(` + attribute_role mysqld_roles; + ') + + mysql_domtrans($1) + roleattribute $2 mysqld_roles; +') + +######################################## +## ## Send generic signals to mysqld. ## ## @@ -416,7 +441,7 @@ interface(`mysql_search_pid_files',` # interface(`mysql_admin',` gen_require(` - type mysqld_t, mysqld_var_run_t, mysqld_etc_t, mysqld_exec_t; + type mysqld_t, mysqld_var_run_t, mysqld_etc_t; type mysqld_tmp_t, mysqld_db_t, mysqld_log_t; type mysqld_safe_t, mysqlmanagerd_t, mysqlmanagerd_var_run_t; type mysqld_initrc_exec_t, mysqlmanagerd_initrc_exec_t, mysqld_home_t; @@ -430,8 +455,6 @@ interface(`mysql_admin',` role_transition $2 { mysqlmanagerd_initrc_exec_t mysqld_initrc_exec_t } system_r; allow $2 system_r; - can_exec($1, mysqld_exec_t) - files_search_pids($1) admin_pattern($1, { mysqlmanagerd_var_run_t mysqld_var_run_t }) @@ -446,6 +469,8 @@ interface(`mysql_admin',` files_search_tmp($1) admin_pattern($1, mysqld_tmp_t) + + mysql_run_mysqld($1, $2) ') ####################################### diff --git a/policy/modules/contrib/mysql.te b/policy/modules/contrib/mysql.te index da6f8c5..b1880c6 100644 --- a/policy/modules/contrib/mysql.te +++ b/policy/modules/contrib/mysql.te @@ -1,4 +1,4 @@ -policy_module(mysql, 1.13.3) +policy_module(mysql, 1.13.4) ######################################## # @@ -13,9 +13,13 @@ policy_module(mysql, 1.13.3) ## gen_tunable(mysql_connect_any, false) +attribute_role mysqld_roles; + type mysqld_t; type mysqld_exec_t; init_daemon_domain(mysqld_t, mysqld_exec_t) +application_domain(mysqld_t, mysqld_exec_t) +role mysqld_roles types mysqld_t; type mysqld_safe_t; type mysqld_safe_exec_t;