From 6eea5f61d4cb20cb6b3c36c20b48ed10704d0169 Mon Sep 17 00:00:00 2001 From: Christian Studer Date: Tue, 23 May 2023 13:20:52 +0200 Subject: [PATCH] fix: [crowdsec] Fixed the `reverse_dns` field parsing & added the `background-noise` attribute --- misp_modules/modules/expansion/crowdsec.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misp_modules/modules/expansion/crowdsec.py b/misp_modules/modules/expansion/crowdsec.py index d512fd4..0bc0613 100644 --- a/misp_modules/modules/expansion/crowdsec.py +++ b/misp_modules/modules/expansion/crowdsec.py @@ -70,7 +70,9 @@ def _handler_v2(request_data): crowdsec_context_object.add_attribute("longitude", crowdsec_cti["location"]["longitude"]) crowdsec_context_object.add_attribute("as-name", crowdsec_cti["as_name"]) crowdsec_context_object.add_attribute("as-num", crowdsec_cti["as_num"]) - crowdsec_context_object.add_attribute("reverse-dns", crowdsec_cti["reverse_dns"]) + if crowdsec_cti.get('reverse_dns') is not None: + crowdsec_context_object.add_attribute("reverse-dns", crowdsec_cti["reverse_dns"]) + crowdsec_context_object.add_attribute('background-noise', crowdsec_cti['background_noise_score'] for behavior in crowdsec_cti["behaviors"]: crowdsec_context_object.add_attribute( "behaviors", behavior["label"],