Skip to content

Commit ab9b93f

Browse files
committed
fix: [cleanup] minor visual improvements
1 parent bba7e0b commit ab9b93f

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/MISP_maltego/transforms/attributetoevent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717

1818
class SearchInMISP(Transform):
19-
"""Search an attribute, event in MISP, allowing the use of % at the front and end"""
19+
"""Use % at the front/end for wildcard search"""
2020
input_type = Unknown
2121
display_name = 'Search in MISP'
22+
description = "Use % at the front/end for wildcard search"
2223
remote = True
2324

2425
def do_transform(self, request, response, config):
@@ -122,7 +123,7 @@ def do_transform(self, request, response, config):
122123

123124
class AttributeToEvent(Transform):
124125
input_type = Unknown
125-
display_name = 'to MISP Event'
126+
display_name = 'to MISP Events'
126127
remote = True
127128

128129
def do_transform(self, request, response, config):
@@ -161,7 +162,6 @@ def do_transform(self, request, response, config):
161162
tag_name = get_entity_property(request.entity, 'Temp')
162163
if not tag_name:
163164
tag_name = request.entity.value
164-
# TODO convert this to an index search to be much faster
165165
events_json = conn.misp.search_index(tags=tag_name)
166166
for e in events_json:
167167
response += event_to_entity({'Event': e}, link_direction=LinkDirection.OutputToInput)

src/MISP_maltego/transforms/common/util.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import tempfile
1313
import time
1414

15-
# FIXME from galaxy 'to MISP Event' is confusing
16-
1715
__version__ = '1.4.4' # also update version in setup.py
1816

1917
tag_note_prefixes = ['tlp:', 'PAP:', 'de-vs:', 'euci:', 'fr-classif:', 'nato:']
@@ -205,15 +203,15 @@ def attribute_to_entity(a, link_label=None, event_tags=[], only_self=False):
205203

206204
# complement the event tags with the attribute tags.
207205
if 'Tag' in a and not only_self:
208-
for t in a['Tag']:
209-
combined_tags.append(t['name'])
210-
# ignore all misp-galaxies
211-
if t['name'].startswith('misp-galaxy'):
212-
continue
213-
# ignore all those we add as notes
214-
if tag_matches_note_prefix(t['name']):
215-
continue
216-
yield Hashtag(t['name'], bookmark=Bookmark.Green)
206+
for t in a['Tag']:
207+
combined_tags.append(t['name'])
208+
# ignore all misp-galaxies
209+
if t['name'].startswith('misp-galaxy'):
210+
continue
211+
# ignore all those we add as notes
212+
if tag_matches_note_prefix(t['name']):
213+
continue
214+
yield Hashtag(t['name'], bookmark=Bookmark.Green)
217215

218216
notes = convert_tags_to_note(combined_tags)
219217

@@ -251,7 +249,7 @@ def attribute_to_entity(a, link_label=None, event_tags=[], only_self=False):
251249

252250
# not supported in our maltego mapping are not handled
253251

254-
# LATER : relationships from attributes - not yet supported by MISP yet, but there are references in the datamodel
252+
# LATER relationships from attributes - not yet supported by MISP yet, but there are references in the datamodel
255253

256254

257255
def object_to_attributes(o, e):
@@ -293,7 +291,7 @@ def get_attribute_in_object(o, attribute_type=False, attribute_value=False, drop
293291
if drop: # drop the attribute from the object
294292
o['Attribute'].pop(i)
295293
break
296-
# TODO implement substring matching
294+
# substring matching
297295
if substring:
298296
keyword = attribute_value.strip('%')
299297
if attribute_value.startswith('%') and attribute_value.endswith('%'):

0 commit comments

Comments
 (0)