[Home]

Summary:ASTERISK-05473: make running as non-root an asterisk.conf option
Reporter:silik0n (silik0n)Labels:
Date Opened:2005-11-06 00:12:04.000-0600Date Closed:2008-01-15 15:54:34.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) noroot.patch.txt
( 1) noroot.patch.v2.txt
Description:Small patch to allow asterisk to be more easily run as non-root to help avoid security issues.
This patch does not address chowning directories and things in /dev at install time.


****** ADDITIONAL INFORMATION ******

adds [user] section and runuser, rungroup settings to asterisk.conf

if these are set and -G and/or -U are not used to exec asterisk, even when execing asterisk as root, asterisk will setuid and setgid to the specified user and group as well as drop additional group permissions. I have tested this on Gentoo and on OSX 10.4.3

note: this requires the user to chown the proper directories and /dev/zap to the running user and/or group.
Comments:By: Mark Spencer (markster) 2005-11-06 00:14:33.000-0600

Why are we adding a new section rather than just using the existing [options] space?  You can actually document it in doc/README.asterisk.conf rather than in the Makefile.

By: Mark Spencer (markster) 2005-11-06 00:14:49.000-0600

(other than that great idea though!)

By: silik0n (silik0n) 2005-11-06 00:38:43.000-0600

I wasnt paying much attention to the [options] section when I wrote this, thats not a big change here and I will adjust it accordingly. Part of my motivation for this patch is for pushing asterisk a little closer to the apache or bind model of not running as root by default. But for that to happen there are going to have to be some adjustments and I dont feel that would get implemented prior to the 1.2 release.

things such as if make install detects that it is being ran as root it automagically chowns the directories and devices accordingly.

Due to the previous work already done on asterisk this is a pretty minor patch

By: silik0n (silik0n) 2005-11-06 00:48:19.000-0600

update patch as per Mark's thoughs

Anyone else have thoughs on making this the default behavior (post-1.2 unless the powers that be would like to see this in 1.2)

By: Kevin P. Fleming (kpfleming) 2005-11-07 19:40:13.000-0600

Committed to CVS HEAD after correcting the patch (it was malformed) and fixing a spelling error. Thanks!

(Note to those watching: While technically this could be considered a new feature, I accepted it because it is only a new way to invoke an existing feature).

By: Digium Subversion (svnbot) 2008-01-15 15:54:34.000-0600

Repository: asterisk
Revision: 7004

U   trunk/ChangeLog
U   trunk/asterisk.c
U   trunk/doc/README.asterisk.conf

------------------------------------------------------------------------
r7004 | kpfleming | 2008-01-15 15:54:33 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5473

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7004