Blame SOURCES/logwatch-rkhunter.patch

bcfbf2
RootkitHunter support.
bcfbf2
bcfbf2
Author: Jan Synacek <jsynacek@redhat.com>
bcfbf2
RH-Bugzilla: #818926
bcfbf2
bcfbf2
Index: scripts/services/secure
bcfbf2
===================================================================
bcfbf2
--- scripts/services/secure	(revision 110)
bcfbf2
+++ scripts/services/secure	(working copy)
bcfbf2
@@ -180,6 +180,7 @@
bcfbf2
 $PwdChange = 0;
bcfbf2
 $RequestKeyFailures = 0;
bcfbf2
 %OtherList = ();
bcfbf2
+%RootkitHunter = ();
bcfbf2
 use Logwatch ':ip';
bcfbf2
 
bcfbf2
 while (defined($ThisLine = <STDIN>)) {
bcfbf2
@@ -519,6 +520,14 @@
bcfbf2
         $e='';
bcfbf2
      }
bcfbf2
      $KerbList{$response}{$type}{$from}{$service}{$client}{$e}++;
bcfbf2
+   } elsif ($ThisLine =~ /Rootkit Hunter:/ ) {
bcfbf2
+      if ($ThisLine =~ /Please inspect this machine/) {
bcfbf2
+         $RootkitHunter{'inspect'}++;
bcfbf2
+      } elsif ($ThisLine =~ /check started/) {
bcfbf2
+         $RootkitHunter{'runs'}++;
bcfbf2
+      } elsif (my ($mins, $secs) = ($ThisLine =~ /Scanning took ([0-9]*) minutes? and ([0-9]*) seconds?/)) {
bcfbf2
+         $RootkitHunter{'time'}+= $mins*60 + $secs;
bcfbf2
+      }
bcfbf2
    } else {
bcfbf2
       # Unmatched entries...
bcfbf2
       $ThisLine =~ s/\[\d+\]:/:/;
bcfbf2
@@ -908,6 +917,15 @@
bcfbf2
    }
bcfbf2
 }
bcfbf2
 
bcfbf2
+if (keys %RootkitHunter) {
bcfbf2
+   use integer;
bcfbf2
+   my ($mins, $secs) = ($RootkitHunter{'time'} / 60, $RootkitHunter{'time'} % 60);
bcfbf2
+   print "\nRootkitHunter:\n";
bcfbf2
+   print "   Runs: $RootkitHunter{'runs'}\n";
bcfbf2
+   print "   Suggested Inspection: $RootkitHunter{'inspect'} Time(s)\n";
bcfbf2
+   print "   Total Runtime: $mins minute(s) $secs second(s)\n";
bcfbf2
+}
bcfbf2
+
bcfbf2
 if (keys %OtherList) {
bcfbf2
    print "\n**Unmatched Entries**\n";
bcfbf2
    foreach $line (sort {$a cmp $b} keys %OtherList) {