logo       
Bookmark and Share

Re: No logging to mysql in snort 2.4.x: msg#00001

security.ids.snort.devel

Subject: Re: No logging to mysql in snort 2.4.x

Hi Martin,

> On Fri, 3 Feb 2006, Dirk Geschke wrote:
> >> My question is why snort 2.4 doesn't work when there's no problems with
> >> 2.3.
> > are you really sure about this? If the connection to the database is
> > interrupted you have to re-connect. This is never done in the database
> > output plugin. The connect to the dabase is done on startup of snort,
> > never ever later again.
>
> Yes I'm sure. You must remember things incorrectly.

No, the database output plugin never tries a reconnect, it is the client
library of MySQL.

Maybe you are using different mysql libraries for your tests?

In 5.0 you can read:

* The `reconnect' flag in the `MYSQL' structure is set to 0 by
`mysql_real_connect()'. Only those client programs which did not
explicitly set this flag to 0 or 1 after `mysql_real_connect()'
experience a change. Having automatic reconnection enabled by
default was considered too dangerous (due to the fact that table
locks, temporary tables, user variables, and session variables are
lost after reconnection).

Earlier versions (4.1 and earlier) did reconnect within the library:

If the `mysql' client loses its connection to the server while sending
a query, it immediately and automatically tries to reconnect once to
the server and send the query again. However, even if `mysql' succeeds
in reconnecting, your first connection has ended and all your previous
session objects and settings are lost: temporary tables, the autocommit
mode, and user-defined and session variables.

So maybe this is the explanation for the "strange" behaviour?

> Why is the automatic reconnect function removed from snort v2.4?
> Can you please put it back?

Because it was never part of snort. The Library did the reconnect and
the default for the library changed from automatically reconntect to
not reconnect. But you can change this easily within the mysql_real_connect
call within snort-2.4.x/src/output-plugins/spo_database.c

But then you may silently loose some alerts...

Best regards

Dirk



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise