fix: [crowdsec] Fixed the `reverse_dns` field parsing & added the `background-noise` attribute

pull/617/head
Christian Studer 2023-05-23 13:20:52 +02:00
parent ddd8b8513e
commit 6eea5f61d4
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,9 @@ def _handler_v2(request_data):
crowdsec_context_object.add_attribute("longitude", crowdsec_cti["location"]["longitude"]) 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-name", crowdsec_cti["as_name"])
crowdsec_context_object.add_attribute("as-num", crowdsec_cti["as_num"]) 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"]: for behavior in crowdsec_cti["behaviors"]:
crowdsec_context_object.add_attribute( crowdsec_context_object.add_attribute(
"behaviors", behavior["label"], "behaviors", behavior["label"],