]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc: adding your own rules
authorJason Ish <ish@unx.ca>
Fri, 4 Dec 2015 15:38:16 +0000 (09:38 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 28 Sep 2016 11:11:10 +0000 (13:11 +0200)
doc/sphinx/adding-your-own-rules.rst [new file with mode: 0644]
doc/sphinx/rules.rst

diff --git a/doc/sphinx/adding-your-own-rules.rst b/doc/sphinx/adding-your-own-rules.rst
new file mode 100644 (file)
index 0000000..303566f
--- /dev/null
@@ -0,0 +1,60 @@
+Adding Your Own Rules
+=====================
+
+If you would like to create a rule yourself and use it with Suricata,
+this guide might be helpful.
+
+Start creating a file for your rule. Type for example the following in
+your console:
+
+::
+
+  sudo nano local.rules
+
+Write your rule, see [[Suricata Rules]] and save it.
+
+Open yaml
+
+::
+
+  sudo nano /etc/suricata/suricata.yaml
+
+and make sure your local.rules file is added to the list of rules.
+
+Now, run Suricata and see if your rule is being loaded.
+
+::
+
+  suricata -c /etc/suricata/suricata.yaml -i wlan0
+
+If your rule failed to load, check if you have made a mistake anywhere
+in the rule. Mind the details; look for mistakes in special
+characters, spaces, capital characters etc.
+
+Next, check if your log-files are enabled in suricata.yaml.
+
+If you had to correct your rule and/or modify yaml, you have to
+restart Suricata.
+
+If you see your rule is successfully loaded, you can double check your
+rule by doing something that should trigger it.
+
+Enter:
+
+::
+
+  tail -f /var/log/suricata/fast.log
+
+If you would make a rule like this:
+
+::
+
+  alert http any any -> any any (msg:"Do not read gossip during work";
+  content:"Scarlett"; nocase; classtype:policy-violation; sid:1; rev:1;)
+
+Your alert should look like this:
+
+::
+
+  09/15/2011-16:50:27.725288  [**] [1:1:1] Do not read gossip during work [**]
+  [Classification: Potential Corporate Privacy Violation] [Priority: 1] {TCP} 192.168.0.32:55604 -> 68.67.185.210:80
index 67dcabd6c16fde7870eb0555e5df447dfbf043e4..e0083392fcbc7196c4ef1bec6cd0977cfb57f799 100644 (file)
@@ -14,3 +14,4 @@ Rules
    file-keywords
    thresholding
    rule-lua-scripting
+   adding-your-own-rules