diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b5693..13a61ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio ## [Unreleased] ### Changed +- **Redesigned audit report.** Full-bleed cover with the Sabiá logo as the hero, a data-driven Wi-Fi arc motif (one dot per network, distance by signal, colour by security), headline numbers and a meta grid with the TLP:AMBER classification; inner pages carry the logo in the running header. Fixed Paged.js running twice, which printed the report on Letter instead of A4. - Documentation brought up to date and rewritten without em dashes; interface text no longer uses em dashes either. The interface screenshots were retaken, and `scripts/screenshots.sh` now regenerates them from the real interface with synthetic data. ## [1.0.7] - 2026-11-03 diff --git a/CHANGELOG.pt-BR.md b/CHANGELOG.pt-BR.md index 2305cf6..d347ebc 100644 --- a/CHANGELOG.pt-BR.md +++ b/CHANGELOG.pt-BR.md @@ -7,6 +7,7 @@ Formato baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/); ## [Não lançado] ### Alterado +- **Relatório de auditoria redesenhado.** Capa em sangria total com o logo do Sabiá como protagonista, um motivo de arcos Wi-Fi gerado a partir dos dados (um ponto por rede, distância pelo sinal, cor pela segurança), números de destaque e uma grade de metadados com a classificação TLP:AMBER; as páginas internas trazem o logo no cabeçalho. Corrigido o Paged.js rodando duas vezes, o que imprimia o relatório em Carta em vez de A4. - Documentação atualizada e reescrita sem travessões; os textos da interface também não usam mais travessões. As capturas de tela da interface foram refeitas, e o `scripts/screenshots.sh` agora as regera a partir da interface real com dados sintéticos. ## [1.0.7] - 2026-11-03 diff --git a/crates/sabia-core/assets/logo-mark.png b/crates/sabia-core/assets/logo-mark.png new file mode 100644 index 0000000..00558bc Binary files /dev/null and b/crates/sabia-core/assets/logo-mark.png differ diff --git a/crates/sabia-core/src/report.rs b/crates/sabia-core/src/report.rs index b83aa95..8bbf528 100644 --- a/crates/sabia-core/src/report.rs +++ b/crates/sabia-core/src/report.rs @@ -35,6 +35,9 @@ pub struct ReportOptions { const PAGED_MARKER: &str = ""; const LOGO_PNG: &[u8] = include_bytes!("../../../logo.png"); +/// 128 px copy of the logo for the running header, so the full-size PNG is +/// embedded only once (on the cover). +const LOGO_MARK_PNG: &[u8] = include_bytes!("../assets/logo-mark.png"); const B64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// Encodes the Sabiá logo as a `data:image/png;base64,...` URI so standalone @@ -340,6 +343,68 @@ fn audit_html(model: &ReportModel) -> String { ) } +/// Security bucket used to colour a network on the cover motif. +fn security_tone(security: Option<&str>) -> &'static str { + match security.unwrap_or("") { + "Open" | "" => "#ef4444", + "WEP" => "#f97316", + s if s.contains("WPA3") => "#5eead4", + s if s.contains("EAP") => "#93c5fd", + "WPA" => "#f59e0b", + _ => "#fde68a", + } +} + +/// Cover motif: concentric Wi-Fi arcs radiating from the logo, one dot per +/// observed network. Distance from the logo follows the signal (stronger is +/// nearer), colour follows the advertised security. Coordinates are in mm on +/// the full A4 cover. +fn cover_motif(model: &ReportModel) -> String { + const CX: f32 = 137.0; + const CY: f32 = 151.0; + let mut out = String::new(); + for (i, r) in [72.0f32, 92.0, 112.0, 132.0, 152.0, 172.0] + .iter() + .enumerate() + { + let op = 0.30 - i as f32 * 0.04; + out.push_str(&format!( + "", + if i % 2 == 0 { "none" } else { "1.2 2.4" } + )); + } + let aps: Vec<&AccessPoint> = model.access_points.iter().take(64).collect(); + let n = aps.len().max(1) as f32; + for (i, ap) in aps.iter().enumerate() { + let sig = ap.signal_dbm.unwrap_or(-80) as f32; + let dist = 72.0 + (-sig - 35.0).clamp(0.0, 45.0) * 1.2; + // Spread over the lower-left arc, away from the title block. + let a = (150.0 + 55.0 * (i as f32 + 0.5) / n).to_radians(); + let x = CX + dist * a.cos(); + let y = CY + dist * a.sin(); + let tone = security_tone(ap.security.as_deref()); + let near_logo = x > 50.0; + let label = ap + .ssid + .as_deref() + .filter(|s| !s.is_empty()) + .unwrap_or("(oculta)"); + out.push_str(&format!( + "{} · {}", + // The strongest networks sit close to the bird: their label goes to the + // left of the dot so it never runs under the logo. + if near_logo { x - 3.0 } else { x + 3.0 }, + y + 0.9, + if near_logo { " text-anchor=\"end\"" } else { "" }, + esc(label), + ap.signal_dbm.map(|s| format!("{s} dBm")).unwrap_or_else(|| "—".into()), + )); + } + format!( + "{out}" + ) +} + const CSS: &str = r#" :root { --ink: #17211a; @@ -347,7 +412,7 @@ const CSS: &str = r#" --faint: #838f87; --line: #d8dfdb; --soft: #f3f6f3; - --accent: #92400e; + --accent: #b45309; --accent-soft: #fbe9d9; --deep: #241705; --deep2: #140d02; @@ -359,9 +424,9 @@ const CSS: &str = r#" --warn-soft: #fbe9d9; --info: #0e7490; --info-soft: #d9f0f3; - --display: "Source Serif 4", Georgia, serif; - --body: "Inter", "Segoe UI", system-ui, sans-serif; - --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; + --display: "Inter", "Segoe UI", system-ui, Roboto, sans-serif; + --body: system-ui, "Inter", "Segoe UI", Roboto, sans-serif; + --mono: ui-monospace, "JetBrains Mono", "IBM Plex Mono", monospace; } * { box-sizing: border-box; } html, body { margin: 0; padding: 0; } @@ -374,8 +439,8 @@ body { font-variant-numeric: tabular-nums; } .report { background: #fff; } -h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; } -h2 { font-size: 18pt; letter-spacing: -0.01em; margin: 0 0 1mm; color: var(--deep); break-after: avoid; string-set: section content(); } +h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0; } +h2 { font-size: 18pt; letter-spacing: -0.01em; margin: 0 0 5mm; color: var(--deep); break-after: avoid; string-set: section content(); } h2::before { content: ""; display: block; width: 9mm; height: 1mm; background: var(--accent); margin-bottom: 3mm; border-radius: 1mm; } h3 { font-size: 12.5pt; margin: 0 0 6pt; break-after: avoid; color: var(--deep); } p { margin: 0 0 8pt; } @@ -392,28 +457,38 @@ section.chapter:first-of-type { break-before: avoid; } /* ---------- cover ---------- */ .cover { page: cover; - height: 297mm; width: 210mm; margin: 0; - display: flex; flex-direction: column; justify-content: space-between; - padding: 22mm 18mm; break-after: page; position: relative; overflow: hidden; - background: radial-gradient(120% 120% at 100% 0%, #3a2409 0%, var(--deep) 45%, var(--deep2) 100%); - color: #fff; + height: 296mm; width: 210mm; margin: 0; padding: 0; + break-after: page; position: relative; overflow: hidden; color: #fff; + background: + radial-gradient(70% 55% at 65% 51%, rgba(249,115,22,.30) 0%, rgba(249,115,22,.08) 45%, rgba(0,0,0,0) 70%), + linear-gradient(160deg, #2a1806 0%, #1a0f04 48%, #0d0702 100%); } -.cover .top { display: flex; justify-content: space-between; align-items: flex-start; } -.cover .brand { display: flex; align-items: center; gap: 3mm; } -.cover .brand img { width: 11mm; height: 11mm; border-radius: 3mm; display: block; } -.cover .brand span { font-family: var(--display); font-size: 14pt; font-weight: 700; letter-spacing: -0.01em; } +.cover, .cover * { break-inside: avoid; } +.cover-motif { position: absolute; inset: 0; width: 210mm; height: 297mm; } +.cover-motif .m-l { font: 500 2.1px var(--mono); fill: #e9cfa6; fill-opacity: .7; letter-spacing: .05px; } +.cover .hero { position: absolute; left: 72mm; top: 86mm; width: 130mm; height: 130mm; display: block; + filter: drop-shadow(0 0 9mm rgba(249,115,22,.35)); } +.cover .top { position: absolute; left: 18mm; right: 18mm; top: 16mm; display: flex; justify-content: space-between; align-items: center; } +.cover .wordmark { font: 800 11pt var(--body); letter-spacing: .42em; text-transform: uppercase; color: #fff; } .cover .badges { display: flex; align-items: center; gap: 2.5mm; } -.cover .badge { font: 700 8pt var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ffd38a; border: 1px solid #a66a2e; background: rgba(255,211,138,.08); padding: 2.5mm 4mm; border-radius: 1mm; white-space: nowrap; } +.cover .badge { font: 700 7.5pt var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #e9cfa6; border: 1px solid rgba(233,207,166,.45); padding: 1.8mm 3.2mm; border-radius: 1mm; white-space: nowrap; } /* FIRST.org TLP 2.0 brand color (amber), matching the sharing-classification badge the Ciberfauna report convention requires. */ -.cover .badge-tlp { color: #FFC000; border-color: #FFC000; background: rgba(255,192,0,.08); } -.cover .mid { margin-top: auto; } -.cover .eyebrow { color: #ffb963; margin-bottom: 4mm; } -.cover h1 { font-size: 40pt; letter-spacing: -0.02em; max-width: 150mm; color: #fff; margin-bottom: 6mm; } -.cover .lead { max-width: 125mm; font-size: 12.5pt; color: #e7d9c4; line-height: 1.6; } -.cover .meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6mm; margin-top: 16mm; padding-top: 6mm; border-top: 1px solid rgba(255,255,255,.18); } -.cover .meta dt { font: 500 7.5pt var(--mono); text-transform: uppercase; letter-spacing: .12em; color: #c9b599; margin-bottom: 1.5mm; } -.cover .meta dd { margin: 0; font-size: 10.5pt; color: #fff; } -.cover .foot { font-size: 8.3pt; color: #c9b599; margin-top: 10mm; max-width: 150mm; } +.cover .badge-tlp { color: #FFC000; border-color: #FFC000; background: rgba(255,192,0,.07); } +.cover .head { position: absolute; left: 18mm; top: 40mm; width: 128mm; } +.cover .eyebrow { font: 600 8pt var(--mono); letter-spacing: .22em; color: #fb923c; margin: 0 0 5mm; } +.cover h1 { font: 800 38pt/1.02 var(--body); letter-spacing: -0.025em; color: #fff; margin: 0 0 5mm; } +.cover .lead { font-size: 11pt; color: #e7d3b6; line-height: 1.55; max-width: 108mm; margin: 0; } +.cover .strip { position: absolute; left: 18mm; top: 224mm; display: flex; gap: 9mm; } +.cover .strip div { border-top: .8mm solid #f59e0b; padding-top: 2mm; min-width: 22mm; } +.cover .strip div.hot { border-top-color: #ef4444; } +.cover .strip strong { display: block; font: 800 22pt/1 var(--body); color: #fff; letter-spacing: -0.02em; } +.cover .strip span { font: 500 6.8pt var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #c9ad86; } +.cover .meta { position: absolute; left: 18mm; right: 18mm; top: 244mm; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6mm; margin: 0; padding-top: 4.5mm; border-top: 1px solid rgba(251,146,60,.35); } +.cover .meta dt { font: 500 7pt var(--mono); text-transform: uppercase; letter-spacing: .16em; color: #c9ad86; margin-bottom: 1.2mm; } +.cover .meta dd { margin: 0; font-size: 9.5pt; color: #fff; white-space: nowrap; } +/* Paged.js measures overflow against the default page's bottom margin even on the + margin-less cover: anything below ~275mm spills onto a second sheet. */ +.cover .foot { position: absolute; left: 18mm; right: 18mm; top: 263mm; font-size: 6.8pt; color: #9c8466; margin: 0; } /* ---------- table of contents ---------- */ .toc { break-after: page; } @@ -456,7 +531,7 @@ tbody tr { break-inside: avoid; } tbody tr:nth-child(even) td { background: #f7f9f7; } .band { margin: 0 0 7mm; break-inside: avoid; } .band header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3mm; } -.chan-row { display: grid; grid-template-columns: 11mm 1fr 12mm 30mm; gap: 2mm; align-items: center; font-size: 8.6pt; padding: 1mm 0; } +.chan-row { display: grid; grid-template-columns: 19mm 1fr 12mm 30mm; gap: 2mm; align-items: center; font-size: 8.6pt; padding: 1mm 0; } .chan-n { font-weight: 600; } .chan-bar { height: 3.2mm; background: #eef2ef; border-radius: 999px; overflow: hidden; } .chan-bar i { display: block; height: 100%; background: #b8c8bf; border-radius: 999px; } @@ -485,14 +560,16 @@ tbody tr:nth-child(even) td { background: #f7f9f7; } size: A4; margin: 24mm 16mm 20mm 16mm; background: #fff; - @top-left { content: "SABIÁ · AUDITORIA WI-FI"; font: 600 7.5pt var(--mono); letter-spacing: .1em; color: var(--faint); vertical-align: bottom; padding-bottom: 4mm; } - @top-center { content: string(section); font: 500 7.5pt var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); vertical-align: bottom; padding-bottom: 4mm; text-align: center; } + @top-left { content: __HEADER_LOGO__; vertical-align: bottom; padding-bottom: 3mm; width: 30%; } + @top-center { content: "SABIÁ · " string(section); width: 40%; white-space: nowrap; font: 500 7.5pt var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); vertical-align: bottom; padding-bottom: 4mm; text-align: center; } @top-right { content: "TLP:AMBER \25CF USO AUTORIZADO"; font: 700 7.5pt var(--mono); letter-spacing: .1em; color: var(--accent); vertical-align: bottom; padding-bottom: 4mm; text-align: right; white-space: nowrap; } @bottom-left { content: string(footline); font: 400 7.5pt var(--mono); color: var(--faint); vertical-align: top; padding-top: 4mm; } @bottom-right { content: counter(page) " / " counter(pages); font: 700 8pt var(--mono); color: var(--ink); vertical-align: top; padding-top: 4mm; text-align: right; } } @page cover { + size: A4; margin: 0; + background: #0d0702; @top-left { content: none; } @top-center { content: none; } @top-right { content: none; } @bottom-left { content: none; } @bottom-right { content: none; } } @@ -528,6 +605,16 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String { model.title.clone() }; let logo_data_uri = format!("data:image/png;base64,{}", base64(LOGO_PNG)); + // Margin boxes draw `content: url()` at intrinsic size; an SVG wrapper with + // explicit dimensions lets the running header pick its own height. + let mark_data_uri = format!("data:image/png;base64,{}", base64(LOGO_MARK_PNG)); + let header_svg = format!( + "" + ); + let header_logo = format!( + "url(\"data:image/svg+xml;base64,{}\")", + base64(header_svg.as_bytes()) + ); let footline = format!("Uso autorizado · gerado em {date}"); let overall = if critical > 0 { "bad" @@ -544,30 +631,37 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String { {title} + {paged} -
+
+ {motif} + Sabiá
-
Sabiá
+ Sabiá
TLP:AMBERUso autorizado
-
-

