[wplug] SpamAssassin -- user_prefs security hole?

Brandon Kuczenski brandon at 301south.net
Wed May 26 17:10:23 EDT 2004


> > ....
> > 
> >>Running spamd as a special user (create a spamd user, for example) is
> >>a good idea ... as long as you ensure that the spamd user doesn't have
> >>access to anything dangerous.  You could even place various resource
> >>limits on the spamd user to keep the process under control.  It's true
> >>that any rules could run as user spamd ... just make sure that the
> >>user spamd can't do anything dangerous!
> > 
> > <newbie>So.... how do I make a program run as a certain user?  At this 
> > point I am starting spamd using Redhat's standard /etc/init.d/blarg 
> > scripting paradigm (whoah, I think I actually used that word correctly!).
> 
> Generally, use su.  Something like this should work in an init script:
> 
> su spamduser -c spamd
> 

It turns out to be easier than that -- I just pass -u username to spamd!

Though without that, it would have been harder because Redhat has this 
function called 'daemon' which runs with spamd as an argument, and I'm not 
sure how it would have worked.......

Anyway, my system is basically a one-user system anyway.  But I still want 
things to go the right way.  So now spamd is running as user spamd.

> I haven't looked recently, but this construct is pretty common in
> FreeBSD init scripts ... I'd be surprised if you didn't find any init
> scripts on your Linux machine that weren't already doing this.
> 

I should learn FreeBSD.

> > Also, you mention resource limits... I haven't learned about those yet... 
> > Can you point me to a handy reference?
> 
> This is one of those things I understand in FreeBSD and am only assuming
> works in Linux.  A quick look at a nearby Fedora box didn't help me
> any ... so I'll just explain how it works in FreeBSD and hope someone
> can explain how it works in Linux.

Thanks for the summary.  I will look it over.  We don't have an 
/etc/login.conf file but perhaps there is an analog.

I should really learn FreeBSD.

> /etc/master.passwd (the "shadow password" file) contains a field for defining
> which profile each user belongs to, so you can add different users to
> different resource limit profiles.  If you don't define a profile, the system
> gives them the "default" profile, which (as you can see) is unlimited by
> default.

/etc/shadow in redhat

-Brandon





More information about the wplug mailing list