[Bro] loading scripts only if file exists

Seth Hall seth at icir.org
Wed Jan 13 09:04:50 PST 2016


> On Jan 13, 2016, at 11:23 AM, Dirk Leinenbach <dirk.leinenbach at consistec.de> wrote:
> 
> I've tried to use @prefixes to conditionally load scripts, but couldn't 
> figure out exactly where bro would be searching for those scripts.

I think that prefixes are probably exactly what you’re looking for.  If you add a prefix and then create a file by the right name it will only load it when it finds the file.  This is a little tricky with the current setup unfortunately, I didn’t get this setup quite the way I wanted to a number of years ago.

If you write a file named “local.local.bro” to your site/ directory, that script will automatically load if it’s found.

> If there an equivalent for something like "if [-f /etc/bro-config.bro] " ?

Not really.

  .Seth

--
Seth Hall
International Computer Science Institute
(Bro) because everyone has a network
http://www.bro.org/




More information about the Bro mailing list