LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-04-2016, 02:43 PM   #1
Rtwo
LQ Newbie
 
Registered: May 2016
Posts: 12

Rep: Reputation: Disabled
can I increase the time for the entries of auth.log?


This post is somewhat similar to another post here but mine is rather specific. CRON: pam_unix(cron:session): session opened for user root by (uid=0)

Is this really a bug? in our system this process is creating entries in every 5 minutes making the log backup guys' life v hard. lots lots of entries are being stored on the disk.

as per the following links, do we need to fix this issue or can we at least increase the time of listing between the entries?

https://bugs.debian.org/cgi-bin/bugr...cgi?bug=293272
http://languor.us/cron-pam-unix-cron...user-root-uid0


Can I at least reduce the time between entries? for my server currently its 1 pair of entry in every 5 minutes. Say, I've increased the time to 30 minutes , would I miss any login attempt(legit and not hacking
both) ?
 
Old 05-04-2016, 11:11 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
You can always reduce the noise by filtering with "grep" or "awk" first.

Code:
grep -v CRON /var/log/syslog | grep 'something'
or

Code:
awk '$5 !~ /CRON/' /var/log/syslog | grep 'something'
Which distro and which version of it are you working with?
 
Old 05-05-2016, 04:29 AM   #3
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 Rtwo View Post
Is this really a bug?
Why would it be? You (the system) ask cron to perform a job and it does just that...


Quote:
Originally Posted by Rtwo View Post
in our system this process is creating entries in every 5 minutes making the log backup guys' life v hard. lots lots of entries are being stored on the disk.
I don't understand why that would be a problem unless you are short on disk space or don't logrotate often enough or don't filter before you process (like Turbocapitalist hints at)?


Quote:
Originally Posted by Rtwo View Post
as per the following links, do we need to fix this issue or can we at least increase the time of listing between the entries?
I'd say for most people this probably wouldn' count as an "issue" and increasing the time between log entries means increasing the time between cron job runs.post #36 explains how to get rid of things. Have you tried that? (Another way could be to make Rsyslogd (or Syslog-NG) filter before log entries get committed to file.)


Quote:
Originally Posted by Rtwo View Post
would I miss any login attempt(legit and not hacking both) ?
This login is a consequence of what cron does so its logged under its own facility, it's not a regular user login process?..


*BTW please don't necropost (revive ancient threads).

Last edited by unSpawn; 05-05-2016 at 04:32 AM. Reason: //Added mod nudge
 
Old 05-05-2016, 07:27 AM   #4
Rtwo
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Turbocapitalist,

My version is Debian Wheezy 7 n l . 7.10
You can always reduce the noise by filtering with "grep" or "awk" first. Please elaborate, what is noise, what does reducing it mean? I dont know much about Linux.

unSpawn,

I dont want to have no entries in auth.log, rather I want entries to be made in every 30 minutes instead of 5-10 minutes. Condition must be that no login attempt is missed to be added there. I guess the solutions in redhat and debain bugs are only to stop having any entry into that auth.log file. From the security point of view it is not recommended.

This is why its never recommended to Disable/Quiet the entries
----------------------------------------------------------------
http://forum.configserver.com/viewtopic.php?t=6087

Correct me If I am wrong.
Thank you all for your posts. They help a lot.

Last edited by Rtwo; 05-05-2016 at 07:30 AM.
 
Old 05-05-2016, 07:45 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
If you're looking through a log file on a system running Wheezy, then you can select what you see based on a pattern rather than having to wade through everything that is there. Since you do not want to look at cron entries, you could use one of the examples I showed above to hide the cron entries. Look at the manual page for grep as well as a tutorial or two to get the idea of what it can do, but in a few words prints (or hides) lines from a file that match a pattern that you specify.

So if you view the log file with "less", you will see everything including the CRON entries:

Code:
less /var/log/syslog
But if you want to hide the CRON entries so you can focus on what else is going on, then you can use grep. The -v option with grep hides lines that match the pattern. In this case the pattern would be the string "CRON" anywhere on the line:

Code:
grep -v CRON /var/log/syslog | less
If you want to get fancier, there is awk, which is a simple pattern scanning and processing scripting language. Getting familiar with grep is something I would say is essential for administration. And getting at least some familiarity with awk will pay off, too. For more complex activities, there is perl, a much more advanced pattern scanning and processing scripting language.

But for now, I'd recommend trying grep a little to work with the log files.
 
Old 05-05-2016, 08:47 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Rtwo View Post
This post is somewhat similar to another post here but mine is rather specific. CRON: pam_unix(cron:session): session opened for user root by (uid=0)

Is this really a bug? in our system this process is creating entries in every 5 minutes making the log backup guys' life v hard. lots lots of entries are being stored on the disk.

as per the following links, do we need to fix this issue or can we at least increase the time of listing between the entries?

https://bugs.debian.org/cgi-bin/bugr...cgi?bug=293272
http://languor.us/cron-pam-unix-cron...user-root-uid0

Can I at least reduce the time between entries? for my server currently its 1 pair of entry in every 5 minutes. Say, I've increased the time to 30 minutes , would I miss any login attempt(legit and not hacking
both) ?
If it were me, I'd be looking for the cron that runs every 5 minutes.
Then start making sweeping declarations about 'bugs'.
 
Old 05-05-2016, 10:04 AM   #7
Rtwo
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Buds

I am not worried about what I can/dont want to see. I want my backup guys to give some respite. The Linux box we have is listing a lotttt of entries in that auth.log file. After reaching 6KB-30KB of size, it compresses the entries and create a file named as : auth.log.1.gz, auth.log.2.gz, auth.log..3.gz and so on. As we have more logins, we have more of these files in $ /var/log/ directory. Backing up these files are troublesome for the backup guys. So I want these files to be created taking more time. Say if one of these .gz file is now being created in every 1 day, I want them to created in every 2-3 days.

I hope that clarified my problem.
 
Old 05-05-2016, 10:47 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Quote:
Originally Posted by Rtwo View Post
As we have more logins, we have more of these files in $ /var/log/ directory. Backing up these files are troublesome for the backup guys. So I want these files to be created taking more time. Say if one of these .gz file is now being created in every 1 day, I want them to created in every 2-3 days.
That can be tuned in logrotate. See the manual page for logrotate.conf for all the specifics, but the settings you are looking to change can be found in /etc/logrotate.d/rsyslog in the stanza for /var/log/auth Probably, if you have the defaults, that is lumped in with /var/log/messages and you will need to split it out into its own stanza. There the frequency of the rotations or the triggering size of the file can be set.
 
1 members found this post helpful.
Old 05-05-2016, 03:22 PM   #9
Rtwo
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
That can be tuned in logrotate. See the manual page for logrotate.conf for all the specifics, but the settings you are looking to change can be found in /etc/logrotate.d/rsyslog in the stanza for /var/log/auth Probably, if you have the defaults, that is lumped in with /var/log/messages and you will need to split it out into its own stanza. There the frequency of the rotations or the triggering size of the file can be set.
Seems like logrotate is already working in my box, if it hadnt then I'd not see the .gz files of that auth.log file.

Now the question is, If I go on with this solution, would the the entries still be made and upon reaching a certain file size of auth.log, the file would create a tar.gz file?
 
Old 05-14-2016, 02:55 AM   #10
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,781

Rep: Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199
You change the syslog file in /etc/logrotate.d/ with a text editor.
You can decrease the number of the .gz files by putting a lower number for "rotate". You can effectively decrease the frequency of the .gz file creation by changing to (or adding) an increased "minsize".
Example:
Code:
rotate 5
minsize 1M
See the man page for all details
Code:
man logrotate
Attention: all files in /etc/logrotate.d/ are valid for logrotate. Some text editors leave a backup file of the original - delete it.
 
1 members found this post helpful.
  


Reply

Tags
cron, debian, linux



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
auth.log entries abnormal date sequence r.stiltskin Linux - Server 7 12-22-2014 05:45 PM
Question about questionable auth.log entries. tac-shell Linux - Security 6 01-23-2013 08:20 PM
Help understanding auth.log entries someone trying root access? jimdaworm Linux - Security 4 12-16-2008 03:27 AM
removing cron entries from auth.log divukman Linux - Software 2 05-27-2006 05:53 AM
/var/log/auth.log entries buehler Linux - Security 1 04-23-2005 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:11 PM.

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