From abc48c74d389b896be04c79dc7ca46b5a1840fe6 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 10 May 2024 12:07:45 +0200 Subject: [PATCH] filter expert: treat filter_regex false as False if the parameter filter_regex: false was set, the bot treated this as true with this patch, false is treated as false --- CHANGELOG.md | 2 ++ intelmq/bots/experts/filter/expert.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa45b9358..a66c4caa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ - `intelmq.bots.parsers.dataplane.parser`: Use ` | ` as field delimiter, fix parsing of AS names including `|` (PR#2488 by DigitalTrustCenter). #### Experts +- `intelmq.bots.experts.filter.expert`: + - Treat value `false` for parameter `filter_regex` as false (PR#2499 by Sebastian Wagner). #### Outputs - `intelmq.bots.outputs.misp.output_feed`: handle failures if saved current event wasn't saved or is incorrect (PR by Kamil Mankowski). diff --git a/intelmq/bots/experts/filter/expert.py b/intelmq/bots/experts/filter/expert.py index e8fa2c34d..68efac56f 100644 --- a/intelmq/bots/experts/filter/expert.py +++ b/intelmq/bots/experts/filter/expert.py @@ -64,7 +64,7 @@ def init(self): self.filter = False self.regex = False - if self.filter_regex is not None: + if self.filter_regex is not None and self.filter_regex is not False: self.regex = re.compile(self.filter_value) self.time_filter = self.not_after is not None or self.not_before is not None