{# Dark mode variant of compliance report. Filename: report_dark.html.j2 #}
{# ===== Title Card ===== #}
{{ title }}
Generated: {{ generated }}
{# ===== Summary Bar ===== #}
Total hosts: {{ total_hosts }}   Matching expected: {{ ok_hosts }}   With issues: {{ hosts_with_issues|length }}
{% if not only_issues and ok_hosts == total_hosts and total_hosts > 0 %}
All hosts matched expected ports.
{% endif %} {% if only_issues and hosts_with_issues|length == 0 %}
No hosts with issues found. ✅
{% endif %} {# ===== Host Sections ===== #} {% for ip_key, r in reports|dictsort %} {% set has_issues = r.unexpected_tcp or r.missing_tcp or r.unexpected_udp or r.missing_udp %} {% set hr = host_results_by_ip.get(ip_key) %} {% set header_title = ip_key ~ ((' (' ~ hr.host ~ ')') if hr and hr.host else '') %} {% if has_issues %} {% macro delta_row(label, ports) -%} {%- endmacro %} {{ delta_row('Unexpected TCP open ports', r.unexpected_tcp) }} {{ delta_row('Expected TCP ports not seen', r.missing_tcp) }} {{ delta_row('Unexpected UDP open ports', r.unexpected_udp) }} {{ delta_row('Expected UDP ports not seen', r.missing_udp) }} {% if hr and hr.ports %} {# Track visible rows after filtering (e.g., skip closed UDP) #} {% set ns = namespace(visible_rows=0) %} {% for p in hr.ports %} {# --- Normalize helpers --- #} {% set proto = (p.protocol|string|lower) %} {% set state = (p.state|string|lower) %} {# --- Skip rule: hide UDP rows that are "closed" (substring match) --- #} {% set skip_row = (proto == 'udp' and ('closed' in state)) %} {# --- Expectation labeling --- #} {% set is_tcp = (proto == 'tcp') %} {% set is_udp = (proto == 'udp') %} {% set is_open = ('open' in state) %} {% set is_issue = (is_open and ( (is_tcp and (p.port in (r.unexpected_tcp or []))) or (is_udp and (p.port in (r.unexpected_udp or []))) )) %} {% set expectation_badge = ( badge('Issue', '#ef4444') if is_issue else (badge('Expected', '#16a34a') if is_open else '') ) %} {% if not skip_row %} {% set ns.visible_rows = ns.visible_rows + 1 %} {% endif %} {% endfor %} {% if ns.visible_rows == 0 %} {% endif %} {% else %} {% endif %} {% else %} {# Host has no issues #} {% endif %}
{{ header_title }} {% if has_issues %} {{ badge('ISSUES', '#ef4444') }} {% else %} {{ badge('OK', '#16a34a') }} {% endif %}
{{ badge('ISSUES', '#ef4444') }}
{{ label }}: {{ fmt_ports(ports) }}
Discovered Ports
Protocol Port State Service Expectation
{{ pill_proto(p.protocol) }} {{ p.port }} {{ pill_state(p.state) }} {{ p.service or '-' }} {{ expectation_badge | safe }}
No per-port details to display after filtering closed UDP results.
No per-port details available for this host.
{{ badge('OK', '#16a34a') }}   Matches expected ports.
{% endfor %}
Report generated by mass-scan-v2 • {{ generated }}