Relatório de auditoria · redes sem fio

+
+

CIBERFAUNA · AUDITORIA DE REDES WI-FI

{title}

-

Achados de configuração, canais, clientes, handshakes e trilha de auditoria da captura, com verificação criptográfica — nenhuma senha é inventada.

+

Achados de configuração, canais, clientes, handshakes e trilha de auditoria da captura, com verificação criptográfica. Nenhuma senha é inventada.

-
-
-
Interface
{iface}
-
Gerado em
{date}
-
Versão do Sabiá
{version}
-
Captura
{capture_state}
-
-

Documento gerado localmente. Use somente em redes próprias ou com autorização explícita do responsável. Cada ação ativa fica registrada na trilha de auditoria encadeada por hash (seção final).

+
+
{n_aps}redes
+
{n_clients}clientes
+
{n_hs}handshakes
+
{critical}achados críticos
+
+
Emissão
{date}
+
Interface · captura
{iface} · {capture_state}
+
Achados
{critical} críticos · {warnings} atenção
+
Classificação
TLP:AMBER
+
+

Sabiá {version}. Documento gerado localmente. Use somente em redes próprias ou com autorização explícita do responsável. Cada ação ativa fica registrada na trilha de auditoria encadeada por hash (seção final).

@@ -585,7 +679,7 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String {
-
+

Sumário executivo

{stat_aps}{stat_clients}{stat_hs}{stat_crackable} @@ -596,46 +690,46 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String {

Captura em {iface}, com {frames} quadros processados, {eapol} EAPOL e {deauth} quadros de desautenticação/desassociação. Os dados refletem apenas o que foi visto no ar durante a sessão; não há varredura ativa além das ações listadas na auditoria.

-
+

Achados

{findings}
-
+

Canais e interferência

Pontuação menor é melhor. O cálculo pondera sobreposição espectral e intensidade de cada AP; em 2,4 GHz a recomendação fica restrita a 1, 6 e 11.

{channels}
-
+

Redes observadas

{aps}
-
+

Clientes

Exibindo até 120 estações ordenadas por volume de quadros.

{clients}
-
+

Handshakes e PMKID

{handshakes}

Handshakes com senha encontrada aparecem com o valor em texto; os demais podem ser exportados em .pcap ou .hc22000 na interface.

-
+

WPA3 e PMF

{wpa3}
-
+

Trilha de auditoria

Últimas 60 entradas, com hash encadeado. A verificação completa fica disponível na interface.

{audit}
-
+

Metodologia e limites

O Sabiá opera em modo monitor, agrega beacons, respostas de probe, associação e EAPOL, e só injeta quadros quando uma ação é confirmada na interface. A análise de canais é uma estimativa de sobreposição, não uma medição de espectro por SDR. A detecção de evil twin é heurística: nomes iguais com seguranças diferentes e rajadas de gerenciamento merecem verificação manual.

O teste de PMF observa reassociação após desautenticação; um resultado inconclusivo não prova que o PMF está ativo. O ataque WPS depende de reaver/bully instalados e de o AP aceitar PIN. Nenhuma senha é inventada: handshakes só aparecem como quebrados quando a verificação criptográfica local confirma a candidata.

@@ -662,7 +756,12 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String { "##, title = esc(&title), - css = CSS, + css = CSS.replace("__HEADER_LOGO__", &header_logo), + motif = cover_motif(model), + n_aps = stats.aps, + n_clients = stats.clients, + n_hs = stats.handshakes, + crit_cls = if critical > 0 { "hot" } else { "" }, paged = paged, logo = logo_data_uri, footline = esc(&footline), @@ -719,7 +818,7 @@ fn summary_html(model: &ReportModel) -> String { .count(); let mut parts = Vec::new(); parts.push(format!( - "Foram observadas {} redes e {} estações.", + "Foram observadas {} redes e {} estações", model.stats.aps, model.stats.clients )); if open > 0 { diff --git a/crates/sabia-core/tests/report_render.rs b/crates/sabia-core/tests/report_render.rs new file mode 100644 index 0000000..5baab2e --- /dev/null +++ b/crates/sabia-core/tests/report_render.rs @@ -0,0 +1,135 @@ +//! Renders the audit report from a realistic synthetic capture (7 networks, +//! 9 clients, 1 handshake). Set `SABIA_REPORT_OUT=` to save the +//! HTML for visual inspection (e.g. `verificar-paginacao.mjs`). + +mod common; + +use sabia_core::analysis::analyze; +use sabia_core::audit::AuditEntry; +use sabia_core::report::{render, ReportModel, ReportOptions}; +use sabia_core::scan::ScanTable; + +const NETS: &[(&str, u8, &str, i8)] = &[ + ("Ciberfauna-Lab", 6, "WPA2", -38), + ("Cafe-Livre", 1, "Open", -52), + ("Vizinho-Antigo", 11, "WEP", -71), + ("Ciberfauna-6E", 36, "WPA3", -47), + ("Corp-Radius", 44, "WPA2-EAP", -63), + ("", 6, "WPA2", -79), + ("IoT-Casa", 1, "WPA2", -58), +]; + +fn synthetic_model() -> ReportModel { + let mut table = ScanTable::new(); + for (i, (ssid, ch, _, sig)) in NETS.iter().enumerate() { + let mut mac = common::ap(); + mac[5] = mac[5].wrapping_add(i as u8 + 1); + let freq = if *ch > 14 { + 5000 + 5 * *ch as u16 + } else { + 2407 + 5 * *ch as u16 + }; + let b = common::beacon_frame(mac, ssid, *ch, &[2]); + table.ingest(&common::radiotap_wrap(&b, freq, *sig)); + } + let probes = [ + "Ciberfauna-Lab", + "Cafe-Livre", + "Aeroporto-WiFi", + "IoT-Casa", + "Hotel-Guest", + "Corp-Radius", + "Ciberfauna-Lab", + "Casa-Mae", + "Cafe-Livre", + ]; + for (i, p) in probes.iter().enumerate() { + let mut mac = common::sta(); + mac[5] = mac[5].wrapping_add(i as u8 + 1); + let pr = common::probe_request(mac, p); + table.ingest(&common::radiotap_wrap(&pr, 2437, -45 - 4 * i as i8)); + } + let (f1, f2) = common::handshake_radiotap_frames("Ciberfauna-Lab", "senha-correta", 2, false); + table.ingest_at(&f1, 10); + table.ingest_at(&f2, 11); + + let mut aps = table.access_points(); + aps.retain(|a| a.bssid != sabia_core::dot11::mac_to_string(&common::ap())); + for ap in aps.iter_mut() { + if let Some((_, _, sec, sig)) = NETS + .iter() + .find(|n| ap.ssid.as_deref().unwrap_or("") == n.0) + { + ap.security = Some(sec.to_string()); + ap.signal_dbm = Some(*sig); + ap.cipher = Some( + match *sec { + "Open" => "—", + "WEP" => "WEP-104", + _ => "CCMP", + } + .into(), + ); + ap.pmf = *sec == "WPA3"; + ap.pmf_required = *sec == "WPA3"; + ap.wps = ap.ssid.as_deref() == Some("IoT-Casa"); + } + } + let mut clients = table.clients(); + for (i, c) in clients.iter_mut().enumerate() { + c.packets = 900 - 80 * i as u64; + c.vendor = Some(["Apple", "Samsung", "Intel", "Espressif", "Xiaomi"][i % 5].into()); + } + let mut handshakes = table.handshakes(); + handshakes.truncate(1); + let now = 1_793_700_000; + let analysis = analyze(&aps, 14, now); + let mut stats = table.stats(); + stats.aps = aps.len(); + stats.frames = 48_213; + stats.deauth_frames = 14; + let audit = (0..6) + .map(|i| AuditEntry { + timestamp: format!("2026-11-03T14:{:02}:10Z", 10 + i * 3), + action: [ + "scan.start", + "channel.hop", + "deauth", + "handshake.capture", + "crack.verify", + "report.export", + ][i] + .into(), + target: "Ciberfauna-Lab".into(), + detail: "ação confirmada na interface pelo operador".into(), + prev_hash: "0".repeat(64), + hash: format!("{:064x}", 0x9a3f_11c2_u64 * (i as u64 + 7)), + }) + .collect(); + ReportModel { + title: "Auditoria Wi-Fi do laboratório".into(), + version: "1.0.7".into(), + iface: "wlan0mon".into(), + running: false, + generated_unix: now, + stats, + access_points: aps, + clients, + handshakes, + analysis, + audit, + } +} + +#[test] +fn renders_synthetic_capture_report() { + let model = synthetic_model(); + assert_eq!(model.access_points.len(), 7); + let html = render(&model, ReportOptions::default()); + assert!(html.contains("Ciberfauna-Lab")); + assert!(html.contains("TLP:AMBER")); + assert!(html.contains("class=\"cover-motif\"")); + if let Ok(out) = std::env::var("SABIA_REPORT_OUT") { + std::fs::write(out, html).unwrap(); + } +}