]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
HTTP BasicAuth support.
authorAndreas Dolp <dev@andreas-dolp.de>
Thu, 25 Feb 2021 18:23:09 +0000 (19:23 +0100)
committerJason Ish <jason.ish@oisf.net>
Tue, 13 Apr 2021 19:15:28 +0000 (13:15 -0600)
Allow whitespaces in entire HTTP header value.

This enables HTTP Basic Authentication.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4362

doc/add-source.rst
suricata/update/net.py

index e5b2a532748df5930f0cff48bf5ecc31ad0d1877..17b80e6e00852a379542d9eb33b697b34c81ce6a 100644 (file)
@@ -25,6 +25,10 @@ Options
 
      add-source --http-header "X-API-Key: 1234"
 
+   HTTP basic authentication can be achieved by setting the HTTP Basic
+   Authentication header with ``base64(user1:password1)``. Example::
+     add-source --http-header "Authorization: Basic dXNlcjE6cGFzc3dvcmQx"
+
 .. option:: --no-checksum
 
    Skips downloading the checksum URL for the rule source.
index 49a58cf5109783535ce620dea91d5e9383d98d44..dddb325447c99be9ff207d40c708f354a64a500c 100644 (file)
@@ -91,7 +91,7 @@ def is_header_clean(header):
     if len(header) != 2:
         return False
     name, val = header[0].strip(), header[1].strip()
-    if re.match( r"^[\w-]+$", name) and re.match(r"^[\w-]+$", val):
+    if re.match( r"^[\w-]+$", name) and re.match(r"^[\w\s-]+$", val):
         return True
     return False