# How to make permament ban

**URL:** https://discourse.crowdsec.net/t/how-to-make-permament-ban/823
**Category:** Uncategorized
**Created:** [May 30, 2022, 2:07am UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823 "2022-05-30T02:07:24Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fayataf488](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@fayataf488](https://discourse.crowdsec.net/u/fayataf488)
#### Post date: [May 30, 2022, 2:07am UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/1 "2022-05-30T02:07:24Z")

</div>

Hello, if you set duration=0 will the ban be permanent? if set to -1 it gives an error  
if i put duration: 360d  
duration: 720d then it doesn’t work, are there limits? if yes, where and how to find them

---

<div class="post-metadata">

### Author: ![thibault](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/thibault/32/2_2.png) [@thibault](https://discourse.crowdsec.net/u/thibault)
#### Post date: [May 30, 2022, 8:05am UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/2 "2022-05-30T08:05:44Z")

</div>

Hello,

You cannot currently set a ban to be permanent.

---

<div class="post-metadata">

### Author: ![smu44](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@smu44](https://discourse.crowdsec.net/u/smu44)
#### Post date: [May 31, 2022, 1:14pm UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/3 "2022-05-31T13:14:51Z")

</div>

Working here with 596h, which is quite long …

---

<div class="post-metadata">

### Author: ![janbaer](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/janbaer/32/358_2.png) [@janbaer](https://discourse.crowdsec.net/u/janbaer)
#### Post date: [June 2, 2022, 9:38am UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/4 "2022-06-02T09:38:36Z")

</div>

Something like a blacklist would be nice.

---

<div class="post-metadata">

### Author: ![racitup](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@racitup](https://discourse.crowdsec.net/u/racitup)
#### Post date: [January 31, 2023, 3:39pm UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/5 "2023-01-31T15:39:36Z")

</div>

If you intend to be a credible alternative to fail2ban, this is essential. You need:

- An optional collection that parses crowdsec’s own logs
- A permanent ban rule, for example 3 ban log entries leads to permanent ban

Look up fail2ban’s recidive jail

> <https://github.com/crowdsecurity/hub/issues/646>
>
> If you intend to be a credible alternative to fail2ban, this is essential. You n…eed:
> 
> \- An optional collection/scenario that parses crowdsec’s own logs
> \- Default rule, for example: 3 ban log entries leads to longer ban
> \- A permanent ban capability 
> 
> Look up fail2ban’s recidive jail
> https://github.com/fail2ban/fail2ban/blob/master/config/filter.d/recidive.conf
> https://github.com/fail2ban/fail2ban/blob/f93a538693f25c5e735cf88a0f2fc942b943d18b/config/jail.conf#L822
> https://discourse.crowdsec.net/t/how-to-make-permament-ban/823

---

<div class="post-metadata">

### Author: ![racitup](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@racitup](https://discourse.crowdsec.net/u/racitup)
#### Post date: [February 1, 2023, 12:55pm UTC](https://discourse.crowdsec.net/t/how-to-make-permament-ban/823/6 "2023-02-01T12:55:10Z")

</div>

You can’t make a permanent ban, but you can perform maths on the number of bans to determine the next ban, which is just as good. Look up `duration_expr ` and follow the [github](https://github.com/crowdsecurity/hub/issues/646) discussion
