firnsy / barnyard2

Barnyard2 is a dedicated spooler for Snort's unified2 binary output format.
GNU General Public License v2.0
344 stars 189 forks source link

Write Rule msg text to database with barnyard2 #240

Open Penneke opened 5 years ago

Penneke commented 5 years ago

Hi, is there any configuration option/s for Barnyard2 that I can use to write to a db table the "msg" field defined for a rule when it triggers?Currently I am only able to save the Signature name text defined in the sid-msg.map and to write the alert text to a file. I know it would be possible to write the fields I want from the file to a db with a script but would be lovely to have it done by default by barnyard. Any ideas?

PD: my current configuration to save data to db is:

output database: log, mysql, user=user password=password dbname=dbname host=host

And the alert msg content is different from the text defined for the signature of that alert sid (which I wrote in the sid-msg.map file): 100000222 || Fake sid text I just made up

alert any $FAKENET1 any -> $FAKENET2 FAKEPORT (msg:"THE MESSAGE I WANT TO BE IN DB TOO"; sid:100000222);

Thanks in advance.