mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [hunter + misp export] fix misp event json export + retro hunt date search and description
This commit is contained in:
parent
b4d536f174
commit
d6a24c0357
4 changed files with 13 additions and 4 deletions
|
@ -650,14 +650,14 @@ def get_user_trackers_meta(user_id, tracker_type=None):
|
||||||
metas = []
|
metas = []
|
||||||
for tracker_uuid in get_user_trackers(user_id, tracker_type=tracker_type):
|
for tracker_uuid in get_user_trackers(user_id, tracker_type=tracker_type):
|
||||||
tracker = Tracker(tracker_uuid)
|
tracker = Tracker(tracker_uuid)
|
||||||
metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
metas.append(tracker.get_meta(options={'description', 'mails', 'sparkline', 'tags'}))
|
||||||
return metas
|
return metas
|
||||||
|
|
||||||
def get_global_trackers_meta(tracker_type=None):
|
def get_global_trackers_meta(tracker_type=None):
|
||||||
metas = []
|
metas = []
|
||||||
for tracker_uuid in get_global_trackers(tracker_type=tracker_type):
|
for tracker_uuid in get_global_trackers(tracker_type=tracker_type):
|
||||||
tracker = Tracker(tracker_uuid)
|
tracker = Tracker(tracker_uuid)
|
||||||
metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
metas.append(tracker.get_meta(options={'description', 'mails', 'sparkline', 'tags'}))
|
||||||
return metas
|
return metas
|
||||||
|
|
||||||
def get_users_trackers_meta():
|
def get_users_trackers_meta():
|
||||||
|
|
|
@ -172,7 +172,7 @@ def show_tracker():
|
||||||
typo_squatting = set()
|
typo_squatting = set()
|
||||||
|
|
||||||
if date_from:
|
if date_from:
|
||||||
date_from, date_to = Date.sanitise_daterange(meta['first_seen'], meta['last_seen'])
|
date_from, date_to = Date.sanitise_daterange(date_from, date_to)
|
||||||
objs = tracker.get_objs_by_daterange(date_from, date_to)
|
objs = tracker.get_objs_by_daterange(date_from, date_to)
|
||||||
meta['objs'] = ail_objects.get_objects_meta(objs, flask_context=True)
|
meta['objs'] = ail_objects.get_objects_meta(objs, flask_context=True)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -163,6 +163,7 @@ def objects_misp_export_post():
|
||||||
MISPExporter.delete_user_misp_objects_to_export(user_id)
|
MISPExporter.delete_user_misp_objects_to_export(user_id)
|
||||||
if not export:
|
if not export:
|
||||||
event_uuid = event[10:46]
|
event_uuid = event[10:46]
|
||||||
|
event = f'{{"Event": {event}}}'
|
||||||
# TODO ADD JAVASCRIPT REFRESH PAGE IF RESP == 200
|
# TODO ADD JAVASCRIPT REFRESH PAGE IF RESP == 200
|
||||||
return send_file(io.BytesIO(event.encode()), as_attachment=True,
|
return send_file(io.BytesIO(event.encode()), as_attachment=True,
|
||||||
download_name=f'ail_export_{event_uuid}.json')
|
download_name=f'ail_export_{event_uuid}.json')
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
<th>Tracker</th>
|
<th>Tracker</th>
|
||||||
<th>First seen</th>
|
<th>First seen</th>
|
||||||
<th>Last seen</th>
|
<th>Last seen</th>
|
||||||
<th>Email notification</th>
|
<th>Emails</th>
|
||||||
<th>sparkline</th>
|
<th>sparkline</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -80,6 +80,10 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
{% if dict_uuid['description'] %}
|
||||||
|
<div><i>{{ dict_uuid['description'] }}</i></div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{% for tag in dict_uuid['tags'] %}
|
{% for tag in dict_uuid['tags'] %}
|
||||||
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
||||||
|
@ -145,6 +149,10 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
{% if dict_uuid['description'] %}
|
||||||
|
<div><i>{{ dict_uuid['description'] }}</i></div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{% for tag in dict_uuid['tags'] %}
|
{% for tag in dict_uuid['tags'] %}
|
||||||
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item<ags={{ tag }}">
|
||||||
|
|
Loading…
Reference in a new issue