From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 24 18:50:01 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91CE1065689 for ; Wed, 24 Mar 2010 18:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B5E7B8FC14 for ; Wed, 24 Mar 2010 18:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o2OIo1at066552 for ; Wed, 24 Mar 2010 18:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2OIo19K066551; Wed, 24 Mar 2010 18:50:01 GMT (envelope-from gnats) Resent-Date: Wed, 24 Mar 2010 18:50:01 GMT Resent-Message-Id: <201003241850.o2OIo19K066551@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Reynolds Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD89106566B for ; Wed, 24 Mar 2010 18:46:24 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 08D958FC13 for ; Wed, 24 Mar 2010 18:46:24 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OIkNig040864 for ; Wed, 24 Mar 2010 18:46:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o2OIkNm3040863; Wed, 24 Mar 2010 18:46:23 GMT (envelope-from nobody) Message-Id: <201003241846.o2OIkNm3040863@www.freebsd.org> Date: Wed, 24 Mar 2010 18:46:23 GMT From: Michael Reynolds To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/145009: rc.conf should allow mac label configuration X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2010 18:50:01 -0000 >Number: 145009 >Category: conf >Synopsis: rc.conf should allow mac label configuration >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Mar 24 18:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Michael Reynolds >Release: 8.0-STABLE >Organization: >Environment: n/a >Description: rc.conf, via rc.subr, should allow service specific labels to be set, so as to efficiently handle security, and ensure a working machine after enabling MAC. >How-To-Repeat: >Fix: Apply the affixed patch, add this (as an example) to your rc.conf: auditd_label="biba/high,lomac/high,mls/high,partition/equal" Patch attached with submission follows: --- etc/rc.subr 2009-12-30 14:25:40.000000000 -0500 +++ /etc/rc.subr 2010-03-18 11:39:16.000000000 -0400 @@ -646,7 +646,8 @@ fi eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ _nice=\$${name}_nice _user=\$${name}_user \ - _group=\$${name}_group _groups=\$${name}_groups + _group=\$${name}_group _groups=\$${name}_groups \ + _label=\$${name}_label if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -726,10 +727,12 @@ if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ +${_label:+setpmac $_label }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else _doit="\ +${_label:+setpmac $_label }\ ${_chdir:+cd $_chdir && }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then >Release-Note: >Audit-Trail: >Unformatted: