mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-21 07:41:28 +02:00
The first cut was rejected outright, and fairly. Four things were wrong. The running head and foot sat 1.4mm from the physical sheet: vertical-align:top on the @top-* margin boxes pins text to the paper, not to the text block. They now hang off the block with RUNNING_CLEAR of air on the inside edge. Severity was five saturated hues, restated by every theme and slightly different in each. It is now one reserved ramp defined once, light rather than heavy, with lightness carrying the rank so it survives deuteranopia; it clears the CVD and normal-vision floors all-pairs on white paper. A dark page picks up the dark restep automatically, so a dark theme carries no severity block at all. shared/utils/color.py converts through OKLCH, so a theme names one colour and the document derives the wash a badge sits on and the ink that sits on the wash — every badge clears 7:1, including one from a theme a user uploads. Badges are pills, never saturated slabs, and never inline-flex, which WeasyPrint lays out as a block so the badge stretched its whole column. Mono is for machine values now — hostnames, evidence, hashes. Labels, table headers and the running head are the body face, and uppercase_labels finally does something: the CSS had hard-coded uppercase and ignored the token. Prose fills the text column, justified and hyphenated, instead of sitting in a narrow measure with dead space beside it. Chapters still start a new page, but a document may now ask them to run on, and the page estimate knows the difference: 52 pages against 52, and 48 against 48. Two defects the redesign surfaced: the risk summary never passed the variables its own template reads, so that severity table had always printed empty; and the standalone HTML export had no margins at all, because @page geometry does not apply on screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AW5pitnosX8LEFEYxH8gFS
49 lines
2.7 KiB
HTML
49 lines
2.7 KiB
HTML
{% import 'macros.html' as m with context %}
|
|
<p class="block muted small">{{ ctx.data.service_rows|length|num }} services answered on {{ addresses|num }} addresses. {{ web|num }} of them speak HTTP.{% if sensitive %} {{ sensitive|num }} are of a kind that normally belongs on a private network.{% endif %}</p>
|
|
|
|
{% if classes %}
|
|
<div class="sub">
|
|
<div class="label block">What is listening</div>
|
|
{% set items = [] %}
|
|
{% for row in classes %}{% set _ = items.append(Slice(row.label, row.count, ctx.hue(loop.index0))) %}{% endfor %}
|
|
{{ stack_bar(items)|safe }}
|
|
<div class="chips" style="margin-top:1.6mm">
|
|
{% for row in classes %}<span class="chip"><span style="display:inline-block;width:6px;height:6px;border-radius:2px;background:{{ ctx.hue(loop.index0) }}"></span> {{ row.label }} {{ row.count|num }}</span>{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if policies %}
|
|
<div class="sub">
|
|
<div class="label block">Scan coverage</div>
|
|
<table class="table">
|
|
<tbody>
|
|
{% for key, count in policies.items() %}
|
|
<tr><td style="width:44mm">{{ {'full':'Scanned in full','web':'Web ports only, CDN edge','skip':'Not scanned'}.get(key, key) }}</td><td class="num">{{ count|num }} addresses</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<p class="micro faint" style="margin-top:1.4mm">A CDN edge address is scanned on web ports only, because the rest of its ports belong to the provider and not to this estate.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="sub">
|
|
<div class="label block">Services</div>
|
|
<table class="table table--fixed">
|
|
<thead><tr><th style="width:32mm">Address</th><th class="num" style="width:14mm">Port</th><th style="width:26mm">Service</th><th style="width:20mm">Class</th>{% if show_banner %}<th>Software</th>{% endif %}<th style="width:38mm">Hostnames</th></tr></thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr>
|
|
<td class="micro mono-break">{{ row.ip }}</td>
|
|
<td class="num micro">{{ row.port }}{% if row.tls %} <span class="faint">tls</span>{% endif %}</td>
|
|
<td class="micro">{{ row.service_name or '—' }}{% if row.sensitive %} <span class="badge badge--high">sensitive</span>{% endif %}</td>
|
|
<td class="micro muted">{{ row.service_class|svc }}</td>
|
|
{% if show_banner %}<td class="micro muted wrap">{{ ((row.product ~ ' ' ~ (row.version or '')) if row.product else (row.banner or ''))|clip(48) or '—' }}</td>{% endif %}
|
|
<td class="micro mono-break wrap">{{ row.hosts[:2]|join(', ')|clip(46) or '—' }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% if hidden %}<p class="micro faint" style="margin-top:1.4mm">{{ hidden|num }} further services are not listed.</p>{% endif %}
|
|
</div>
|