]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc: added tos keyword
authorTravis Green <travis@travisgreen.net>
Thu, 20 Dec 2018 00:45:11 +0000 (17:45 -0700)
committerVictor Julien <victor@inliniac.net>
Thu, 20 Dec 2018 09:32:21 +0000 (10:32 +0100)
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2583

doc/userguide/rules/header-keywords.rst
src/detect-tos.c

index 26998527436a78d2e3187c8d17ea3a66c046fc29..f39b3005eb9430fe5d5948e1f21d061010e929da 100644 (file)
@@ -221,6 +221,32 @@ Example of fragoffset in a rule:
 
    alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"ET EXPLOIT Invalid non-fragmented packet with fragment offset>0"; fragbits: M; :example-rule-emphasis:`fragoffset: >0;` reference:url,doc.emergingthreats.net/bin/view/Main/2001022; classtype:bad-unknown; sid:2001022; rev:5; metadata:created_at 2010_07_30, updated_at 2010_07_30;)
 
+tos
+^^^
+
+The tos keyword can match on specific decimal values of the IP header TOS
+field. The tos keyword can be have a value from 0 - 255. This field of the
+IP header has been updated by `rfc2474 <https://tools.ietf.org/html/rfc2474>`_
+to include functionality for
+`Differentiated services <https://en.wikipedia.org/wiki/Differentiated_services>`_.
+
+Format of tos::
+
+  tos:[!]<number>;
+
+Example of tos in a rule:
+
+.. container:: example-rule
+
+    alert ip any any -> any any (msg:"Differentiated Services Codepoint: Class Selector 1 (8)"; flow:established; :example-rule-emphasis:`tos:8;` classtype:not-suspicious; sid:2600115; rev:1;)
+
+Example of tos with negated values:
+
+.. container:: example-rule
+
+    alert ip any any -> any any (msg:"TGI HUNT non-DiffServ aware TOS setting"; flow:established,to_server; :example-rule-emphasis:`tos:!0; tos:!8; tos:!16; tos:!24; tos:!32; tos:!40; tos:!48; tos:!56;` threshold:type limit, track by_src, seconds 60, count 1; classtype:bad-unknown; sid:2600124; rev:1;)
+
+
 TCP keywords
 ------------
 
index 609ff8c866050dccdecbeb98a869cb8ca81da70d..c6ccb9bd10eb0a597df10e8446602b5afb11b435 100644 (file)
@@ -69,6 +69,8 @@ void DetectTosRegister(void)
     sigmatch_table[DETECT_TOS].RegisterTests = DetectTosRegisterTests;
     sigmatch_table[DETECT_TOS].flags =
         (SIGMATCH_QUOTES_OPTIONAL|SIGMATCH_HANDLE_NEGATION);
+    sigmatch_table[DETECT_TOS].url =
+        DOC_URL DOC_VERSION "/rules/header-keywords.html#tos";
 
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
 }