LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-01-2010, 02:34 PM   #1
guarapo
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
Question cron:session flood my auth.log


Hi folks, first of all i am sorry about my English.
I am running Apache 2 mod php5, it uses a cron job for cleaning sessions, ok. Also, Debian uses another one.

CRON[x]: pam_unix(cron:session): session opened for user root by (uid=0), flood my auth.log

I want to keep this pam-cron logs, but not in auth.log, i tried to making an rsyslog.d rule, but it does not work:

# vi auth-cron.conf
if $syslogfacility-text == 'auth' \
and $msg contains 'CRON*' then -/var/log/auth-cron.log
if $syslogfacility-text == 'authpriv' \
and $msg contains 'CRON*' then -/var/log/auth-cron2.log
& ~

I am very bad with scripting, and much more bad with rsyslog scripting...

Any help? Thanks
 
Old 12-01-2010, 05:02 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Rsyslog comes with way more options than stock syslogd and I'm sure I haven't tried all options so YMMV(VM). "cron" is a facility ('man 3 syslog') so I'd say either:
Code:
cron.* /var/log/cron # you should already have this line.
if $syslogfacility-text == "cron" and $msg contains "session opened for user root" then /var/log/cron_auth
which limits filtering by looking at the syslog facility first and then the message string (no regexes allowed) or more generic:
Code:
cron.* /var/log/cron # you should already have this line.
:msg, contains, "session opened for user root" /var/log/cron_auth
 
Old 12-03-2010, 09:31 AM   #3
guarapo
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Dec 3 15:17:01 xxx CRON[20671]: pam_unix(cron:session): session opened for user root by (uid=0)

it does not work, but thank you for your reply.
Maybe it is a auth facility? because it is pam module, who logs cron sessions? i don't know...

Last edited by guarapo; 12-03-2010 at 09:33 AM.
 
Old 12-03-2010, 01:47 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by guarapo View Post
it does not work
Crap.


Quote:
Originally Posted by guarapo View Post
Maybe it is a auth facility? because it is pam module, who logs cron sessions? i don't know...
If it would be the auth facility then that's something you could test yourself. (Do let us know.) It isn't about PAM IIRC but the *source* of the messages. And that would be cron...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl or PHP Script that can tail /var/log/auth.log - two-factor authentication tdnnash25 Linux - Server 1 06-18-2009 08:36 PM
the significance and name of the 5th column of /var/log/auth.log (ubuntu server)? CoffeeKing!!! Linux - Security 4 02-05-2009 07:32 AM
What the %$#@ is pam_unix (cron:session) doing every ten minutes? (/var/log/auth.log) CoffeeKing!!! Linux - Security 3 02-05-2009 07:07 AM
/var/log/auth.log doens't have correct date and hostname (Solution) alfmarius Linux - Newbie 0 10-07-2008 06:09 AM
removing cron entries from auth.log divukman Linux - Software 2 05-27-2006 05:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration