Bug 1089691 - rkhunter cron job uses bad LOGFILE parameter -- problem has returned
Summary: rkhunter cron job uses bad LOGFILE parameter -- problem has returned
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rkhunter
Version: 20
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-21 16:15 UTC by Michael Carney
Modified: 2015-06-30 01:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 450703
Environment:
Last Closed: 2015-06-30 01:00:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael Carney 2014-04-21 16:15:43 UTC
+++ This bug was initially created as a clone of Bug #450703 +++

Description of problem:
LOGFILE is set to /var/log/rkhunter.log in /etc/cron.daily/rkhunter while it is
set to /var/log/rkhunter/rkhunter.log in /etc/rkhunter.conf and in the logrotate
configuration

Version-Release number of selected component (if applicable):
rkhunter-1.3.2-3.fc8

How reproducible:
always

Steps to Reproduce:
1. install rkhunter-1.3.2-3.fc8
2. wait until nightly rkhunter run
3.
  
Actual results:
Get email saying:

/etc/cron.daily/logrotate:

error: stat of /var/log/rkhunter/rkhunter.log failed: No such file or directory

Expected results:
No email should be sent saying logrotate can't find the log file

Additional info:

--- Additional comment from Kevin Fenzi on 2008-06-10 12:57:37 EDT ---

Yes, this is a bug on my part... the cron file didn't get updated for f7/f8
properly. ;( 

I will get it fixed soon. 

Thanks for the bug report. 

--- Additional comment from Fedora Update System on 2008-06-17 15:03:35 EDT ---

rkhunter-1.3.2-4.fc9 has been submitted as an update for Fedora 9

--- Additional comment from Fedora Update System on 2008-06-17 15:15:15 EDT ---

rkhunter-1.3.2-4.fc8 has been submitted as an update for Fedora 8

--- Additional comment from Kevin Fenzi on 2008-06-17 15:27:49 EDT ---

This should be fixed in the above updates... can you test them and confirm they
solve the issue you are seeing?


--- Additional comment from Fedora Update System on 2008-06-20 15:05:44 EDT ---

rkhunter-1.3.2-4.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rkhunter'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-5455

--- Additional comment from  on 2008-06-24 14:09:03 EDT ---

The update appears to be working just fine. Thanks


--- Additional comment from Fedora Update System on 2008-06-26 04:32:44 EDT ---

rkhunter-1.3.2-4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from Fedora Update System on 2008-06-26 04:33:29 EDT ---

rkhunter-1.3.2-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from Kevin Fenzi on 2008-06-26 11:30:50 EDT ---

Closing this one now. Feel free to re-open or file a new bug if you spot any
further issues. 

Thanks for filing the bug!


--- Additional comment from Fedora Update System on 2008-07-26 02:00:13 EDT ---

rkhunter-1.3.2-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.



Looks like this bug is back in: rkhunter-1.4.2-2.fc20.noarch. /etc/cron.daily/rkhunter hardwires LOGFILE to /var/log/rkhunter/rkhunter.log, ignoring the setting in /etc/rkhunter.conf. I also noticed that /etc/sysconfig/rkhunter and /etc/rkhunter.conf both have settings for MAILTO, which will conflict if one is changed without changing the other.

Comment 1 Kevin Fenzi 2014-04-21 17:37:30 UTC
What do you have set in /etc/rkhunter.conf ? 

Do you have any /etc/rkhunter.conf.rpm* files

Comment 2 Michael Carney 2014-04-21 20:17:47 UTC
UID0_ACCOUNTS and MAIL-ON-WARNING (I guess MAILTO is only a sysconfig/rkhunter variable).

No, No *.rpmnew files.

Comment 3 Kevin Fenzi 2014-04-21 20:38:19 UTC
I'm a bit confused as to the actual error you are seeing here?
Can you attach output from a 'rkhunter -c -sk' ? 

Does the LOGFILE setting differ between the two files?

Comment 4 Michael Carney 2014-04-21 21:05:23 UTC
Just look at the code in /etc/cron.daily/rkhunter. It hardwires the LOGFILE setting as /var/log/rkhunter/rkhunter.log. Thus if you change LOGFILE in /etc/rkhunter.conf, you have to hack /etc/cron.daily/rkhunter in order to achieve the result you want.

Note also that there is a MAIL-ON-WARNING setting in /etc/rkhunter.conf and a MAILTO setting in /etc/sysconfig/rkhunter. Seems like there should be only one config file: /etc/rkhunter.conf, since that is the one mentioned in the rkhunter man page. /etc/sysconfig/rkhunter should be obsoleted, and it's configuration merged with /etc/rkhunter.conf.

Comment 5 Kevin Fenzi 2014-04-21 23:17:43 UTC
(In reply to Michael Carney from comment #4)
> Just look at the code in /etc/cron.daily/rkhunter. It hardwires the LOGFILE
> setting as /var/log/rkhunter/rkhunter.log. Thus if you change LOGFILE in
> /etc/rkhunter.conf, you have to hack /etc/cron.daily/rkhunter in order to
> achieve the result you want.

You shouldn't do this.

selinux policy is setup to know that as the correct location for logs. 
If you are changing it, you would not only have to do so in both places, but 
setup policy for the new location. 

I suppose we could grep out the LOGFILE directive... 
 
> Note also that there is a MAIL-ON-WARNING setting in /etc/rkhunter.conf and
> a MAILTO setting in /etc/sysconfig/rkhunter. Seems like there should be only
> one config file: /etc/rkhunter.conf, since that is the one mentioned in the
> rkhunter man page. /etc/sysconfig/rkhunter should be obsoleted, and it's
> configuration merged with /etc/rkhunter.conf.

those are different things. MAIL-ON-WARNING is useless and should get dropped. MAILTO is used by the cron script, not rkhunter itself...

Comment 6 Michael Carney 2014-04-22 17:05:25 UTC
Hi Kevin,
I didn't move the log from /var/log, I just renamed the file. The only rkhunter-specific selinux context is /var/lib/rkhunter(/.*)?  There is no /var/log/rkhunter context.

Actually, I find MAIL-ON-WARNING useful, because I redirect the warning mail to me, not root. What would replace it?

Comment 7 Kevin Fenzi 2014-04-25 14:55:02 UTC
(In reply to Michael Carney from comment #6)
> Hi Kevin,
> I didn't move the log from /var/log, I just renamed the file. The only
> rkhunter-specific selinux context is /var/lib/rkhunter(/.*)?  There is no
> /var/log/rkhunter context.

ok. 

> Actually, I find MAIL-ON-WARNING useful, because I redirect the warning mail
> to me, not root. What would replace it?

MAILTO in /etc/sysconfig/rkhunter ?

So, I'm open to ideas to improve here, but not sure there is any... 

the cron job uses config from /etc/sysconfig/rkhunter, and I don't think it would be too great to try and parse from /etc/rkhunter.conf...

Comment 8 Fedora End Of Life 2015-05-29 11:38:07 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2015-06-30 01:00:03 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.