Same IP banned twice 2 hours apart?

I've seen the same IP getting banned twice 2 hours apart, not sure how it's possible? My default bans are for longer, so it shouldn't be possible, I do see the active decision for that IP, so I wonder if I'm missing something? Thanks.
No description
31 Replies
CrowdSec
CrowdSec3w ago
Important Information
Thank you for getting in touch with your support request. To expedite a swift resolution, could you kindly provide the following information? Rest assured, we will respond promptly, and we greatly appreciate your patience. While you wait, please check the links below to see if this issue has been previously addressed. If you have managed to resolve it, please use run the command /resolve or press the green resolve button below.
Log Files
If you possess any log files that you believe could be beneficial, please include them at this time. By default, CrowdSec logs to /var/log/, where you will discover a corresponding log file for each component.
Guide Followed (CrowdSec Official)
If you have diligently followed one of our guides and hit a roadblock, please share the guide with us. This will help us assess if any adjustments are necessary to assist you further.
Screenshots
Please forward any screenshots depicting errors you encounter. Your visuals will provide us with a clear view of the issues you are facing.
© Created By WhyAydan for CrowdSec ❤️
iiamloz
iiamloz3w ago
Which remediation component are you using?
XTROIL
XTROILOP3w ago
Are you referring to this?
sudo cscli bouncers list
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name IP Address Valid Last API pull Type Version Auth Type
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
cs-firewall-bouncer-173932119 127.0.0.1 ✔️ 2025-08-09T14:20:30Z crowdsec-firewall-bouncer v0.0.31-debian-pragmatic-arm64-4b99c161b2c1837d76c5fa89e1df83803dfbcc87 api-key
crowdsec-nginx-bouncer-1740514458 127.0.0.1 ✔️ 2025-08-09T13:12:55Z crowdsec-nginx-bouncer v1.1.0 api-key
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sudo cscli bouncers list
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name IP Address Valid Last API pull Type Version Auth Type
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
cs-firewall-bouncer-173932119 127.0.0.1 ✔️ 2025-08-09T14:20:30Z crowdsec-firewall-bouncer v0.0.31-debian-pragmatic-arm64-4b99c161b2c1837d76c5fa89e1df83803dfbcc87 api-key
crowdsec-nginx-bouncer-1740514458 127.0.0.1 ✔️ 2025-08-09T13:12:55Z crowdsec-nginx-bouncer v1.1.0 api-key
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
iiamloz
iiamloz3w ago
Yes, I see firewall and nginx don't suppose you used cloudflare?
XTROIL
XTROILOP3w ago
Nope I don't use cloudflare currently.
iiamloz
iiamloz3w ago
Very odd, cause typically it should block on firewall layer, do you use any remediation other than ban?
XTROIL
XTROILOP3w ago
I don't think so... sudo cscli decisions list shows only ban for the action, if I should see anything else there.
iiamloz
iiamloz3w ago
Nah it was a question to understand if the first was another decision type but you would know if you configured captcha
XTROIL
XTROILOP3w ago
Don't recall anything regarding captcha so I assume not
iiamloz
iiamloz3w ago
If you run iptables -L INPUT you see the crowdsec chain defined
XTROIL
XTROILOP3w ago
iptables -L INPUT
Chain INPUT (policy ACCEPT)
target prot opt source destination
CROWDSEC_CHAIN all -- anywhere anywhere
iptables -L INPUT
Chain INPUT (policy ACCEPT)
target prot opt source destination
CROWDSEC_CHAIN all -- anywhere anywhere
_KaszpiR_
_KaszpiR_3w ago
what about FORWARD? if it is for example nated to docker?
XTROIL
XTROILOP3w ago
I think the backend uses nftables and I do see some rules for FORWARD to docker, but if there is some specific question let me know, not super familiar with that in depth.
_KaszpiR_
_KaszpiR_3w ago
what I mean is that default crowdsec firewall remediation is via iptables FORWARD rules but if you have web server under docker or similiar setup then the traffic is NAT'ed so then it goes through FORWARD rule (thus being skipped by INPUT rules), which effectively means the crowdsec firewall remediation is ommited, unless you also have crowdsec rules for FORWARD check iptables -n -L FORWARD if there is CROWDSEC_CHAIN there as well another option can be the fact that in iptables -n L INPUT crowdsec chain is below other rules and those rules are accepting connections anyway in that case you would have to move CROWDSEC_CHAIN to the top
XTROIL
XTROILOP3w ago
I guess it might be the case?
iptables -n -L FORWARD
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER 0 -- 0.0.0.0/0 0.0.0.0/0
DOCKER-FORWARD 0 -- 0.0.0.0/0 0.0.0.0/0

iptables -n -L INPUT
Chain INPUT (policy ACCEPT)
target prot opt source destination
CROWDSEC_CHAIN 0 -- 0.0.0.0/0 0.0.0.0/0
iptables -n -L FORWARD
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER 0 -- 0.0.0.0/0 0.0.0.0/0
DOCKER-FORWARD 0 -- 0.0.0.0/0 0.0.0.0/0

iptables -n -L INPUT
Chain INPUT (policy ACCEPT)
target prot opt source destination
CROWDSEC_CHAIN 0 -- 0.0.0.0/0 0.0.0.0/0
Should I add CROWDSEC_CHAIN to FORWARD as well then? I did check the setup in general tho, and the ban decisions does seem to apply. But I guess it might still be the case
_KaszpiR_
_KaszpiR_3w ago
if your apps are dockerized and they serve requests then yeah
XTROIL
XTROILOP3w ago
What would be the proper approach of doing that? Is there some docs that cover this?
_KaszpiR_
_KaszpiR_3w ago
https://github.com/crowdsecurity/cs-firewall-bouncer/blob/main/pkg/iptables/iptables_context.go#L71 probably would require to raise the issue on cs-firewall-bouncer to add input and output and not just the filter (unless there is already such issue) https://github.com/crowdsecurity/cs-firewall-bouncer/issues/32 maybe o wait, there is an option to specifyi it already https://github.com/crowdsecurity/cs-firewall-bouncer/blob/main/config/crowdsec-firewall-bouncer.yaml#L30-L33
XTROIL
XTROILOP3w ago
I'll try to enable that, should I also enable DOCKER-USER?
_KaszpiR_
_KaszpiR_3w ago
this is not needed, because DOCKER-USER is in FORWARD chain, and CROWDSEC_CHAIN should be added before it unless you need additional rules for DOCKER-USER for cross-container communication fitering generally you can enable DOCKER-USER for max security for the price of the additional load on the node due to processing additional firewall rules, should not be a problem on modern hardware
XTROIL
XTROILOP3w ago
I see, I think I'll try without it for now, I use rpi4 so the hardware is not great.
_KaszpiR_
_KaszpiR_3w ago
frankly speaking I'd rather suggest to block it on the router, before it even reaches rpi
XTROIL
XTROILOP3w ago
Hmm not sure my router can do that..
_KaszpiR_
_KaszpiR_3w ago
what router?
XTROIL
XTROILOP3w ago
Some are xiaomi and some are tp link
_KaszpiR_
_KaszpiR_3w ago
hm no idea, if they expose access to them via telnet/api then maybe
XTROIL
XTROILOP3w ago
I guess it might be possible with something like openwrt but common routers..not sure. I can try to ssh into my router and maybe try that perhaps.
_KaszpiR_
_KaszpiR_3w ago
it would reuire dedicated bouncer for that device, similiar to other bouncers rpi4 should be able to handle it
XTROIL
XTROILOP3w ago
Hmm yeah Alright, I'll enable that too then 🙂 It seems to work now btw, so that's a good start
_KaszpiR_
_KaszpiR_3w ago
if the load is too high you can disable it and see how it goes https://docs.crowdsec.net/u/bouncers/custom/ or basic shell script but probably it would require some coding, another option if the firewall supports ipsets or blacklists from a file then https://docs.crowdsec.net/u/bouncers/blocklist-mirror could be used ok, gotta go to sleep, cu
XTROIL
XTROILOP3w ago
Thanks a lot for the help!!! 🙂

Did you find this page helpful?