opoplawski | 18 Jan 17:30
Picon

SF.net SVN: logwatch:[81] scripts/services/kernel

Revision: 81
          http://logwatch.svn.sourceforge.net/logwatch/?rev=81&view=rev
Author:   opoplawski
Date:     2012-01-18 16:30:58 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
Limit EDAC messages to MC/PCI

Modified Paths:
--------------
    scripts/services/kernel

Modified: scripts/services/kernel
===================================================================
--- scripts/services/kernel	2012-01-18 16:12:50 UTC (rev 80)
+++ scripts/services/kernel	2012-01-18 16:30:58 UTC (rev 81)
@@ -99,7 +99,9 @@
       $FPAssists{$1}++;
    } elsif ($ThisLine =~ /Out of memory: Killed process \d+ \((.*)\)/) {
       $OOM{$1}++;
-   } elsif ($ThisLine =~ /(EDAC .*)/) {
+   } elsif ($ThisLine =~ /(EDAC (MC|PCI)\d:.*)/) {
+      # Standard boot messages
+      next if $ThisLine =~ /Giving out device to /;
       $EDACs{$1}++;
    } elsif ( ( my $errormsg ) = ( $ThisLine =~ /(.*?[Ee]rror.{0,17})/ ) ) {
       # filter out smb open/read errors cased by insufficient permissions

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.
(Continue reading)

opoplawski | 18 Jan 17:12
Picon

SF.net SVN: logwatch:[80] scripts/services/kernel

Revision: 80
          http://logwatch.svn.sourceforge.net/logwatch/?rev=80&view=rev
Author:   opoplawski
Date:     2012-01-18 16:12:50 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
Handle kernel EDAC messages

Modified Paths:
--------------
    scripts/services/kernel

Modified: scripts/services/kernel
===================================================================
--- scripts/services/kernel	2011-12-21 17:28:39 UTC (rev 79)
+++ scripts/services/kernel	2012-01-18 16:12:50 UTC (rev 80)
@@ -65,6 +65,7 @@
 my %OOM = ();
 my %Errors = ();
 my %Kernel = ();
+my %EDACs = ();

 while (defined(my $ThisLine = <STDIN>)) {
    chomp($ThisLine);
@@ -97,7 +98,9 @@
    } elsif ($ThisLine =~ /([^(]*)\(\d+\): floating-point assist fault at ip/) {
       $FPAssists{$1}++;
    } elsif ($ThisLine =~ /Out of memory: Killed process \d+ \((.*)\)/) {
-      $OOM{$1}++
+      $OOM{$1}++;
(Continue reading)

Willi Mann | 15 Jan 11:02
Picon
Favicon

9 Debian patches for inclusion

Hi!

Could anyone please take a look at the patches I'm including in the Debian 
package and include them in the SVN repository, please? I'd like to avoid  
diverting too much from the official sources.

The patches I'm currently including are listed at 

http://patch-tracker.debian.org/package/logwatch/7.4.0+svn20111221rev79-1

(The first one should not be included. To avoid the patch, we could control 
this by a configuration option.)

thanks
WM

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
Jan Synacek | 5 Jan 14:19
Picon
Favicon

New option - DailyReport - enables/disables sending of daily reports by cron

Hello list,

I added an option that allows users to specify, if they want logwatch to send daily reports when the script is
run by cron.
Patches attached.

Regards,
Jan Synacek

--- scripts/logwatch.pl	2012-01-05 13:48:43.412548383 +0100
+++ scripts/logwatch.pl.new	2012-01-05 13:58:16.687311709 +0100
@@ -93,6 +93,7 @@ $Config{'encode'} = "none"; #8.0
 $Config{'hostformat'} = "none"; #8.0
 $Config{'html_wrap'} = 80;
 $Config{'supress_ignores'} = 0;
+$Config{'dailyreport'} = 1;

 if (-e "$ConfigDir/conf/html/header.html") {
    $Config{'html_header'} = "$ConfigDir/conf/html/header.html";
@@ -181,6 +182,15 @@ if ($Config{'debug'} > 8) {
    &PrintConfig();
 }

+# Check DailyReport option and react accordingly, if the script is run by cron
+
+if (($ENV{'LOGWATCH_CRON'}) && !($Config{'dailyreport'})) {
+    if ($Config{'debug'} > 5) {
+        print "Logwatch was run by cron, but DailyReport set to No. Exiting.\n";
(Continue reading)

Jonas Marczona | 3 Jan 15:10
Picon

freeradius

Hi,

i am completely new to perl and its the first time i work with logwatch.

We run freeradius on a Ubuntu server (10.04) and we were interested to get some informations from it into our daily logwatch.
I wrote an elementary filter - see attachment.

My focus is to get to know when "something" unregular has happen. E.g. someone tries to guess a username/password.
(In the past we had some problems with brute-force attacks)

The filter summarize how often an ip failed to login with a wrong password or a wrong username.
For "Detail >= 5" the filter adds a list about the number of failed attempts per ip.
For "Detail >= 10" also the number of successful logins per username are summarized.
Everything else will be printed directly to the logwatch.

Because the shared script RemoveHeaders does not match the output from freeradius i wrote also a short shared script named "RemoveHeadersDate" to remove the starting date from each line. (maybe the name is not perfect, also just using "remove" with a proper regex would work, too)

Please notice: Our freeradius is configured to log directly into /var/log/freeradius/radius.log - without the usage of syslog.
From /etc/freeradius/radiusd.conf the log block:
log {
  destination = files
  file = ${logdir}/radius.log
  stripped_names = no
  auth = yes
  auth_badpass = no
  auth_goodpass = no
}

Greetings,
Jonas Marczona

Example Output (ips and usernames anonymized):

Successful logins:
    username1 :  11 time(s)
    username2 :   4 time(s)
    username3 :   1 time(s)
 
 Sum of failed logins per ip (wrong password or user)
     178.200.xx.xx :   2 time(s)
 
 Failed logins - wrong user name:
     178.200.xx.xx
        username_invalid :   1 time(s)
 
 Failed logins - wrong password:
     178.200.xx.xx
             username1 :   1 time(s)



Attachment (freeradius_logwatch.tar.gz): application/x-gzip, 2536 bytes
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Logwatch-devel mailing list
Logwatch-devel@...
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
Jonas Marczona | 31 Dec 14:41
Picon

stunnel filter

Hello,

we use stunnel 4.15 on CentOs 5.7.
Yes its old, but this is what we get from the CentOs repos. This traffic is behind a firewall - so medium security acceptable for us.

Format mismatch
Sadly the output from stunnel is not matched from the logwatch filter.

Example output (hostname and ips anonymized):

Dec 29 12:35:09 hostname stunnel: LOG3[2411:3086588816]: SSL_read: Connection reset by peer (104)
Dec 30 20:22:37 hostname stunnel: LOG5[2411:3084352400]: Connection closed: 829 bytes sent to SSL, 403 bytes sent to socket
Dec 31 08:31:52 hostname stunnel: LOG5[2411:3084143504]: Connection reset: 7571653 bytes sent to SSL, 80209 bytes sent to socket
Dec 31 11:43:27 hostname stunnel: LOG5[2411:3084143504]: uals connected from xx.xx.xx.111:49254
Dec 31 11:44:00 hostname stunnel: LOG5[2411:3084352400]: uals connected from xx.xx.xx.111:49261
Dec 31 11:45:08 hostname stunnel: LOG5[2411:3084352400]: Connection closed: 829 bytes sent to SSL, 403 bytes sent to socket
Dec 31 11:56:59 hostname stunnel: LOG5[2411:3084143504]: Connection closed: 7199827 bytes sent to SSL, 136049 bytes sent to socket

The part "LOG5[2411:3084143504]:" is not expected by the current filter.
I have extended some if-conditions with an "or"-block to match this format.
The matching of "connected from" is reduced to services without spaces in their name. I do not know if stunnel support this at all.

Reduced output for "allowed services"
In addition to this we are not interested to see each ip of each service.
So i did extend the filter script to be sensitive to an environment variable "stunnelallowedservices"  - all services listed there (comma separated) will be summarized to "how often was this service used". independent of the ip. Obviously stunnelallowedservices could be set within "stunnel.conf"

Hopefully i does not changed anything if the other input-format is produced and stunnelallowedservices is not set.

Please find attached the diff and my complete version of the stunnel filter.

Regards,
Jonas Marczona
0a1,2
> #!/usr/bin/perl
> 
4c6,7
< 
---
> #        modified by Jonas Marczona
> #                    2011/12/28
20a24
> 
25a30
> my $allowedServicesInput = $ENV{'stunnelallowedservices'} || "";
36a42
> my %connectionsAllowed = ();
40a47,58
> $allowedServicesInput =~ s/[\t ]*,[\t ]*/,/g;
> my %allowedServices = ();
> @allowedServices{split(/,/, $allowedServicesInput)} = ();
> 
> if ($Debug >= 5) {
>   print "Allowed services are set to: \n";
>   foreach my $allowedService (sort keys %allowedServices) {
>      print $allowedService, "\n";
>   }
>   print "\n\n\n";
> }
> 
50a69,77
> sub addAllowedConnection {
>    my $service = shift;
>    if (! exists($connectionsAllowed{$service})) {
>       $connectionsAllowed{$service} = 0;
>    }
>    ++$connectionsAllowed{$service};
> }
> 
> 
59c86,90
<    if ($ThisLine =~ m/^(.+) connected from (\d+\.\d+\.\d+\.\d+)/) {
---
>    # Service name should not contain spaces => use ([^ ]+) instead of (.+)
>    if (
>       ($ThisLine =~ m/^([^ ]+) connected from (\d+\.\d+\.\d+\.\d+)/) or 
>       ($ThisLine =~ m/^\w{0,5}\d{1}\[\d+:\d+\]: ([^ ]+) connected from (\d+\.\d+\.\d+\.\d+)/)
>    ) {
62,63c93,99
<       if (! exists($connections{$service}{$ip})) {
<         $connections{$service}{$ip} = 0;
---
>       if (exists($allowedServices{$service})) {
>         addAllowedConnection($service);
>       } else {
>          if (! exists($connections{$service}{$ip})) {
>             $connections{$service}{$ip} = 0;
>          }
>          ++$connections{$service}{$ip};
65,66c101,104
<       ++$connections{$service}{$ip};
<    } elsif ($ThisLine =~ m/^Connection (reset|closed): (\d+) bytes sent to SSL, (\d+) bytes sent to
socket/) {
---
>    } elsif (
>       ($ThisLine =~ m/^Connection (reset|closed): (\d+) bytes sent to SSL, (\d+) bytes sent to socket/) or 
>       ($ThisLine =~ m/^\w{0,5}\d{1}\[\d+:\d+\]: Connection (reset|closed): (\d+) bytes sent to SSL, (\d+)
bytes sent to socket/)
>    ) {
69c107,110
<    } elsif ($ThisLine =~ m/^Connection (reset|closed)/) {
---
>    } elsif (
>       ($ThisLine =~ m/^Connection (reset|closed)/) or 
>       ($ThisLine =~ m/^\w{0,5}\d{1}\[\d+:\d+\]: SSL_read: Connection (reset|closed)/)
>    ) {
80c121
<    print "\nconnections:\n";
---
>    print "\nNumber of connections per service per ip:\n";
82c123
<      print "  $service\n";
---
>      printf " %7s \n", $service; # , $connections{$service}, "\n";
85c126
<         print "    $ip ", $ips->{$ip}, "\n";
---
>         printf "    %15s : %3d time(s)\n", $ip, $ips->{$ip};
89a131,140
> 
> if (keys %connectionsAllowed) {
>    print "\nNumber of connections per allowed service:\n";
>    foreach my $service (sort keys %connectionsAllowed) {
>      printf " %8s : %5d time(s)\n",  $service, $connectionsAllowed{$service};
>    }
> }
> 
> 
> 
121d171
< 
Attachment (stunnel): application/octet-stream, 4917 bytes
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Logwatch-devel mailing list
Logwatch-devel@...
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
Willi Mann | 28 Dec 20:40
Picon
Favicon

logwatch.conf: hostlimit=yes

Hi!

The comments in logwatch.conf indicate [1] that "HostLimit = Yes" would 
cause the output to be limited to the host logwatch is running on 
(hostname()). Unfortunately, this is not correct. Rather, HostLimit = Yes 
says that the output should be limited to the host with the name Yes. 

Could anyone please fix the comment in the config file please?

WM

[1] 
http://logwatch.svn.sourceforge.net/viewvc/logwatch/conf/logwatch.conf?revision=24&view=markup

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
opoplawski | 21 Dec 18:28
Picon

SF.net SVN: logwatch:[79]

Revision: 79
          http://logwatch.svn.sourceforge.net/logwatch/?rev=79&view=rev
Author:   opoplawski
Date:     2011-12-21 17:28:39 +0000 (Wed, 21 Dec 2011)
Log Message:
-----------
Spamassassin:
- Ignore messages about ajusting number of children
- Consolidate connection from messages and allow certain hosts to be ignored

Modified Paths:
--------------
    conf/services/spamassassin.conf
    scripts/services/spamassassin

Modified: conf/services/spamassassin.conf
===================================================================
--- conf/services/spamassassin.conf	2011-12-20 22:19:52 UTC (rev 78)
+++ conf/services/spamassassin.conf	2011-12-21 17:28:39 UTC (rev 79)
@@ -8,4 +8,9 @@
 *OnlyService = spamd
 *RemoveHeaders

+# Ignore connections from these hosts.
+# The value is a regular expression that the hostname plus IP address is matched
+# against.  Separate multiple hosts/IPs with |
+# $ignore_connections = myspamclient.mydomain
+
 # vi: shiftwidth=3 tabstop=3 et

Modified: scripts/services/spamassassin
===================================================================
--- scripts/services/spamassassin	2011-12-20 22:19:52 UTC (rev 78)
+++ scripts/services/spamassassin	2011-12-21 17:28:39 UTC (rev 79)
@@ -41,6 +41,7 @@

 my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
 my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
+my $Ignore_connections = $ENV{'ignore_connections'};

 $StillRoot = 0;
 $CleanTotal = 0;
@@ -50,6 +51,7 @@
 my %Clean;
 my %Spam;
 my %Users;
+my %Connections;

 #Todo
 #    meta test DIGEST_MULTIPLE has undefined dependency 'DCC_CHECK' : 2 Time(s)
@@ -74,6 +76,7 @@
       ( $ThisLine =~ m/^server successfully spawned child process, / ) or
       ( $ThisLine =~ m/^removing stderr method/ ) or
       ( $ThisLine =~ m/^server pid:/ ) or
+      ( $ThisLine =~ m/^adjust: \d+ idle children (less|more) than \d+ (min|max)imum idle children/ ) or
       0  # Always last in the list, so all above can say "or" at the end
    ) {
       ; # We don't care about these
@@ -85,6 +88,8 @@
       $Users{ $User}++;
    } elsif ( $ThisLine =~ m/still running as root: / ) {
       $StillRoot++;
+   } elsif ( $ThisLine =~ m/^connection from (.*) at port / ) {
+      $Connections{$1}++;
    } elsif ( $ThisLine =~ m/\bchild\b/ ) {
       chomp($ThisLine);
       # Many perl errors report pseudo-line-numbers, e.g.
@@ -140,6 +145,18 @@
    }
 }

+if (keys %Connections) {
+   my $header_printed = 0;
+   foreach my $connection ( sort {$a cmp $b} keys %Connections ) {
+      if ($Ignore_connections && $connection =~ /$Ignore_connections/) { next; }
+      if (!$header_printed) {
+         print "\nConnections from:\n";
+         $header_printed = 1;
+      }
+      print "   $connection : $Connections{$connection} Time(s)\n";
+   }
+}
+
 if (keys %OtherList) {
    print "\n**Unmatched Entries**\n";
    foreach $line (sort {$OtherList{$b}<=>$OtherList{$a} } keys %OtherList) {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
Jan Synacek | 21 Dec 12:04
Picon
Favicon

Manpage and scripts/services/secure patches

Hello again, list,

I took the liberty to update logwatch man page and also fix a minor grammar issue in scripts/services/secure.
Patches attached.

Best regards,
Jan Synacek
Index: logwatch.8
===================================================================
--- logwatch.8	(revision 78)
+++ logwatch.8	(working copy)
@@ -66,7 +66,6 @@
 .IP "\fB--mailto\fR address"
 Mail the results to the email address or user specified in
 .I address.
-This option overrides the \-\-print option.
 .IP "\fB--range\fR range"
 You can specify a date-range to process. Common ranges are  
 .I Yesterday, Today, All,
@@ -102,10 +101,28 @@
 if HostLimit is set in the logwatch.conf configuration file (see
 \fBMORE INFORMATION\fR, below),
 then only logs from this hostname will be processed (where appropriate).
+.IP "\fB--hostformat\fR report-options"
+Can be one of none (default), split, splitmail.
+If
+.I report-options
+is set to split, status report entries are generated separately by hostname.
+Setting it to splitmail has the same effect as split with added --output=mail.
+.IP "\fB--output\fR output-type"
+Specifies output type.
+.I output-type
+can be stdout (default), mail or file.
+.IP "\fB--format\fR formatting"
+Specifies output format.
+.I formatting
+can be either text (default) or html.
+.IP "\fB--encode\fR encoding"
+Encodes the output.
+.I encoding
+can be none (default) or base64.
 .IP "\fB--numeric\fR"
 Inhibits additional name lookups, displaying IP addresses numerically.
 .IP "\fB--usage\fR"
-Displays usage information
+Displays usage information.
 .IP "\fB--help\fR"
 same as \-\-usage.
 .SH FILES
@@ -121,15 +138,20 @@
 information.
 .RE
 .SH EXAMPLES
-.B logwatch --service ftpd-xferlog --range all --detail high --print --archives
+.B logwatch --service ftpd-xferlog --range all --detail high --archives
 .RS
 This will print out all FTP transfers that are stored in all current and archived
 xferlogs.
 .RE
-.B logwatch --service pam_pwdb --range yesterday --detail high --print
+.B logwatch --service pam_pwdb --range yesterday --detail high
 .RS
 This will print out login information for the previous day...
 .RE
+.B logwatch --format html --encode base64 --output file --filename encoded.html
+.RS
+This will print all service information into a base64-encoded file named
+encoded.html
+.RE
 .SH MORE INFORMATION
 The directory /usr/share/doc/logwatch-* contains several files with additional
 documentation:
Index: scripts/services/secure
===================================================================
--- scripts/services/secure	(revision 78)
+++ scripts/services/secure	(working copy)
@@ -675,7 +675,7 @@
 }

 if ($RootLoginTTY) {
-   print "\nRoot logins on tty\'s: $RootLoginTTY Time(s).\n";
+   print "\nRoot logins on ttys: $RootLoginTTY Time(s).\n";
 }

 if (keys %UserLogin) {
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Logwatch-devel mailing list
Logwatch-devel@...
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
opoplawski | 20 Dec 23:19
Picon

SF.net SVN: logwatch:[78] scripts/services/sendmail

Revision: 78
          http://logwatch.svn.sourceforge.net/logwatch/?rev=78&view=rev
Author:   opoplawski
Date:     2011-12-20 22:19:52 +0000 (Tue, 20 Dec 2011)
Log Message:
-----------
Fix typo pointed out by Jan Synacek <jsynacek@...>

Modified Paths:
--------------
    scripts/services/sendmail

Modified: scripts/services/sendmail
===================================================================
--- scripts/services/sendmail	2011-12-20 18:16:59 UTC (rev 77)
+++ scripts/services/sendmail	2011-12-20 22:19:52 UTC (rev 78)
@@ -1760,7 +1760,7 @@
       print "\n        Total per host: $TotalAbuse" if ($Detail >= 5);
       $TotalError[$ErrorIndex] += $TotalAbuse;
    }
-   print "\n\tTota: l $TotalError[$ErrorIndex]" if ($Detail >= 3);
+   print "\n\tTotal: $TotalError[$ErrorIndex]" if ($Detail >= 3);
 }
 $TotalError[++$ErrorIndex] = 0;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
opoplawski | 20 Dec 19:16
Picon

SF.net SVN: logwatch:[77] conf/services/kernel.conf

Revision: 77
          http://logwatch.svn.sourceforge.net/logwatch/?rev=77&view=rev
Author:   opoplawski
Date:     2011-12-20 18:16:59 +0000 (Tue, 20 Dec 2011)
Log Message:
-----------
Add option for ignoring RPCSEC expired credentials messages

Modified Paths:
--------------
    conf/services/kernel.conf

Modified: conf/services/kernel.conf
===================================================================
--- conf/services/kernel.conf	2011-12-20 18:15:21 UTC (rev 76)
+++ conf/services/kernel.conf	2011-12-20 18:16:59 UTC (rev 77)
@@ -26,6 +26,10 @@
 # against.  Separate multiple executables with |
 # $ignore_faults = npviewer.bin

+# Ignore Error: state manager encountered RPCSEC_GSS session expired against NFSv4 server
+# messages which often occur when kerberos tickets expire
+# $ignore_rpcsec_expired = Yes
+
 ########################################################
 # This was written and is maintained by:
 #    Kirk Bauer <kirk@...>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

Gmane