running as an alternate user / file ownership/permissions

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

running as an alternate user / file ownership/permissions

Postby chakkerz on Fri May 09, 2008 3:40 am

Hello there

I was wondering if it is possible to get rsyslog to run as a different user, for instance rsyslog ... or to get it to write files to be owned by someone other than root. OR with other default permissions than 600

Cheers

Chakkerz
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Postby chakkerz on Fri May 09, 2008 3:45 am

erm ... found (just too late)

http://www.rsyslog.com/doc-rsconf1_filecreatemode.html

That doesn't get around the running not as root though
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Postby rgerhards on Fri May 09, 2008 7:00 am

You should also look at $FileOwner, $FileGroup and the respective $Dir.. directives.

As for a different user, this is not yet implemented. It also currently has no priority, as I was told this is no longer an issue in the days of selinux. I personally have no hard opinion on it, just following general demand...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 1274
Joined: Thu Feb 13, 2003 11:57 am

Postby chakkerz on Fri May 09, 2008 9:12 am

erm .. yes ... SE Linux does get around the issue, that is true.

And (far from being an SE Linux expert, though i have completed the Red Hat training / certification on that one [alas i don't get to use it enough to become an expert]) i have to say that when a system can get itself into a tight enough knot where the setroubleshoot service can not start because selinux is blocking it, and when it does start it craters anyway. Or when relabelling all files at start up, or using restorecon or fixfiles yields files that are in the same directory and rotates of the same log file, created by the same *syslog daemon i feel that 1) i need to re-read my course notes, and 2) there are still some issues to be resolved.

That said, it worked extremely well during the course ... lord knows i may have screwed something else up.

Also, i don't think that anyone in their right mind, even after running in permissive mode without errors truly expects that they can turn on selinux and not have errors. SE Linux is great ... but it's far from flawless. And the tools to support it are also far from flawless. And the Documentation that ships with the distros ... is somewhat lacking.

... but you know what the hilarious aspect of this is? I disabled selinux yesterday because it kept resulting in crashing my multipathd service. Fingers crossed i find some time monday to sort out the selinux issue so i can re-enable it :) But darn do i want to use SElinux ... it would be nice to put that training to use :)

chakkerz
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Postby rgerhards on Fri May 09, 2008 9:45 am

Yeah... I am not a SE Linux expert at all. I see that there is some usefulness in natively supporting running under non-root. But there are tons of other features waiting for implementation. So it becomes a matter of priorities. Priorities depend on what is often asked for.

For example: I am currently working on a real secure TLS mode, what will (probably) be followed by a real secure and real reliable TLS mode for RELP. Should I stop implementing TLS to do the user thing? Maybe... But practice tells me many have asked for TLS and so far one for the user. So guess what... ;)

(This may also be viewed as a call to action for all those who would like see a "not root" capability in rsyslog - obviously priorities are dynamic ;)).
User avatar
rgerhards
Site Admin
 
Posts: 1274
Joined: Thu Feb 13, 2003 11:57 am

Postby jli on Fri May 09, 2008 6:56 pm

I am using rsyslog for centralized logging for a couple of servers and I was also looking for this feature.

The reason is not wanting to have software that is exposed on a public IP to be running as root. I do not know SE Linux at all - currently I'm using an ugly hack to have rsyslog be started as a separate "rsyslog" user with su. Since non-root users can't listen on ports under 1024, I have it listening on 1514 (both tcp and udp) with iptables rules to forward data from 514 to 1514 (again, both tcp and udp).

It's not so nice and requires custom setup, but it works. Support for dropping permissions, like Apache, would be very welcome of course :).
jli
Avarage
 
Posts: 15
Joined: Fri May 09, 2008 6:44 pm

Re: running as an alternate user / file ownership/permissions

Postby chakkerz on Sun May 25, 2008 10:27 pm

Good Morning (Afternoon / Evening / Night)

I was pondering the security threat that rsyslog posses to its hosts by nature of it receptiveness. And i noted that the rsyslogd man page contains the following

3. The ext2 filesystem can be used which can be configured to limit
a certain percentage of a filesystem to usage by root only.
NOTE that this will require rsyslogd to be run as a non-root
process. ALSO NOTE that this will prevent usage of remote log-
ging on the default port since rsyslogd will be unable to bind
to the 514/UDP socket.


Which once again raises my question of how do you do that? or alternatively, you might want to edit the man page :)

cheers

chakkerz
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Re: running as an alternate user / file ownership/permissions

Postby chakkerz on Sun May 25, 2008 10:29 pm

PS.: I'm usually like this on a monday morning ... oh who am i kidding, always :P
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Re: running as an alternate user / file ownership/permissions

Postby rgerhards on Mon May 26, 2008 7:13 am

chakkerz wrote:Good Morning (Afternoon / Evening / Night)

I was pondering the security threat that rsyslog posses to its hosts by nature of it receptiveness. And i noted that the rsyslogd man page contains the following

3. The ext2 filesystem can be used which can be configured to limit
a certain percentage of a filesystem to usage by root only.
NOTE that this will require rsyslogd to be run as a non-root
process. ALSO NOTE that this will prevent usage of remote log-
ging on the default port since rsyslogd will be unable to bind
to the 514/UDP socket.


Which once again raises my question of how do you do that? or alternatively, you might want to edit the man page :)

cheers

chakkerz

Well, you can simply run it under a different user account. Rsyslogd does not really care if it is root or not. It just can't bind to privileged ports if it isn't root. So, yes, you can run it as any user you like. What it can not do is start as root and then drop privileges. Running alsways as e.g. "rsyslog" user is fine.

HTH
Rainer
User avatar
rgerhards
Site Admin
 
Posts: 1274
Joined: Thu Feb 13, 2003 11:57 am

Re: running as an alternate user / file ownership/permissions

Postby chakkerz on Mon May 26, 2008 7:47 am

touche :)

Interesting, i'll look into that some more mayhaps ... i've sort of resigned myself to running as root ... there is a bug in RHEL which means standard user's cronjobs ... may not run ...

but i need more time to check that out, so your suggestion is right up top :)

Thanks for pointing that out

chakkerz
chakkerz
Advanced
 
Posts: 38
Joined: Tue Jan 22, 2008 4:45 am
Location: Australia

Re: running as an alternate user / file ownership/permissions

Postby rgerhards on Mon May 26, 2008 7:50 am

anyhow, the discussion makes me begin to think providing the capability to drop privileges. I will see how this could be done. One thing that concerns me is HUPing the syslogd. At that point, I would need to regain higher privileges (because I would need to bind to the privileged ports). As of my understanding, this is not possible. I fear it becomes a bit inconsistent if I disable HUPing when running as a different user...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 1274
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron