How to use my own data-file

In some scenarios which I installed from the hub, the filter is using data from a file which using the File helper. I understand, that the file that is specified there will be downloaded from Hub, when the scenario will be installed.

But how if I would like to use my own file in my own scenario, where I could add content on my own? I tried to put the file in the /var/lib/crowdsec/data folder and used then filename with File('mybackdoors.txt'), but the content of the file wasn’t loaded. I also tried to specify the full qualified filepath, but with the same negative result.

How can I make it possible to use my own file, or is it not supported?


Sorry, this is kinda poorly documented at the moment :frowning:

You’re on the right track !

You need to add your file to the /var/lib/crowdsec/data/ folder and reference it by its name (not its full path) in your scenario.

You also need to add a data section to your scenario (this is what tell crowdsec to actually load the file at startup):

 - dest_file: name_of_your_file.txt #this is what crowdsec uses to find the file in /var/lib/crowdsec/data/
   type: string #if the file content should be interpreted as regular expressions, use regexp instead

@blotus Thanks, worked for me. :slightly_smiling_face: