[pLog-svn] r3263 - in plugins/trunk/0ipabuse: . class/security

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Wed Apr 19 08:09:20 GMT 2006


Author: pwestbro
Date: 2006-04-19 08:09:19 +0000 (Wed, 19 Apr 2006)
New Revision: 3263

Added:
   plugins/trunk/0ipabuse/readme.txt
Modified:
   plugins/trunk/0ipabuse/class/security/ipabusefilter.class.php
   plugins/trunk/0ipabuse/class/security/update_iptables.php
Log:
Added a readme file

Fixed the update_iptables script to work correctly when the db file is not
present.


Modified: plugins/trunk/0ipabuse/class/security/ipabusefilter.class.php
===================================================================
--- plugins/trunk/0ipabuse/class/security/ipabusefilter.class.php	2006-04-19 07:01:35 UTC (rev 3262)
+++ plugins/trunk/0ipabuse/class/security/ipabusefilter.class.php	2006-04-19 08:09:19 UTC (rev 3263)
@@ -94,8 +94,7 @@
                 }
                 $newValueInt = $numAccesses + 1;
                
-//                error_log( $clientIp . " " . $newValueInt );
-                dba_replace($clientIp, "$newValueInt", $db);
+                 dba_replace($clientIp, "$newValueInt", $db);
             }
             else {
                 // Add an entry for this ip address

Modified: plugins/trunk/0ipabuse/class/security/update_iptables.php
===================================================================
--- plugins/trunk/0ipabuse/class/security/update_iptables.php	2006-04-19 07:01:35 UTC (rev 3262)
+++ plugins/trunk/0ipabuse/class/security/update_iptables.php	2006-04-19 08:09:19 UTC (rev 3263)
@@ -6,6 +6,11 @@
 $today = date("Ymd");
 $dbFile =$LIFETYPE_TMP_FOLDER ."/".$today."ipabuse.db";
 
+if ( !file_exists($dbFile) )
+{
+    exit;
+}
+
 $id = dba_open($dbFile, "wl", "db4");
 
 if (!$id) {

Added: plugins/trunk/0ipabuse/readme.txt
===================================================================
--- plugins/trunk/0ipabuse/readme.txt	2006-04-19 07:01:35 UTC (rev 3262)
+++ plugins/trunk/0ipabuse/readme.txt	2006-04-19 08:09:19 UTC (rev 3263)
@@ -0,0 +1,41 @@
+Plugin: IP Abuse
+Author: Paul Westbrook
+Release Date: 2006/04/19
+Version: 0.1
+
+Check to see if a machine has attempted to make more than 10 comments 
+in a single day, and if so, all following comments are rejected for 
+the rest of the day.
+
+This plugin uses db4 to minimize the contention on the mysql database.
+
+Requirements:
+1) A php installation that has db4 support built in.
+
+To determine if this support has been built in
+a) install the following php script into your document root
+<?php
+phpinfo();
+?>
+b) when accessed, you should see something like:
+                    dba
+    DBA support 	enabled
+    Supported handlers 	cdb cdb_make db4 inifile flatfile
+
+
+
+Install:
+1. Configurate your DNS Anti Spam plugin in your pLog control center
+
+
+Optional Installation:
+This plugin includes a php script that can update your iptables firewall rules to 
+block these hosts
+
+1. Modify the script to change $LIFETYPE_TMP_FOLDER to the location of your LifeType
+tmp folder.
+2. Install a cron job for the root user that runs this script.  For example the command for the cron 
+job would look something like php /<path to lifetype>/plugins/0ipabuse/class/security/update_iptables.php
+
+***NOTE**** This could be very dangerous, and could inadvertently block you from your computer.  
+Use at your own risk.
\ No newline at end of file



More information about the pLog-svn mailing list