{% extends "_layout.html" %} {% block content %}
{%- if not unauth %} {%- endif %}

{{ hawat_current_view.get_view_title() }}


{{ item.label }} {{ macros_site.render_report_label_type(item) }} {{ macros_site.render_report_label_severity(item) }} {{ macros_site.render_report_label_weight(item) }} {%- if item.evcount_flt_blk %} {{ get_icon('report-data-filtered') }} {%- endif %} {%- if item.evcount_rlp %} {{ get_icon('report-data-relapsed') }} {%- endif %} {%- if item.flag_testdata %} {{ get_icon('report-data-test') }} {%- endif %} {%- if item.flag_mailed %} {{ get_icon('report-data-mailed') }} {%- endif %}

{%- if item.flag_testdata %} {%- call macros_site.render_alert('info', False, 'debug') %} {{ _('This report was generated from test data.') }} {%- endcall %} {%- endif %} {%- if not current_user.is_authenticated %} {%- call macros_site.render_alert('warning', False) %} {{ _('You are currently viewing this report in unauthenticated mode. Please be aware, that additional functions are available only to authenticated users. Please login or register new account to use them.') }} {%- endcall %} {%- endif %}

{{ _('Target abuse group') }}: {%- for group in item.groups %} {%- if not unauth %} {%- if loop.index != 1 %},{%- endif %} {{ group.name }} {%- else %} {%- if loop.index != 1 %},{%- endif %} {{ group.name }} {%- endif %} {%- endfor %}

{%- if current_user.is_authenticated and item.parent %}

{{ _('Parent summary report') }}: {{ item.parent.label }}

{%- endif %}

{{ _('Unprotected access link') }}: {{ item.label }}

{{ macros_page.render_menu_actions(item) }}

{{ _('Report created') }}: {{ babel_format_datetime(item.createtime) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - item.createtime)) }})  |  {{ _('Report window') }}: {{ babel_format_datetime(item.dt_from) }} - {{ babel_format_datetime(item.dt_to) }} ({{ babel_format_timedelta(item.delta) }})  |  {{ _('Report mailed') }}: {% if item.flag_mailed %}{{ babel_format_datetime(item.mail_dt) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - item.mail_dt)) }}){% else %}{{ _('never')}}{% endif %}


