MISP / MISP/PyMISP

Updating event and adding attributes

Open
#814 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
491
Forks
290
Avg merge
2d 8h
Merged PRs (30d)
3

Description

I'm trying to update an event by adding new attributes to it, I tried to use the full complete example, available in the repository, but it has an error and even after some readings and examples found, it still isn't working correctly.

  misp = ExpandedPyMISP(urlEventsSearch, apikey, False)


    event = misp.get_event('1513')
    
    #try with a string
    event.add_attribute('test','teste.com')
    #try with a urls list
    event.add_attribute('url', listOfUrls)
    
    misp.update_event(event,event.id)

I used ExpandedMisp to add an attribute and update the event, but it shows the error:

event.add_attribute('url', listOfUrls) AttributeError: 'dict' object has no attribute 'add_attribute'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository's full complete example and trace the value returned by ExpandedPyMISP.get_event('1513') before the call to add_attribute. Compare that result with the expected event object and verify the event update path; done means the example can add the requested attributes and update the event without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.