Skip to content

Commit

Permalink
Allow the import of actors from Threatr
Browse files Browse the repository at this point in the history
  • Loading branch information
U039b committed Sep 22, 2024
1 parent 15b29a5 commit 8730207
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion colander/core/rest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Observable,
ObservableType,
Threat,
ThreatType, Device, DeviceType,
ThreatType, Device, DeviceType, Actor, ActorType,
)
from colander.core.rest.serializers import DetailedEntitySerializer

Expand Down Expand Up @@ -114,6 +114,11 @@ def get_threatr_entity_type(entity):
return Threat, ThreatType.objects.get(short_name=entity['type']['short_name'])
except Exception:
return None, None
if entity['super_type']['short_name'] == 'ACTOR':
try:
return Actor, ActorType.objects.get(short_name=entity['type']['short_name'])
except Exception:
return None, None
if entity['super_type']['short_name'] == 'EVENT':
try:
return Event, EventType.objects.get(short_name=entity['type']['short_name'])
Expand Down
2 changes: 1 addition & 1 deletion colander/core/views/investigate_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def investigate_search_view(request):
'external_doc': 0,
},
# ToDo: get rid of the hardcoded list of types
'importable_types': ['OBSERVABLE', 'DEVICE', 'THREAT'],
'importable_types': ['OBSERVABLE', 'DEVICE', 'THREAT', 'ACTOR'],
'types': {
}
}
Expand Down

0 comments on commit 8730207

Please sign in to comment.