{% 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') }}: {%- if not unauth %} {{ item.group.name }} {%- else %} {{ item.group.name }} {%- endif %}

{%- 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 '_report.labels.txt.j2' as labels %} {% import '_report.references.txt.j2' as references %} {% import '_macros.common.txt.j2' as macros_common %} {%- macro render_report_section(section_number, section_name, section_data) %}
{{ '[' ~ section_number ~ '] ' ~ labels.render_section_label(section_name, none) }}
{%- if current_user.is_authenticated %} {%- endif %} {%- for ip in section_data | dictsort %} {% set id = section_name + '-' + ip[0] %} {%- if current_user.is_authenticated %} {%- endif %} {%- if current_user.is_authenticated %} {%- endif %} {%- endfor %}
{{ _('Source') }} {{ _('First event time') }} {{ _('Last event time') }} {{ _('Count') }} {{ _('Protocol') }}{{ _('Feedback') }}
{%- if current_user.is_authenticated %} {{ macros_site.render_widget_csag_address([ip[0]]) }} {%- else %} {{ ip[0] }} {%- endif %} {{ format_datetime(ip[1]['first_time'], tz) }} {{ format_datetime(ip[1]['last_time'], tz) }} {{ ip[1]['count'] }} {% if ip[1]['ports'] %}{{ ', '.join(ip[1]['ports']) }}{% else %}---{% endif %}
{{ references.render_section_reference(section_name, html=True) }}
{%- 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) }} {% 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) }} {% 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) }}
{{ _('This report is also available in HTML format at:') }}
{%- 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 and CSV 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 mail') }}: {%- if item.flag_mailed %} {% if item.mail_to %}{{ item.mail_to | join(', ') }}, {% endif %}{{ babel_format_datetime(item.mail_dt) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - item.mail_dt)) }}) {%- else %} {{ _('never')}} {%- 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.group.name } } ) }}

{%- 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 %}