Skip to content

Commit

Permalink
Fix bad related adversary id lookup. Closes #98.
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Feb 7, 2023
1 parent 4da7e7d commit 080cfc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cs_misp_import/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ def add_actor_detail(self, report: dict, event: MISPEvent) -> MISPEvent:
if actor.get('name'):
actor_detail = self.intel_api_client.falcon.get_actor_entities(ids=actor.get("id"))
if actor_detail["status_code"] == 200:
actor_detail = actor_detail["body"]["resources"][0]
try:
actor_detail = actor_detail["body"]["resources"][0]
except TypeError:
# Bad actor id lookup
actor_detail = {}
actor_name = actor.get('name').split(" ")
first = actor_detail.get("first_activity_date", 0)
last = actor_detail.get("last_activity_date", 0)
Expand Down

0 comments on commit 080cfc6

Please sign in to comment.