Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

howto add galaxy and/or cluster to event or attribute #2

Closed
github-germ opened this issue Sep 14, 2018 · 12 comments
Closed

howto add galaxy and/or cluster to event or attribute #2

github-germ opened this issue Sep 14, 2018 · 12 comments

Comments

@github-germ
Copy link

Hi, is there a method with PyMISP to add a pre-existing galaxy and/or galaxy-cluster to an event or attribute?

I did see mention in #1 re' creating galaxies and clusters. I might be interested in that also. Wasn't sure how I'd do that from a python client when you say to use the JSON file.

Thanks!

@Rafiot
Copy link
Member

Rafiot commented Sep 14, 2018

Add the tag representing the galaxy, MISP will do the rest

@dieee
Copy link

dieee commented Nov 8, 2019

UPDATE GALAXY FROM MISP TO MISP

Hello everyone. I am trying to update a galaxy that has an attribute in another misp. In the other misp there is the attribute but it does not have the updated "galaxy"

update_attribute with "attr['Galaxy']" in a for bucle, no update the Galaxy in the attribute. Only update this fields "{'Attribute': {'id': '', 'event_id': '', 'object_id': '0', 'object_relation': None, 'category': 'Network activity', 'type': 'domain', 'to_ids': True, 'uuid': '', 'timestamp': '', 'distribution': '', 'sharing_group_id': '0', 'comment': '', 'deleted': False, 'disable_correlation': False, 'value': ''}}"
How can I update a galaxy of a specific attribute? (I pick up from another misp) .My example:

`for a in atributesOtherMisp:

 for b in atributesMisp:
   if b['uuid'] == a['uuid']:
    if b['comment'] != a['comment']:
      ExpandedPymispObject.update_attribute('uuid':a['uuid'] ....  'Galaxy':a['Galaxy'])`


The comment is updated. The Galaxy does not
What is the way to do it?
Many Thanks

@Rafiot
Copy link
Member

Rafiot commented Nov 9, 2019

Try to use the add_tag method instead, with the name in that format: misp-galaxy:Ransomware="CryptoWall", that should work.

@dieee
Copy link

dieee commented Nov 11, 2019

Hi thank for the reply :)
But that "add a tag to misp" or "add tag to event". I want to add the tag to the specific attribute. I tried with "tag" and "add_tag" and still not working.
With tag:
{'errors': (403, {'name': 'Could not attachTagToObject Tag', 'message': 'Could not attachTagToObject Tag', 'url': '/tags/attachTagToObject', 'errors': 'Failed to attach tag to object.'})}
With add_tag:
add/tag to MISP no to attribute

@Rafiot
Copy link
Member

Rafiot commented Nov 11, 2019

You will have to show me the code, because both methods work in the test cases (https://github.com/MISP/PyMISP/blob/master/tests/testlive_comprehensive.py).

@dieee
Copy link

dieee commented Nov 11, 2019

Now It works! but with the function 'tag':
for at in attribute1['Tag']: mispObject.tag(attribute2['uuid'],at['name'])

I'm going to look this test cases. Thanks a lot!

@Rafiot
Copy link
Member

Rafiot commented Nov 11, 2019

Objects don't have tags currently. You can either tag an event, or an attribute (or an object attribute), but not the object itself.

@Sashaank
Copy link

@Rafiot Hey Raphaël, can objects not be tagged still? What's the way to tag an object attribute? Like the src or dst IP for e.g.

@Rafiot
Copy link
Member

Rafiot commented Aug 29, 2023

objects cannot be tagged.

For tagging an attribute inside an object, it is explained above.

@Sashaank
Copy link

@Rafiot and an event is tagged like this right?
event.add_tag("misp-galaxy:mitre-attack-pattern='ABC')
It doesn't seem to work unfortunately

@Rafiot
Copy link
Member

Rafiot commented Aug 29, 2023

It depends what event is there (a MISPEvent, or a PyMISP instance). If it is a MISPEvent, you then need to update the event on the MISP Instance using the update_event method.

Regardless, please open a new issue in the PyMISP repository with a complete code sample, it will be easier than handling it in a closed and unrelated issue.

@Sashaank
Copy link

@Rafiot thank you very much for your quick responses, it seems to work somehow now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants