Coder Social home page Coder Social logo

Comments (4)

Rafiot avatar Rafiot commented on July 30, 2024 1

I'll work on a fix asap. Expect it to be fixed early next year.

from pymisp.

Rafiot avatar Rafiot commented on July 30, 2024

Just to make sure you use the same path I'd be using (pseudocode):

misp = PyMISP(...)
e = misp.search('foobar')
# delete attributes from e 
misp.add_named_attribute(e, ...)

You're right, all the deleted attributes will be back. I think the easy and clean fix is to set the attributes list to [] in add_named_attribute.

Never mind, this pseudo code should work (https://github.com/MISP/PyMISP/blob/master/pymisp/api.py#L379). How do you delete the attributes?

from pymisp.

mike1703 avatar mike1703 commented on July 30, 2024

I am deleting them with misp.delete_attribute(attribute_id).
The problem is that the following code in _send_attributes just takes your event event = misp.search('foobar'), parses it (so it is based on the event MISP returned to me as a result for the search, adds my new attributes and updates the event. Old attributes are still sent with the event. e.attributes = attributes would be a fix. I just don't know if it will break something else.
https://github.com/MISP/PyMISP/blob/master/pymisp/api.py#L378

e = MISPEvent(self.describe_types)
            e.load(event)
            e.attributes += attributes
            response = self.update_event(event['Event']['id'], json.dumps(e, cls=EncodeUpdate))

from pymisp.

Rafiot avatar Rafiot commented on July 30, 2024

Current master let you mark an attribute as deleted. This is the cleanest way to do it.

Can you give a try and tell me if it is fine for you.

from pymisp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.