{%- if item.structured_data -%} {%- import '_macros.common.txt.j2' as macros_common -%} {%- set default_info = load_json_from_file(event_classes_dir + "/" + template_vars['default_event_class'] + "/info.json") -%} {%- from template_vars['default_event_class'] + "/hawat.j2" import header as default_header with context -%} {%- from template_vars['default_event_class'] + "/hawat.j2" import row as default_row with context -%} {%- macro render_report_section(section_number, section_name, section_data, type) %} {% if check_file_exists(event_classes_dir + "/" + section_name + "/info.json") %} {% set info = load_json_from_file(event_classes_dir + "/" + section_name + "/info.json") %} {% for key in ['label', 'reference'] %} {% if info[key] is undefined %} {% set tmp = info.__setitem__(key, default_info[key]) %} {% endif %} {% endfor %} {% else %} {% set info = default_info %} {% endif %}
{{ '[' ~ section_number ~ '] ' ~ _(info['label']) }}
{% if check_file_exists(event_classes_dir + "/" + section_name + "/hawat.j2") %} {% from section_name + "/hawat.j2" import header, row with context %} {% endif %} {%- set table_id = section_name + '-' + type %} {% if header is undefined %} {% set header = default_header %} {% endif %} {{ header(section_data, template_vars['default_event_class']) }} {%- if current_user.is_authenticated %} {%- endif %} {% if row is undefined %} {% set row = default_row %} {% endif %} {%- for ip in section_data | dictsort %} {% set id = section_name + '-' + ip[0] %} {{ row(ip[0], ip[1], current_user.is_authenticated, template_vars['default_event_class']) }} {%- if current_user.is_authenticated %} {%- endif %} {%- endfor %} {%- if current_user.is_authenticated %} {%- for ip in section_data | dictsort %} {% set id = section_name + '-' + ip[0] %} {%- endfor %} {%- endif %} {% if info['reference'] %}
{{ _('More information:') }} {{ _(info['reference']) }}
{% endif %}
{%- endmacro -%}
{{ _('Dear colleagues.') }}
{%- if item.structured_data['regular'] -%} {%- if item.type == 'summary' %}
{{ _('Our detection systems registered following possible problem(s) related to Your IP address range or domain (timestamps are in timezone {:s}):').format(item.structured_data['timezone']) }}
{% else %}
{{ _('Our detection systems registered following possible problem(s) related to host {:s}, that appears to belong to Your IP address range or domain (timestamps are in timezone {:s}):').format(item.structured_data['regular'].values() | list | first | first, item.structured_data['timezone']) }}
{% endif -%} {%- for section_name, section_data in item.structured_data['regular'] | dictsort %} {{ render_report_section(loop.index, section_name, section_data, 'regular') }} {% endfor -%} {%- endif %} {%- if item.structured_data['relapsed'] -%} {%- if item.type == 'summary' %}
{{ _('Our detection systems registered following RECURRING possible problem(s) related to Your IP address range or domain (timestamps are in timezone {:s}):').format(item.structured_data['timezone']) }}
{% else %}
{{ _('Our detection systems registered following RECURRING possible problem(s) related to host {:s}, that appears belong to Your IP address range or domain (timestamps are in timezone {:s}):').format(item.structured_data['relapsed'].values() | list | first | first, item.structured_data['timezone']) }}
{% endif -%} {% for section_name, section_data in item.structured_data['relapsed'] | dictsort %} {{ render_report_section(loop.index, section_name, section_data, 'relapsed') }} {% endfor %}
{{ _('These possible problem(s) were already reported to You some time before, however we have detected relapses.') }}
{% endif -%}
{{ macros_common.render_info_severity(item) }}
{%- if item.type == 'extra' %}
{{ _('This report contains fraction of data from parent summary report [{:s}], that is also available in HTML format at:').format(item.parent.label) }}
{% endif %}
{{ _('Attachment files containing complete information available for each event can be downloaded above message in JSON format.') }}
{% autoescape false %}
{{ _('This message was generated by an automated system. For further communication please use the contact email address <{:s}> and for easier orientation please keep the identifier [{:s}] in email subject.').format("{:s}", item.label).format(template_vars['contact_email'], item.label, template_vars['contact_email']) }}
{% endautoescape %}
{{ _('Thank you in advance for your cooperation') }}
{{ _('Mentat System') }} ({{ _('https://csirt.cesnet.cz/en/services/mentat') }})
{{ _('CESNET-CERTS Computer Security Team') }} <certs@cesnet.cz> ({{ _('https://csirt.cesnet.cz/en/index') }})
{{ _('CESNET, a.l.e.') }} ({{ _('http://www.ces.net/') }})
{% else %} {{ item.message | replace("&", "&") | replace("<", "<") | replace(">", ">") | replace("\n", "
\n") | replace(' ', ' ') | replace("\t", '    ') | safe }}
{% endif %}

{{ _('Type') }}: {{ macros_site.render_report_label_type(item, True) }}
{{ _('Severity') }}: {{ macros_site.render_report_label_severity(item, True) }}
{{ _('Report window') }}: {{ babel_format_datetime(item.dt_from) }} - {{ babel_format_datetime(item.dt_to) }} ({{ babel_format_timedelta(item.delta) }})
{{ _('Report delay') }}: {{ babel_format_timedelta(item.createtime - item.dt_to) }}
{{ _('Event count') }}: {%- if item.type == 'summary': %}
{%- if item.evcount_thr %}
{{ item.evcount_thr }} {{ _('new events')}}
{%- endif %} {%- if item.evcount_rlp %}
{{ item.evcount_rlp }} {{ _('relapsed')}}
{%- endif %}
{%- else %}
{{ item.evcount_rep }} {{ _('reported events')}}
{%- endif %} {{ item.evcount_rep }} ({{ babel_format_percent(item.evcount_rep / item.evcount_all) }}) {{ _('reported') }}{% if item.type == 'summary' %}, {{ item.evcount_all }} ({{ babel_format_percent(item.evcount_all / item.evcount_all) }}) {{ _('matched') }}, {{ item.evcount_new }} ({{ babel_format_percent(item.evcount_new / item.evcount_all) }}) {{ _('new events') }}, {{ item.evcount_flt_blk }} ({{ babel_format_percent(item.evcount_flt_blk / item.evcount_all) }}) {{ _('filtered out') }}, {{ item.evcount_thr_blk }} ({{ babel_format_percent(item.evcount_thr_blk / item.evcount_all) }}) {{ _('thresholded') }}, {{ item.evcount_rlp }} ({{ babel_format_percent(item.evcount_rlp / item.evcount_all) }}) {{ _('relapsed') }}{% else %}, {{ item.evcount_all }} {{ _('total in parent summary report') }}{%- endif %}
{{ _('IP address count') }}: {{ statistics['ips'] | count }}
{{ _('Target mails') }}: {%- if item.flag_mailed %} {% if item.mail_to %} {% if to_mails %} to: {{ to_mails | join(', ') }}, {% endif%} {% if cc_mails %} cc: {{ cc_mails | join(', ') }}, {% endif%} {% endif %} {{ babel_format_datetime(item.mail_dt) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - item.mail_dt)) }}) {%- else %} {{ _('report was not sent')}} {%- endif %}
{{ _('Filtering') }}: {%- if item.filtering %} {%- if item.filtering is mapping %} {%- for subitem in item.filtering | dictsort %} {{ subitem[0] }} {{ subitem[1] }}{% if not loop.last %}
{% endif %} {%- endfor %} {%- else %} {%- for subitem in item.filtering %} {{ subitem[0] }} {{ subitem[1] }}{% if not loop.last %}
{% endif %} {%- endfor %} {%- endif %} {%- else %} {{ _('no filters matched')}} {%- endif %}

{{ macros_chart.render_dashboard_panels( statistics, 'search_result_statistics', 'report-stats', hide_sections = ['abuses'], active_first = True, cfg_params = { 'kwargs': { 'dt_from': item.dt_from, 'dt_to': item.dt_to, 'groups': item.groups | map(attribute = "name") | join(", ") } } ) }}

{%- if permission_can('developer') %}
{{ macros_site.render_raw_var('item', item) }} {{ macros_site.render_raw_var('statistics', statistics) }} {{ macros_site.render_raw_var('filtering', item.filtering) }} {%- endif %} {%- endblock content %} {%- block bodyjs %} {{ super() }} {%- endblock bodyjs %}