Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Parse MISP events to update attributes #14

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Parse MISP events to update attributes #14

wants to merge 1 commit into from

Conversation

0snap
Copy link
Contributor

@0snap 0snap commented Jan 27, 2020

MISP is not forwarding attributes when events get deleted. There is currently no means to detect deleted events without carrying state.

This PR prepares the code for once the following issue is resolved: MISP/MISP#4450

@0snap 0snap added feature New functionality blocked Blocked by an (external) issue labels Jan 27, 2020
@0snap 0snap changed the title Unify MISP message handling, allow events Parse MISP events to update attributes Jan 27, 2020
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I just have some minor discussion points.

"""Gracefully tries to parse and forward a message string. If the message
cannot be parsed, an error is logged and None is returned.
@param msg_str The message (JSON string) to forward
@param inq The queue to forward successfully parsed message to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@param inq The queue to forward successfully parsed message to
@param inq The queue to forward the successfully parsed message to.

intel = map_to_internal(msg["Attribute"], msg.get("action", None), logger)
if intel:
all_intel.append(intel)
elif msg.get("Event", None) and msg.get("action", None) == "delete":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that you are preparing for MISP/MISP#4450 here. While you're at it, how about logging actions other than delete.

When we add an event, I think we don't have to do anything because we get all the contained attributes as well. Is that correct?

Then the only other action left is updating an event. I haven't check this, but I would assume that event updates don't matter for Threat Bus right now, because at this point we only care about attribute updates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Blocked by an (external) issue feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot delete all attribute when event gets deleted
2 participants