]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Enable a conf option to enable/disable legacy keywords.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Fri, 1 Mar 2013 06:19:27 +0000 (11:49 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 20 Mar 2013 11:53:31 +0000 (12:53 +0100)
Currently, uricontent is declared a legacy keyword, and is enabled by default.

src/detect-uricontent.c
suricata.yaml.in

index e743de22601ac431b7ebc4eacf86122788111106..5bf5da94cc3fbf5ffaf6b2eccff8ee91a7ad5a9e 100644 (file)
@@ -55,6 +55,7 @@
 #include "util-binsearch.h"
 #include "util-spm.h"
 #include "util-spm-bm.h"
+#include "conf.h"
 
 /* prototypes */
 static int DetectUricontentSetup (DetectEngineCtx *, Signature *, char *);
@@ -211,6 +212,25 @@ int DetectUricontentSetup(DetectEngineCtx *de_ctx, Signature *s, char *contentst
 {
     SCEnter();
 
+    char *legacy = NULL;
+    if (ConfGet("legacy.uricontent", &legacy) == 1) {
+        if (strcasecmp("disabled", legacy) == 0) {
+            SCLogError(SC_ERR_INVALID_SIGNATURE, "uriconent deprecated.  To "
+                       "use a rule with \"uricontent\", either set the "
+                       "option - \"legacy.uricontent\" in the conf to "
+                       "\"enabled\" OR replace uricontent with "
+                       "\'content:%s; http_uri;\'.", contentstr);
+            goto error;
+        } else if (strcasecmp("enabled", legacy) == 0) {
+            ;
+        } else {
+            SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "Invalid value found "
+                       "for legacy.uriconent - \"%s\".  Valid values are "
+                       "\"enabled\" OR \"disabled\".", legacy);
+            goto error;
+        }
+    }
+
     if (DetectContentSetup(de_ctx, s, contentstr) < 0)
         goto error;
 
index 4d7552ffc00974505a7ae8dacb49f1ba3b9c2534..bd5e4eec98840550581ba2c80298df32a5fb9fdd 100644 (file)
@@ -297,6 +297,9 @@ af-packet:
     #threads: 2
     #use-mmap: yes
 
+legacy:
+  uricontent: enabled
+
 # You can specify a threshold config file by setting "threshold-file"
 # to the path of the threshold config file:
 # threshold-file: /etc/suricata/threshold.config