{# Hani #1 2026-10-25: Security events per device - the same categories and blocking as Settings › Security events. #} {% set ev = sec.events %} {% import "_ai_analysis.html" as ai with context %}{% set AI = ai_analysis((ev.top or [])|map(attribute='address')|list) if ev else {} %}{% set AIR = ai_ready() %}{% set RC = rule_coverage((ev.top or [])|map(attribute='address')|list) if ev else {} %}{% set ADS = ai_defence_status((ev.top or [])|map(attribute='address')|list) if ev else {} %} {% if not ev %}

Security events are not available on this Portal.

{% else %}
{% for kind in ('probe', 'not_found', 'denied', 'error') %}

{{ {'probe': 'Probes (scans, injection attempts)', 'not_found': 'Unknown pages', 'denied': 'Refused', 'error': 'Server errors'}[kind] }}

{{ ev.counts.get(kind, 0) }}

{% endfor %}

Firewall log lines

{{ ev.firewall_total }}{% if (ev.firewall_meta or {}).capped %}+{% endif %}

A web server's visitors come from its access log (Tools › Logs); the firewall's addresses from the device's own log (MikroTik: log the drop rules you want to see). Block refuses the address on this Portal and, through Blocked addresses › routers, at the routers for the whole ecosystem.

{# Hani #1 2026-11-01: one Security tab for every device - both address tables select into one bar with the same actions as Settings › Security events; addresses on private networks (the Portal itself, its hosts) cannot be selected. #} {% if ev.top or ev.firewall %}
Select addresses in either table to act on several at once. {{ fresh_tag("security:device-tab-bulk") }} {{ ai.bulk_button(AIR) }}
{% endif %}

Suspicious visitors {{ fresh_tag("security:journal-web") }}{{ fresh_tag("security:table-fits") }}

{{ ai.watcher(AI) }} {% if ev.top %}
{{ ai.headers() }}{{ ai.rule_header() }} {% for t in ev.top %}{{ ai.cells(AI.get(t.address), t.address, 'dev-' ~ loop.index) }}{{ ai.rule_cell(RC.get(t.address), t.address, ADS.get(t.address)) }}{% endfor %}
AddressCountryRequestsLast (UTC)Actions
{{ t.address }}{{ (t.place|country) if t.place else '—' }}{{ t.n }}{% if t.probes %}
{{ t.probes }} probe{{ '' if t.probes == 1 else 's' }}{% endif %}
{{ (t.last or '')[:16]|replace('T', ' ') }} {% if t.blocked %}Blocked {% endif %}
Actions ▾
{% if not address_private(t.address) %}{% endif %} {{ ai.button(t.address, AIR, 'asset:' ~ inventory.asset.id) }}
{{ ai.dialog(AI.get(t.address), t.address, 'dev-' ~ loop.index) }} {% with row=t, dialog_id='dlg-dev-' ~ loop.index, dialog_from='asset:' ~ inventory.asset.id %}{% include "_address_actions_dialog.html" %}{% endwith %}
{% else %}

No suspicious visitor in this period.

{% endif %}

{{ fresh_tag("security:port-names") }}{{ fresh_tag("security:firewall-count-lane") }}{{ fresh_tag("security:firewall-speed") }}Addresses in the firewall log Addresses this device's firewall dropped or logged (its own firewall log). Suspicious visitors above are web requests and sign-ins to this device; an address can be in one list and not the other.

{% if ev.firewall_error %}
{{ ev.firewall_error }}
{% endif %} {% if ev.firewall %}
{% set AIF = ai_analysis(ev.firewall|map(attribute='address')|list) %}{% set HOF = half_open_of(ev.firewall|selectattr('private')|map(attribute='address')|list) if half_open_of is defined else {} %}{% for f in ev.firewall %}{% endfor %}
AddressCountryLog linesPortsActions
{% if not f.private %}{% endif %}{{ f.address }}{{ ai.inline(AIF.get(f.address), f.address) }}{% set ho = HOF.get(f.address) %}{% if ho %}
{{ fresh_tag("security:half-open") }}{{ ho.peers }} outside addresses never answeredMost of these lines are this server's own answers to {{ ho.peers }} outside addresses in {{ ho.networks }} network{{ '' if ho.networks == 1 else 's' }} that asked to connect and never answered back (a SYN flood, a half-open scan or faked senders). The router drops the repeated answers as "invalid". {% if ho.waiting %}{{ ho.waiting }} network block{{ '' if ho.waiting == 1 else 's' }} wait{{ 's' if ho.waiting == 1 else '' }} for your approval under Settings › Rules › Waiting for approval.{% else %}A network is proposed for blocking when 10 or more of its addresses do this.{% endif %}{% endif %}
{{ (f.place|country) if f.place else '—' }}{{ f.n }}{{ f.ports or '—' }} {% if f.blocked %}Blocked {% endif %}
Actions ▾
{% if not f.private %}{% endif %} {% if not f.private %}{{ ai.button(f.address, AIR, 'asset:' ~ inventory.asset.id) }}{% else %}{% endif %}
{% if not f.private %}{% with row=f, dialog_id='dlg-fw-' ~ loop.index, dialog_from='asset:' ~ inventory.asset.id %}{% include "_address_actions_dialog.html" %}{% endwith %}{% else %}

{{ fresh_tag("security:own-delete-lines") }}Delete the log lines of {{ f.address }}

Removes its {{ f.n }} stored line{{ '' if f.n == 1 else 's' }} on this device. It cannot be undone.

{{ f.address }} is one of your own addresses, so it is never blocked. Its firewall lines on this device are deleted on this Portal and on the data server (also those before this period). Nothing else changes.
{% endif %}
{% set fm = ev.firewall_meta or {} %}

The busiest {{ ev.firewall|length }} address{{ '' if ev.firewall|length == 1 else 'es' }} of the period{% if fm.more %} - there are more{% endif %}; click a heading to sort them.{% if fm.more and fm.top < 500 %} Show {{ 100 if fm.top < 100 else 500 }}{% endif %}

{% for lbl, text in (ev.firewall_meta or {}).get('advice', []) %}

{{ lbl }}: {{ text }}

{% endfor %} {% if (ev.firewall_meta or {}).timings %}

{% if ev.firewall_meta.capped %}Counted over the newest {{ ev.firewall_meta.cap }} firewall lines of the period · {% endif %}Read in {% for k, t in ev.firewall_meta.timings.items() %}{{ t }} s {{ {'portal': 'on this Portal', 'data_server': 'on the data server', 'data_server_gave_up': 'waited for the data server, then gave up'}[k] }}{% if not loop.last %}, {% endif %}{% endfor %}

{% endif %} {% else %}

No firewall log line with an address in this period.

{% endif %}
Latest events {% if ev.recent %}
{% for e in ev.recent %}{% endfor %}
Time (UTC)EventAddressRequestResult
{{ e.at[:19]|replace('T', ' ') }}{{ {'probe': 'Probe', 'not_found': 'Unknown page', 'denied': 'Refused', 'error': 'Server error'}.get(e.kind, e.kind) }}{{ e.address or '' }}{% if e.blocked %} Blocked{% endif %}{{ e.method or '' }} {{ e.path or '' }}{{ e.status or '' }}
{% else %}

None in this period.

{% endif %}

Log messages

Loading…

{% endif %}