Skip to content

Commit

Permalink
fetch: handle bare file urls not ending in .rules
Browse files Browse the repository at this point in the history
If a URL is a bare file, and does not end in .rules, Suricata-Update
will ignore it.  Such URLs might look like:

- https://<misp>/1011

Ticket: #3664
  • Loading branch information
jasonish committed Mar 5, 2024
1 parent 61bb66f commit 712c2d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
https://redmine.openinfosecfoundation.org/issues/6777
- If no Suricata is found, Suricata-Update will assume version 6.0.0
instead of 4.0.0.
- Handle URLs of bare files that don't end in .rules:
https://redmine.openinfosecfoundation.org/issues/3664

## 1.3.0 - 2023-07-07

Expand Down
2 changes: 2 additions & 0 deletions suricata/update/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def extract_files(self, filename):

# The file is not an archive, treat it as an individual file.
basename = os.path.basename(filename).split("-", 1)[1]
if not basename.endswith(".rules"):
basename = "{}.rules".format(basename)
files = {}
files[basename] = open(filename, "rb").read()
return files
Expand Down

0 comments on commit 712c2d4

Please sign in to comment.