From 96ba5aa371a0b4f3cd4072deb2b2fe0bf7371838 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 16 Aug 2024 16:45:02 +0200 Subject: [PATCH 1/2] minor: shadowserver api collector: fix typo --- intelmq/bots/collectors/shadowserver/collector_reports_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intelmq/bots/collectors/shadowserver/collector_reports_api.py b/intelmq/bots/collectors/shadowserver/collector_reports_api.py index 09ca86f36..20f6dd73a 100644 --- a/intelmq/bots/collectors/shadowserver/collector_reports_api.py +++ b/intelmq/bots/collectors/shadowserver/collector_reports_api.py @@ -29,7 +29,7 @@ class ShadowServerAPICollectorBot(CollectorBot, HttpMixin, CacheMixin): Parameters: api_key (str): Your Shadowserver API key secret (str): Your Shadowserver API secret - country (str): DEPRECIATED The mailing list you want to download reports for (i.e. 'austria') + country (str): DEPRECATED The mailing list you want to download reports for (i.e. 'austria') reports (list): A list of strings or a comma-separated list of the mailing lists you want to process. types (list): From b322bc523b2b8d7bf69eae83037b2d098f4618b9 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 16 Aug 2024 16:45:18 +0200 Subject: [PATCH 2/2] shadowserver collector: fix reports = '' behaviour it the parameter is an empty string (or only contains whitespace), behave as if the parameter is not set and select all reports fixes https://github.com/certtools/intelmq/issues/2521 --- intelmq/bots/collectors/shadowserver/collector_reports_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/intelmq/bots/collectors/shadowserver/collector_reports_api.py b/intelmq/bots/collectors/shadowserver/collector_reports_api.py index 20f6dd73a..3fc3d2f9f 100644 --- a/intelmq/bots/collectors/shadowserver/collector_reports_api.py +++ b/intelmq/bots/collectors/shadowserver/collector_reports_api.py @@ -56,7 +56,9 @@ def init(self): raise ValueError('No secret provided.') if isinstance(self.reports, str): - self._report_list = self.reports.split(',') + # if reports is an empty string (or only contains whitespace), behave as if the parameter is not set and select all reports + reports = self.reports.strip() + self._report_list = reports.split(',') if reports else [] elif isinstance(self.reports, list): self._report_list = self.reports if isinstance(self.types, str):