]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
fix ET Open by default logic... 7/head
authorJason Ish <ish@unx.ca>
Mon, 6 Nov 2017 04:27:01 +0000 (22:27 -0600)
committerJason Ish <ish@unx.ca>
Mon, 6 Nov 2017 04:27:01 +0000 (22:27 -0600)
Somewhere along the line the behaviour of loading ET Open
if no other URLs were present was lost. Re-add this default
behaviour.

Loading ET-Open by default will happen if:
- no --urls passed on the command line
- no sources provided in the configuration
- no etpro code given

suricata/update/main.py

index 6ee7ea09a76dc30556c43843d63224e234fe6e36..da4ab49484f08903517b3fc66a776f4e1317ad37 100644 (file)
@@ -906,14 +906,6 @@ def load_sources(config, suricata_version):
 
     urls = []
 
-    # If --etopen was provided on the command line, add it.
-    if config.get("etopen"):
-        urls.append(resolve_etopen_url(suricata_version))
-
-    # If --etpro was provided on the command line, add it.
-    if config.get("etpro"):
-        urls.append(resolve_etpro_url(config.get("etpro"), suricata_version))
-
     # Add any URLs added with the --url command line parameter.
     if config.args.url:
         for url in config.args.url:
@@ -941,6 +933,14 @@ def load_sources(config, suricata_version):
             else:
                 logger.error("Unknown source type: %s", source["type"])
 
+    # If --etpro, add it.
+    if config.get("etpro"):
+        urls.append(resolve_etpro_url(config.get("etpro"), suricata_version))
+
+    # If --etopen or urls is still empty, add ET Open.
+    if config.get("etopen") or not urls:
+        urls.append(resolve_etopen_url(suricata_version))
+
     # Converting the URLs to a set removed dupes.
     urls = set(urls)