{% extends "base.html" %} {% set active_page = "Info" %} {% block head %} {% endblock %} {% macro mem_label(component) %} {{ component['system']['memory_used'] | number_format }} / {{ component['system']['memory_total'] | number_format }} {% endmacro %} {% macro disk_label(component) %} {{ component['system']['disk_used'] | number_format }} / {{ component['system']['disk_total'] | number_format }} {% endmacro %} {% macro icon_tooltip_desk(icon, tooltip, icon_class=None) %} {% set icon_class = icon_class if icon_class else 'fas' %} {% endmacro %} {% macro component_card(component, backend=False) %}
{{ component['name'] }} status
{{ component['status'] }}
{{ icon_tooltip_desk('linux', 'Operating system', icon_class='fab') }} {{ icon_tooltip_desk('python', 'Python version', icon_class='fab') }} {{ icon_tooltip_desk('code-branch', 'FACT version') }} {{ icon_tooltip_desk('microchip', 'CPU status') }} {{ icon_tooltip_desk('memory', 'Memory status') }} {{ icon_tooltip_desk('hdd', 'Disk status') }} {% if backend %} {% set unpacking_class = "text-warning" if component['unpacking']['unpacking_queue'] > 500 else "" %} {{ icon_tooltip_desk('box-open', 'Pending items for extraction') }} {% endif %}
{{ component['platform']['os'] }}{{ component['platform']['python'] }}{{ component['platform']['fact_version'] }}
{{ component['system']['cpu_cores'] }} cores ({{ component['system']['virtual_cpu_cores'] }} threads) @ {{ component['system']['cpu_percentage'] | nice_number }}%
{% if component['system']['memory_percent'] >= 50.0 %}{{ mem_label(component) }}{% endif %}
  {% if component['system']['memory_percent'] < 50.0 %}{{ mem_label(component) }}{% endif %}
{% if component['system']['disk_percent'] >= 50.0 %}{{ disk_label(component) }}{% endif %}
  {% if component['system']['disk_percent'] < 50.0 %}{{ disk_label(component) }}{% endif %}
{{ component['unpacking']['unpacking_queue'] | nice_number }}
{% endmacro %} {% macro plugin_card(plugin_name, plugin_data) %} {% set description, _, __, version, dependencies, blacklist, whitelist, threads = analysis_plugin_info[plugin_name] %}
{{ plugin_name }}
{{ version }}
{{ icon_tooltip_desk('align-justify', 'Concurrent threads') }}
{{ threads }} {% set span_class = " fa-spin" if plugin_data['active'] else "" %} {% set span_style = "color: green" if plugin_data['active'] else "color: darkgrey" %} {% set span_style = "color: yellow" if plugin_data.queue > 150 else span_style %} {{ plugin_data.active | nice_number }} {% set span_style = "color: black" if plugin_data['queue'] else "color: darkgrey" %} {{ plugin_data.queue | nice_number }}
{{ description }} {{ icon_tooltip_desk('project-diagram', 'Plugin dependecies') }} {{ icon_tooltip_desk('flag', 'Blacklisted file types') }} {{ icon_tooltip_desk('flag', 'Whitelisted file types', icon_class='far') }}
{{ dependencies | list_group_collapse | safe}}
{{ blacklist | list_group_collapse | safe }}
{{ whitelist | list_group_collapse | safe }}
{% set button_id = "bt-" + plugin_name %}
{% endmacro %} {% block body %}
{% for component in status %} {% if component and component['platform'] and component['system'] %} {{ component_card(component, backend=component['analysis']) }} {% endif %} {% endfor %}
{% for component in status %} {% if component and component['analysis'] %} {% set current_analyses = component['analysis']['current_analyses'] %} {% set recently_finished_analyses = component['analysis']['recently_finished_analyses'] %} {% if current_analyses or recently_finished_analyses %}
Currently analyzed firmware
{% for firmware_uid, data in current_analyses.items() %}
{{ firmware_uid | replace_uid_with_hid | safe }}
{% set current_analysis_progress = data.analyzed_count / data.total_count %}
{% if current_analysis_progress >= 0.5 %} {{ data.analyzed_count }} / {{ data.total_count }} (Elapsed: {{ data.start_time | remaining_time | format_duration }}) {% endif %}
{% set current_unpacking_progress = (data.unpacked_count - data.analyzed_count) / data.total_count %}
{% if current_analysis_progress < 0.5 %}
{{ data.analyzed_count }} / {{ data.total_count }} (Elapsed: {{ data.start_time | remaining_time | format_duration }})
{% endif %}
{% endfor %} {% for firmware_uid, data in recently_finished_analyses.items() %}
{{ firmware_uid | replace_uid_with_hid | safe }}
{{ data.total_files_count }} / {{ data.total_files_count }} (Finished in: {{ data.duration | round(0) | int | format_duration }})
{% endfor %}
{% endif %} {% endif %} {% endfor %} {% for component in status %} {% if component and component['analysis'] %}
Analysis Plugins
{% for plugin_name, plugin_data in component['analysis']['plugins'].items() | sort %} {% if "dummy" not in plugin_name %} {# {% if plugin != "analysis_main_scheduler" %} #} {{ plugin_card(plugin_name, plugin_data) }} {% endif %} {% endfor %}
{% endif %} {% endfor %} {% endblock %}