data directive in scenario do not load local file in memory
Hello, I created a dummy scenario to import local data file (with a list of IPs) but it seems to not be loaded in memory.
I use the imported file with the File() function in filters section of profiles.yaml:
It worked for a couple of months but I realized it do not work anymore.
Here is the dummy scenario:
Here is the debug log:
13 Replies
Important Information
This post has been marked as resolved. If this is a mistake please press the red button below or type
/unresolve
© Created By WhyAydan for CrowdSec ❤️
the
File
at profiles level was really a hack workaround, in the latest version we introduced cscli allowlist
function you may want to switch over to this for better support.Actually I use this filter in a profile to monitor IPs in the file. If one of IPs in this file get a decision, it gets ban and send a mail notification.
That way I can receive an alert if trusted ip get banned and I can remediate (I don't wand to allow blindly these IPs)
So cscli allowlist seems not to be helpful in that case .. but thank you i didn't know it has been released !
Okay makes sense, so
importtrustedip.txt
exists in the data directory and has content?yep, present in /var/lib/crowdsec/data/ and has list of ips (one per line)
Okay can you add
debug: true
to your scenario and restart crowdsec to see if it loads into memory?Here it is
hmmm there is nothing
best probbaly to switch the whole of crowdsec into debug
I set crowdsec in debug, the "Returning list of scenarios :" do not return the scenario.. (but return crowdsecurity and other custom scenarios)
Maybe I should add some dummy section in the import data scenario ? Or add in an existing working scenario ?
most likely because it doesnt have any properties its not a "full scenario" but yeah you can add it to the bottom of another scenario
I find out ..
I hardened my LAPI weeks ago, by commenting:
#crowdsec_service:
# #console_context_path: /etc/crowdsec/console/context.yaml
#acquisition_path: /etc/crowdsec/acquis.yaml
#acquisition_dir: /etc/crowdsec/acquis.d
#parser_routines: 1
The server running LAPI do not need to parse logs, so I deactivate this section.
But, side effect it do not load scenario/parsers etc
After uncomment those lines, it works again.Resolving data directive in scenario do not load local file in memory
This has now been resolved. If you think this is a mistake please run
/unresolve