# Custom Suricata Rules

**URL:** <https://community.ipfire.org/t/custom-suricata-rules/4656>\
**Category:** Intrusion Prevention\
**Created:** [24 February 2021 06:26 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656 "2021-02-24T06:26:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon45931963](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@anon45931963](https://community.ipfire.org/u/anon45931963)\
**Post date:** [24 February 2021 06:26 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/1 "2021-02-24T06:26:29Z")

</div>

Hi there,

I can see we have a few sets of Suricata rules to choose from.

Is it possible for us to make our own rules in addition to selecting say the ET set?

Or do our rules get blasted away anytime the ET set is updated?

---

<div class="post-metadata">

**Author:** ![peppetech](https://community.ipfire.org/user_avatar/community.ipfire.org/peppetech/32/12711_2.png) [@peppetech](https://community.ipfire.org/u/peppetech)\
**Post date:** [24 February 2021 08:40 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/2 "2021-02-24T08:40:50Z")

</div>

I think this is not easy, I think only 1 person here knows how to do it.  
you have to add it as a ruleset provider in

> ruleset-sources’

unfortunately I am no expert

---

<div class="post-metadata">

**Author:** ![anon45931963](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@anon45931963](https://community.ipfire.org/u/anon45931963)\
**Post date:** [24 February 2021 08:42 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/3 "2021-02-24T08:42:48Z")

</div>

Given we can only have 1.ruleset at a time I assume you can only have either your custom rules OR a set like Emerging threats not both at the same timer I gather?

---

<div class="post-metadata">

**Author:** ![peppetech](https://community.ipfire.org/user_avatar/community.ipfire.org/peppetech/32/12711_2.png) [@peppetech](https://community.ipfire.org/u/peppetech)\
**Post date:** [24 February 2021 08:44 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/4 "2021-02-24T08:44:55Z")

</div>

That is a very good point. but I would think once you make a custom ruleset, you would include all prefered ones. I wish I could remember who wrote all this. Will try to come back if I remmember

---

<div class="post-metadata">

**Author:** ![anon45931963](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@anon45931963](https://community.ipfire.org/u/anon45931963)\
**Post date:** [24 February 2021 08:45 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/5 "2021-02-24T08:45:54Z")

</div>

Okies thanks 🙂

---

<div class="post-metadata">

**Author:** ![stevee](https://community.ipfire.org/user_avatar/community.ipfire.org/stevee/32/12082_2.png) [@stevee](https://community.ipfire.org/u/stevee)\
**Post date:** [7 March 2021 17:16 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/6 "2021-03-07T17:16:21Z")

</div>

Hello knightian,

you simple can put your custom suricata rules into the following file:

```
/var/lib/suricata/local.rules

```

If this file does not exist, just create it and put your rules into it.

In the WUI on the IDS page the “local.rules” will be displayed and can be enabled like the usual way.

Best regards,

-Stefan

---

<div class="post-metadata">

**Author:** ![peppetech](https://community.ipfire.org/user_avatar/community.ipfire.org/peppetech/32/12711_2.png) [@peppetech](https://community.ipfire.org/u/peppetech)\
**Post date:** [8 March 2021 17:38 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/7 "2021-03-08T17:38:08Z")

</div>

That was easy, thank you @stevee. 😍

I loaded 25MB of suricata rules into **local.rules**

RAM usage went from 500MB to 1.6 GB.

Now I am waiting for IPfire to start smoking 😄

![](https://community.ipfire.org/uploads/default/original/2X/3/33714f0f5354416495e39050d4028d92592c566f.png)

---

<div class="post-metadata">

**Author:** ![anon45931963](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@anon45931963](https://community.ipfire.org/u/anon45931963)\
**Post date:** [10 March 2021 03:36 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/8 "2021-03-10T03:36:02Z")

</div>

Legend thanks mate!

Updated to core 154 and local.rules persisted as well so that’s brilliant, thanks again!

---

<div class="post-metadata">

**Author:** ![peppetech](https://community.ipfire.org/user_avatar/community.ipfire.org/peppetech/32/12711_2.png) [@peppetech](https://community.ipfire.org/u/peppetech)\
**Post date:** [10 March 2021 06:43 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/9 "2021-03-10T06:43:11Z")

</div>

Is there a way to download updated rules into local.rules?  
i.e. from  
[https://sslbl.abuse.ch/blacklist/sslblacklist\_tls\_cert.rules](https://sslbl.abuse.ch/blacklist/sslblacklist_tls_cert.rules)

---

<div class="post-metadata">

**Author:** ![anon45931963](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@anon45931963](https://community.ipfire.org/u/anon45931963)\
**Post date:** [19 March 2021 14:27 UTC](https://community.ipfire.org/t/custom-suricata-rules/4656/10 "2021-03-19T14:27:04Z")

</div>

You could just set a cronjob to run a script that does it I reckon might be best way. Although caution as I found entries in fcrontab -e get reset when you update.
