{{ _('CRITICAL') if profile.risk_score > 0.8 else _('HIGH') if profile.risk_score > 0.5 else _('MEDIUM') }}
{{ _('PROFILE ID') }}
{{ profile.profile_id }}
{{ _('RISK SCORE') }}
{{ "%.0f"|format(profile.risk_score * 100) }}
{{ _('TOOL FINGERPRINT') }}
{{ profile.ua_fingerprint or _('Unknown') }}
{{ _('STATUS') }}
{{ profile.status.upper() }}
{{ _('IP POOL') }}
{{ profile.ip_pool|length }} {{ _('IPs') }}
{{ _('TARGET FILES') }}
{{ profile.target_files|length }}
{{ _('TARGET URLs') }}
{{ profile.target_urls|length }}
{{ _('LAST SEEN') }}
{{ profile.last_seen.strftime('%m-%d %H:%M') if profile.last_seen else _('N/A') }}

{{ _('ATTACK CHAIN') }}

{% if events %}
    {% for evt in events|reverse %}
  1. {{ evt.event_type.upper() }}{{ evt.waf_rule_id or _('detection') }}{{ _('score: ') }}{{ "%.2f"|format(evt.waf_score) }}

    {{ _('IP:') }} {{ evt.src_ip }} {{ _('URL:') }} {{ evt.url[:60] }}

  2. {% endfor %}
{% else %}

{{ _('No attack events recorded yet') }}

{% endif %}
{% if file_clusters %}

{{ _('FILE CLUSTERS') }} ({{ file_clusters|length }})

{% for fc in file_clusters %}
{{ fc.cluster_id[:10] }}{{ fc.cluster_size }} {{ _('files') }}

{{ fc.file[:55] }}

{{ _('Quarantined') if fc.quarantined else _('Active') }}
{% endfor %}
{% endif %} {% if linked_records %}

{{ _('LINKED DETECTION RECORDS') }} ({{ linked_records|length }})

{% for lr in linked_records[:20] %}
{{ lr.display_name }}{{ lr.detected_at }}{% if lr.quarantine_id %}Q{% endif %}{% for feature in lr.features[:2] %}{{ feature[:20] }}{% endfor %}
{% endfor %}
{% endif %}

{{ _('ASSOCIATED IPs') }} ({{ ip_total }})

{{ _('0 selected') }}
{% for ipd in ip_details %}{% endfor %}
{{ _('IP Address') }}{{ _('Events') }}{{ _('WAF Score') }}{{ _('Level') }}{{ _('First Seen') }}{{ _('Last Seen') }}
{{ ipd.ip }}{{ ipd.event_count }}{{ "%.2f"|format(ipd.waf_score_avg) }}{{ ipd.cluster_level }}{{ ipd.first_seen.strftime('%m-%d %H:%M') if ipd.first_seen else _('N/A') }}{{ ipd.last_seen.strftime('%m-%d %H:%M') if ipd.last_seen else _('N/A') }}
{% if ip_total_pages > 1 %}
{{ _('Page') }} {{ ip_page }} / {{ ip_total_pages }}
{% endif %}