Re: [Console-users] mlogc issue?
Christian Bockermann <chris <at> jwall.org>
2011-04-05 20:10:52 GMT
Hi David,
I just had a glance at your script. Thanks for sharing!
If this is ok with you, then I'd include your script as a sample in the
next release of the jwall-tools.
Best regards,
Chris
Am 04.04.2011 um 20:16 schrieb David Guimaraes:
> Hi,
>
> I created something different, I made a bash script that runs on cron and reads the serial log file
(SecAuditLogType Serial) generated by ModSecurity and sends the data to an listener AuditConsole RPC
using the jwall tool. This solves the problem of mlogc(hang) we're going through.
>
> # crontab -l
> */1 * * * * /root/modaudit-jwall-skys.sh 2>&1 >>/var/log/modaudit-jwall-skys.log
>
> http://pastebin.com/vnEQquyv
>
>
> On Wed, Mar 9, 2011 at 6:25 PM, Christian Bockermann <chris <at> jwall.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi list,
>
> since a couple of people lately had problems with the mlogc spinning
> wildly, I did include a simple alternative version into my jwall-tools.
> Basically this works similar to mlogc, uses the same config, BUT
>
> (1) Does not run inside Apache, i.e. does not block the Apache
> process when running wild (which it hopefully does not do
)
>
> (2) Is implemented in Java (since all the parsing is done using my
> parser libraries)
>
> Basically, it requires the mlogc-config and continuously reads a
> ModSecurity index-log file for new requests. These will then be send
> to the ModSecurity console or my AuditConsole.
>
> The things that need to be changed in Apache:
>
> # OLD way using mlogc:
> #
> SecAuditLog "|mlogc /path/to/mlogc.conf"
> SecAuditLogStorageDirectory /opt/modsecurity/var/audit
>
> needs to be changed to
>
> # write the index-log to disk instead of piping it to mlogc:
> #
> SecAuditLog /opt/modsecurity/var/audit/index
> SecAuditLogStorageDirectory /opt/modsecurity/var/audit
>
>
> Now, to start the sending process, simply download the latest jwall-tools-0.5.jar
> from
> http://download.jwall.org/jwall-tools/0.5/jwall-tools-0.5.jar
>
> and run:
>
> java -jar jwall-tools-0.5.jar mlogc /path/to/mlogc.conf /opt/modsecurity/var/audit/index
>
> Now, the jwall-tools' mlogc implementation will jump to the end of the index-file
> and check for new data to arrive. It will then send any events to the receiver.
>
>
> There are a couple of things, which currently are not taken care of:
>
> (1) Events, which failed to be sent, will be marked in a special file
> and can be re-sent again later. This needs to be done manually. The
> error-queue.idx is simply another index-file, which can be send
> with the jwall-tools:
>
> java -Dsend-complete=true -jar jwall-tools-0.5.jar mlogc /path/to/mlogc.conf /path/to/error-queue.idx
>
> (2) The index-file might grow pretty large over time. So it would need to
> be re-set manually or via a cron-job, currently.
>
>
> I have to admit, this Java implementation of mlogc lacks some comfort over
> the original mlogc implementation, but if there is interest, I'd be happy
> to add new features to it.
>
> (BTW: The sources of the jwall-tools are available, just drop me a line if
> you're interested in contributing
)
>
> Best regards,
>
> Chris
>