Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

ux: polish reporting telemetry and docs

Mafifrizi4bddc579d6a1
diff --git a/README.md b/README.md
index 8968581..215bae7 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ and professional report generation.
[![FastAPI](https://img.shields.io/badge/API-FastAPI-009688?style=for-the-badge&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com)
[![React](https://img.shields.io/badge/Dashboard-React-61DAFB?style=for-the-badge&logo=react&logoColor=111111)](https://react.dev)
[![License](https://img.shields.io/badge/License-MIT-22C55E?style=for-the-badge)](LICENSE)
-[![Status](https://img.shields.io/badge/Unit%20Suite-1078%20passing-22C55E?style=for-the-badge)](tests/)
+[![Status](https://img.shields.io/badge/Unit%20Suite-1095%20passing-22C55E?style=for-the-badge)](tests/)
**Built for labs, internal security teams, and authorized engagements only.**
@@ -89,10 +89,10 @@ Dashboard areas:
| Page | Purpose |
| --- | --- |
-| Overview | Health, telemetry, and campaign summary. |
+| Overview | Health, operator telemetry metrics, and campaign summary. |
| Campaigns | Create, inspect, compare, restore, dry-run, and delete campaigns. |
| Modules | Browse the module catalog and run backend-generated parameter forms. |
-| Reports | Generate, list, and download authenticated campaign reports. |
+| Reports | Generate, list, and download authenticated campaign reports with readable evidence tables. |
| Graph | Review graph data, attack paths, and BloodHound ingest. |
| Templates | Generate repeatable execution plans. |
| Strategy | Start or review authorized goal-based planning. |
@@ -105,7 +105,9 @@ Recommended dashboard workflow:
1. Start in `Campaigns` and create a campaign with a name, client, targets,
and scope CIDRs.
2. Use `Modules` to search for a module, pick the campaign, fill the generated
- parameters, and run it in dry-run mode first.
+ parameters, and run it in dry-run mode first. The page shows a running state
+ while execution is in progress and surfaces scope or validation errors in the
+ result panel.
3. Use `Graph` only after a campaign exists. To ingest BloodHound or
SharpHound data, enter a JSON file or directory path that is local to the
machine running the ARES API, then click `Ingest`.
@@ -117,7 +119,8 @@ Recommended dashboard workflow:
`Engage`. RBAC and backend authorization checks still apply.
6. Use `Reports` to generate HTML, PDF, Markdown, or JSON output for a campaign.
PDF generation writes the PDF artifact directly; HTML is generated only when
- you choose the HTML format.
+ you choose the HTML format. Report evidence is rendered as readable tables
+ and key-value rows where possible instead of raw JSON blobs.
7. Use `Security` for account administration. API keys are for scripts and
integrations; the Security Audit panel reports dependency-audit status for
the ARES environment, not findings from a target network.
@@ -135,6 +138,15 @@ Common page inputs and outputs:
| EDR/OPSEC | Technique ID, EDR vendor, version, outcome, campaign, and notes. | Historical success-rate telemetry and outcome records. | You want to track defensive visibility and tune OPSEC decisions from controlled tests. |
| Graph Ingest | Campaign plus local BloodHound/SharpHound JSON path. | Campaign graph nodes, links, and attack-path candidates. | You already collected BloodHound-style data and want it mapped into ARES. |
+Telemetry note:
+
+The Overview telemetry panel is an in-memory operational snapshot for the
+currently running ARES API process. It shows module run totals, success/failure
+counts, latency, throughput, findings, hosts, queue depth, and worker health. It
+is useful while operating or recording a demo, but it is not the durable
+campaign database and resets when the API process restarts. Use Campaigns,
+Findings, and Reports for permanent engagement history.
+
Planning modes:
| Mode | Where to use it | Requires LLM key? | What it does |
@@ -231,9 +243,12 @@ Security page, but role assignment is done at account creation time through
### Reporting
- HTML, Markdown, and JSON report output.
-- PDF output when optional PDF dependencies are installed.
-- ARES branding in generated reports.
-- Findings, evidence, severity, timeline, and remediation-oriented sections.
+- PDF output through WeasyPrint when available, with a Chromium-compatible
+ browser fallback for local environments that do not have WeasyPrint native
+ libraries installed.
+- ARES branding in generated reports with footer-safe page spacing.
+- Findings, readable evidence tables, severity, timeline, MITRE, and
+ remediation-oriented sections.
- Authenticated report download through the dashboard.
### Validation Lab
@@ -479,9 +494,10 @@ See [docs/architecture.md](docs/architecture.md) and
Current local verification:
```text
-1078 unit tests passed
+1095 unit tests passed
npm run build passed
validation lab passed
+PDF report visual QA passed through browser fallback and Poppler render checks
```
Runtime features confirmed locally:
@@ -490,6 +506,8 @@ Runtime features confirmed locally:
- Health endpoint returns connected DB.
- Login, password change, API key lifecycle, and campaign cleanup work.
- Report generation and authenticated download work.
+- PDF report layout, footer branding, and evidence rendering work.
+- Overview telemetry records API-triggered module runs in the current process.
- Campaign delete removes stored child data and updates the UI immediately.
---
diff --git a/ares/api/server.py b/ares/api/server.py
index 6e37b16..0cb1115 100644
--- a/ares/api/server.py
+++ b/ares/api/server.py
@@ -1196,6 +1196,23 @@ async def run_module(
actor.username, "module_run", f"module={module_id}", body.campaign_id, module_id
)
+ # Keep the operational telemetry panel in sync with API-triggered executions.
+ try:
+ from ares.telemetry.collector import get_collector
+
+ status = str(getattr(result, "status", "")).lower()
+ success = status in {"modulestatus.done", "done", "success", "partial"}
+ get_collector().record_execution(
+ module_id,
+ float(getattr(result, "duration_ms", 0.0) or 0.0),
+ success=success,
+ campaign_id=body.campaign_id,
+ )
+ if result.findings:
+ get_collector().record_finding(len(result.findings))
+ except Exception as exc:
+ logger.debug("telemetry_record_failed", module_id=module_id, error=str(exc))
+
# Enrich findings with CVSS scores and trace ID before persisting
from ares.core.cvss import enrich_finding_with_cvss
from ares.core.tracing import get_current_trace_id
diff --git a/ares/modules/reporting/report_gen.py b/ares/modules/reporting/report_gen.py
index 1d2c4c2..8712960 100644
--- a/ares/modules/reporting/report_gen.py
+++ b/ares/modules/reporting/report_gen.py
@@ -276,6 +276,43 @@ def _build_remediation_roadmap(findings: list[Any]) -> list[dict[str, Any]]:
return roadmap
+def _evidence_rows(evidence: Any) -> list[dict[str, str]]:
+ """Normalize finding evidence into report-friendly key/value rows."""
+ if isinstance(evidence, dict):
+ items = evidence.items()
+ elif isinstance(evidence, list):
+ items = ((f"item_{index + 1}", value) for index, value in enumerate(evidence))
+ else:
+ items = (("evidence", evidence),)
+
+ rows: list[dict[str, str]] = []
+ for key, value in items:
+ rendered = _format_evidence_value(value)
+ rows.append({"key": str(key).replace("_", " ").title(), "value": rendered})
+ return rows
+
+
+def _format_evidence_value(value: Any) -> str:
+ if isinstance(value, dict):
+ lines: list[str] = []
+ for key, item in value.items():
+ label = str(key).replace("_", " ").upper()
+ if isinstance(item, dict):
+ nested = "; ".join(
+ f"{str(nested_key).replace('_', ' ')}: {_format_evidence_value(nested_value)}"
+ for nested_key, nested_value in item.items()
+ )
+ lines.append(f"{label}: {nested}")
+ elif isinstance(item, (list, tuple, set)):
+ lines.append(f"{label}: {', '.join(str(part) for part in item)}")
+ else:
+ lines.append(f"{label}: {item}")
+ return "\n".join(lines)
+ if isinstance(value, (list, tuple, set)):
+ return "\n".join(str(item) for item in value)
+ return str(value)
+
+
def _build_mitre_map(findings: list[Any]) -> dict[str, list[dict[str, Any]]]:
"""Group findings by MITRE tactic and demonstrated technique."""
tactic_map: dict[str, list[dict[str, Any]]] = {t: [] for t in MITRE_TACTIC_ORDER}
@@ -970,6 +1007,7 @@ body {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
+main { padding-bottom: 18mm; }
.topbar {
display: flex;
justify-content: space-between;
@@ -1208,6 +1246,7 @@ body {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
+main { padding-bottom: 18mm; }
.topbar {
display: flex;
justify-content: space-between;
@@ -1269,6 +1308,8 @@ p { margin: 6px 0; }
padding: 10px 12px;
}
table { width: 100%; border-collapse: collapse; margin-top: 6px; }
+thead { display: table-header-group; }
+tr { break-inside: avoid; }
th, td {
border-bottom: 1px solid #e2e8f0;
padding: 6px 5px;
@@ -1331,6 +1372,25 @@ th {
white-space: pre-wrap;
overflow-wrap: anywhere;
}
+.evidence-table {
+ margin-top: 6px;
+ border: 1px solid #d7dee8;
+ border-radius: 6px;
+ overflow: hidden;
+}
+.evidence-table th {
+ width: 30%;
+ background: #f8fafc;
+ color: #334155;
+ font-family: Consolas, monospace;
+ font-size: 8.5px;
+}
+.evidence-table td {
+ font-family: Consolas, monospace;
+ font-size: 8.5px;
+ overflow-wrap: anywhere;
+ white-space: pre-wrap;
+}
.remediation {
margin-top: 6px;
padding: 7px;
@@ -1344,14 +1404,16 @@ th {
.footer {
position: fixed;
right: 14mm;
- bottom: 7mm;
+ bottom: 5mm;
display: flex;
align-items: center;
gap: 8px;
color: #64748b;
font-size: 8px;
+ background: rgba(255, 255, 255, 0.94);
+ padding: 2px 0 0 6px;
}
-.footer img { width: 82px; height: auto; object-fit: contain; }
+.footer img { width: 54px; height: auto; object-fit: contain; }
</style>
</head>
<body>
@@ -1492,7 +1554,15 @@ th {
<span class="sev {{ f.severity.value }}">{{ f.severity.value.upper() }}</span>
</div>
<p>{{ f.description }}</p>
- {% if f.evidence %}<div class="evidence">{{ f.evidence|tojson }}</div>{% endif %}
+ {% if f.evidence %}
+ <table class="evidence-table">
+ <tbody>
+ {% for row in f.evidence|evidence_rows %}
+ <tr><th>{{ row.key }}</th><td>{{ row.value }}</td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
{% if f.remediation %}<div class="remediation"><strong>Remediation:</strong> {{ f.remediation }}</div>{% endif %}
<div class="small">SLA: {{ sla[f.severity.value] }} days - Confidence: {{ "%.0f"|format(f.confidence*100) }}%</div>
</article>
@@ -1669,6 +1739,7 @@ class ReportGenerator:
) -> str:
env = Environment(loader=BaseLoader(), autoescape=True)
env.filters["tojson"] = lambda v: json.dumps(v, indent=2, default=str)
+ env.filters["evidence_rows"] = _evidence_rows
return env.from_string(template).render(
**build_report_context(campaign, graph_json)
)
diff --git a/docs/api-reference.md b/docs/api-reference.md
index 32b8076..bc10ee2 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -316,6 +316,13 @@ Generate a campaign report.
Supported formats: `html` | `pdf` | `json` | `markdown`
+PDF generation uses the report renderer internally and returns a PDF artifact
+for `format: "pdf"`. The server uses WeasyPrint when available and can fall
+back to a local Chromium-compatible browser in local environments where
+WeasyPrint native libraries are not installed. HTML and PDF reports render
+finding evidence as readable tables and key-value rows where possible. Use
+`json` output when you need raw machine-readable report data.
+
**Response:** `200 OK`
```json
{ "filename": "campaign-id_Corp_20260609_1200.html", "format": "html" }
@@ -339,12 +346,22 @@ traversal, and symlink escapes are rejected.
Get current operational telemetry snapshot.
+Telemetry is an in-memory runtime view of the current API process. It records
+API-triggered module runs, success/failure counts, latency, throughput, queue
+depth, worker health, findings, hosts, and other operator metrics. It is useful
+for live monitoring and demos, but it is not durable campaign history and
+resets when the API process restarts. Use the database-backed campaign,
+findings, and report endpoints for permanent records.
+
```json
{
- "modules": { "total": 42, "success": 38, "failed": 4 },
+ "modules": { "total": 42, "success": 38, "failed": 4, "error_rate": 0.095 },
+ "queue": { "depth": 0 },
+ "workers": { "active": 0, "unhealthy": 0 },
"findings": 17,
"hosts": { "discovered": 12, "owned": 3 },
- "latency_ms": { "p50": 1200.0, "p95": 8400.0, "p99": 15000.0 }
+ "latency_ms": { "p50": 1200.0, "p95": 8400.0, "p99": 15000.0 },
+ "throughput": { "tasks_per_min": 3.0, "bytes_sent": 0, "bytes_recv": 0 }
}
```
diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md
index 55935b5..f16203b 100644
--- a/docs/dashboard-guide.md
+++ b/docs/dashboard-guide.md
@@ -87,10 +87,16 @@ Shows:
- API health.
- Campaign count.
- Telemetry status.
-- Telemetry JSON snapshot.
+- Telemetry metric cards for module runs, findings, latency, throughput,
+ queue depth, worker health, and scope counters.
+- Expandable raw telemetry snapshot for debugging.
- Campaign summary table.
-Use it to confirm the server is alive before running modules.
+Use it to confirm the server is alive before running modules and to see whether
+the current API process is actively recording module activity. Telemetry is
+in-memory operational monitoring, not permanent campaign history. It resets
+when the API process restarts; use campaign details and reports for durable
+records.
### Campaigns
@@ -126,6 +132,8 @@ Use it for:
- Fill module parameters generated by the backend schema.
- Run with `dry_run` enabled by default.
- Confirm high-noise or sensitive execution when required.
+- Watch the run button/loading state while backend execution is in progress.
+- Review validation and scope errors without checking the terminal.
Good habit:
@@ -136,6 +144,15 @@ Good habit:
5. Review validation output.
6. Run live only if authorized.
+Scope behavior:
+
+- Targeted modules can run only against targets inside the selected campaign
+ scope.
+- For a local demo target such as `127.0.0.1`, create the campaign with target
+ `127.0.0.1` and scope CIDR `127.0.0.1/32`.
+- If a campaign has no scope CIDRs, or the target is outside scope, the
+ dashboard shows a clear validation message and the backend rejects execution.
+
### Reports
Purpose: generate and download campaign reports.
@@ -145,7 +162,11 @@ Formats:
- HTML.
- Markdown.
- JSON.
-- PDF when optional PDF dependencies are installed.
+- PDF through WeasyPrint when available, with a Chromium-compatible browser
+ fallback for local environments that do not have WeasyPrint native libraries.
+
+HTML and PDF reports render finding evidence as readable tables and key-value
+rows where possible. Use JSON output when you need raw machine-readable data.
Use the dashboard Download button. Directly opening the file URL in the address
bar will return `401` because report files require an authenticated request.
@@ -322,4 +343,6 @@ Use it for:
| `422 Request failed` | Input validation rejected the request. | Check required fields and parameter types. |
| `429 Global rate limit exceeded` | Too many rapid requests. | Wait a moment and retry. |
| Campaign remains after delete | Browser cache or old server process. | Restart ARES and press `Ctrl+F5`. |
-| Report PDF returns HTML | PDF dependency is not installed. | Install optional PDF extra in a controlled environment. |
+| Module says target is not in scope | Selected campaign has no matching scope CIDR. | Create or select a campaign whose scope includes the target, such as `127.0.0.1/32` for local testing. |
+| Telemetry looks empty after restart | Telemetry is an in-memory runtime snapshot. | Run modules in the current API process, or use Reports/Campaigns for durable history. |
+| PDF generation fails | No PDF backend or browser fallback is available. | Install the PDF extra/native libraries or run on a machine with an available Chromium-compatible browser; use HTML, Markdown, or JSON meanwhile. |
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 718a31b..e39d462 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -61,6 +61,20 @@ function useAuth(): AuthState {
const REQUIRED_FIELD_MESSAGE = "This field is required.";
type ValidatableElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
+type TelemetryMetricMap = Record<string, number | string | undefined>;
+interface TelemetrySnapshot {
+ modules?: TelemetryMetricMap;
+ queue?: TelemetryMetricMap;
+ workers?: TelemetryMetricMap;
+ latency_ms?: TelemetryMetricMap;
+ throughput?: TelemetryMetricMap;
+ findings?: number;
+ credentials?: number;
+ hosts?: TelemetryMetricMap;
+ campaign_id?: string;
+ timestamp?: number;
+ [key: string]: unknown;
+}
function setRequiredMessage<T extends ValidatableElement>(event: FormEvent<T>) {
event.currentTarget.setCustomValidity(REQUIRED_FIELD_MESSAGE);
@@ -277,6 +291,7 @@ function OverviewPage() {
const health = useQuery({ queryKey: ["health"], queryFn: api.health });
const telemetry = useQuery({ queryKey: ["telemetry"], queryFn: api.telemetry });
const campaigns = useQuery({ queryKey: ["campaigns"], queryFn: api.campaigns });
+ const snapshot = telemetry.data as TelemetrySnapshot | undefined;
return (
<Page title="Overview">
<div className="grid gap-4 md:grid-cols-3">
@@ -284,7 +299,7 @@ function OverviewPage() {
<Stat title="Campaigns" value={String(campaigns.data?.length ?? 0)} icon={<ListChecks size={18} />} />
<Stat title="Telemetry" value={telemetry.isSuccess ? "online" : "pending"} icon={<BarChart3 size={18} />} />
</div>
- <DataPanel title="Telemetry Snapshot" data={telemetry.data} />
+ <TelemetryPanel snapshot={snapshot} loading={telemetry.isLoading} />
<CampaignTable campaigns={campaigns.data ?? []} />
</Page>
);
@@ -883,6 +898,118 @@ function Stat({ title, value, icon }: { title: string; value: string; icon: Reac
);
}
+function metricNumber(map: TelemetryMetricMap | undefined, key: string): number {
+ const value = map?.[key];
+ if (typeof value === "number" && Number.isFinite(value)) return value;
+ if (typeof value === "string") {
+ const parsed = Number(value);
+ return Number.isFinite(parsed) ? parsed : 0;
+ }
+ return 0;
+}
+
+function formatMetric(value: number, suffix = ""): string {
+ if (!Number.isFinite(value)) return `0${suffix}`;
+ if (Number.isInteger(value)) return `${value}${suffix}`;
+ return `${value.toFixed(1)}${suffix}`;
+}
+
+function formatTimestamp(value: number | undefined): string {
+ if (!value) return "No runtime sample yet";
+ return new Date(value * 1000).toLocaleString();
+}
+
+function TelemetryPanel({ snapshot, loading }: { snapshot?: TelemetrySnapshot; loading: boolean }) {
+ const total = metricNumber(snapshot?.modules, "total");
+ const success = metricNumber(snapshot?.modules, "success");
+ const failed = metricNumber(snapshot?.modules, "failed");
+ const findings = typeof snapshot?.findings === "number" ? snapshot.findings : 0;
+ const successRate = total > 0 ? Math.round((success / total) * 100) : 0;
+ const errorRate = metricNumber(snapshot?.modules, "error_rate");
+ const p95 = metricNumber(snapshot?.latency_ms, "p95");
+ const queueDepth = metricNumber(snapshot?.queue, "depth");
+ const activeWorkers = metricNumber(snapshot?.workers, "active");
+ const unhealthyWorkers = metricNumber(snapshot?.workers, "unhealthy");
+ const hostsDiscovered = metricNumber(snapshot?.hosts, "discovered");
+ const hostsOwned = metricNumber(snapshot?.hosts, "owned");
+ const tasksPerMin = metricNumber(snapshot?.throughput, "tasks_per_min");
+
+ return (
+ <section className="panel p-5">
+ <div className="mb-4 flex flex-wrap items-start justify-between gap-3">
+ <div>
+ <h3 className="text-sm font-bold text-slate-800">Telemetry Snapshot</h3>
+ <p className="text-sm text-slate-500">
+ {loading ? "Waiting for runtime metrics" : `Last sample: ${formatTimestamp(snapshot?.timestamp)}`}
+ </p>
+ </div>
+ <span className="badge badge-low">{snapshot ? "online" : "pending"}</span>
+ </div>
+
+ <div className="telemetry-grid">
+ <TelemetryMetric label="Module runs" value={formatMetric(total)} detail={`${success} success / ${failed} failed`} />
+ <TelemetryMetric label="Findings" value={formatMetric(findings)} detail="confirmed runtime observations" />
+ <TelemetryMetric label="Queue depth" value={formatMetric(queueDepth)} detail={`${activeWorkers} active workers`} />
+ <TelemetryMetric label="Hosts" value={`${hostsDiscovered} / ${hostsOwned}`} detail="discovered / owned" />
+ </div>
+
+ <div className="mt-5 grid gap-4 md:grid-cols-3">
+ <TelemetryBar label="Success rate" value={successRate} />
+ <TelemetryBar label="Error rate" value={Math.min(100, Math.round(errorRate * 100))} tone="danger" />
+ <div className="telemetry-strip">
+ <span>P95 latency</span>
+ <strong>{formatMetric(p95, " ms")}</strong>
+ </div>
+ </div>
+
+ <div className="mt-4 grid gap-4 md:grid-cols-3">
+ <div className="telemetry-strip">
+ <span>Throughput</span>
+ <strong>{formatMetric(tasksPerMin)} tasks/min</strong>
+ </div>
+ <div className="telemetry-strip">
+ <span>Worker health</span>
+ <strong>{unhealthyWorkers === 0 ? "healthy" : `${unhealthyWorkers} unhealthy`}</strong>
+ </div>
+ <div className="telemetry-strip">
+ <span>Scope</span>
+ <strong>{snapshot?.campaign_id ? `campaign ${snapshot.campaign_id}` : "global"}</strong>
+ </div>
+ </div>
+
+ <details className="mt-4">
+ <summary className="cursor-pointer text-sm font-semibold text-slate-600">Raw telemetry data</summary>
+ <pre className="json-box mt-2">{JSON.stringify(snapshot ?? {}, null, 2)}</pre>
+ </details>
+ </section>
+ );
+}
+
+function TelemetryMetric({ label, value, detail }: { label: string; value: string; detail: string }) {
+ return (
+ <div className="telemetry-metric">
+ <span>{label}</span>
+ <strong>{value}</strong>
+ <small>{detail}</small>
+ </div>
+ );
+}
+
+function TelemetryBar({ label, value, tone = "ok" }: { label: string; value: number; tone?: "ok" | "danger" }) {
+ const clamped = Math.max(0, Math.min(100, value));
+ return (
+ <div className="telemetry-bar">
+ <div className="mb-2 flex items-center justify-between gap-3">
+ <span>{label}</span>
+ <strong>{clamped}%</strong>
+ </div>
+ <div className="telemetry-bar-track">
+ <div className={tone === "danger" ? "telemetry-bar-fill danger" : "telemetry-bar-fill"} style={{ width: `${clamped}%` }} />
+ </div>
+ </div>
+ );
+}
+
function DataPanel({ title, data }: { title: string; data: unknown }) {
if (!data) {
return null;
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
index 308d252..b502a1d 100644
--- a/frontend/src/styles.css
+++ b/frontend/src/styles.css
@@ -172,6 +172,71 @@ textarea {
font-size: 0.78rem;
}
+.telemetry-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
+ gap: 1px;
+ overflow: hidden;
+ border: 1px solid #e2e8f0;
+ border-radius: 6px;
+ background: #e2e8f0;
+}
+
+.telemetry-metric,
+.telemetry-strip,
+.telemetry-bar {
+ background: #ffffff;
+ padding: 0.75rem;
+}
+
+.telemetry-metric span,
+.telemetry-strip span,
+.telemetry-bar span {
+ display: block;
+ color: #64748b;
+ font-size: 0.78rem;
+ font-weight: 650;
+}
+
+.telemetry-metric strong,
+.telemetry-strip strong,
+.telemetry-bar strong {
+ display: block;
+ margin-top: 0.15rem;
+ color: #0f172a;
+ font-size: 1.15rem;
+}
+
+.telemetry-metric small {
+ display: block;
+ margin-top: 0.1rem;
+ color: #64748b;
+ font-size: 0.76rem;
+}
+
+.telemetry-strip,
+.telemetry-bar {
+ border: 1px solid #e2e8f0;
+ border-radius: 6px;
+}
+
+.telemetry-bar-track {
+ height: 8px;
+ overflow: hidden;
+ border-radius: 999px;
+ background: #e2e8f0;
+}
+
+.telemetry-bar-fill {
+ height: 100%;
+ border-radius: inherit;
+ background: #059669;
+}
+
+.telemetry-bar-fill.danger {
+ background: #b91c1c;
+}
+
.nav-link {
display: flex;
min-height: 38px;
diff --git a/tests/unit/test_api_endpoints.py b/tests/unit/test_api_endpoints.py
index 978326f..3e25506 100644
--- a/tests/unit/test_api_endpoints.py
+++ b/tests/unit/test_api_endpoints.py
@@ -631,6 +631,99 @@ class TestModuleRunEndpoint:
assert [entry.cidr for entry in campaign.scope] == ["127.0.0.1/32"]
assert campaign.targets == ["127.0.0.1"]
+ @pytest.mark.asyncio # type: ignore[untyped-decorator]
+ async def test_module_run_updates_telemetry_snapshot(
+ self, aclient: Any, monkeypatch: Any
+ ) -> None:
+ c, db, app = aclient
+ from ares.api.server import get_engine
+ import ares.telemetry.collector as telemetry
+
+ telemetry._global_collector = telemetry.TelemetryCollector()
+
+ class FakeRegistry:
+ def get(self, module_id: str) -> Any:
+ return object
+
+ class FakeFinding:
+ false_positive = False
+ severity = "low"
+ cvss_score = 0.0
+ cvss_vector = ""
+ trace_id = ""
+
+ class FakeResult:
+ findings: list[Any] = [FakeFinding()]
+ status = "done"
+ duration_ms = 42.5
+
+ def model_dump(self) -> dict[str, Any]:
+ return {
+ "module_id": "demo.telemetry",
+ "status": "done",
+ "findings": [],
+ "validation_results": [],
+ "raw_output": {},
+ "error": "",
+ "duration_ms": self.duration_ms,
+ }
+
+ class FakeEngine:
+ registry = FakeRegistry()
+
+ async def run_module(
+ self,
+ module_id: str,
+ campaign: Any,
+ params: dict[str, Any],
+ actor_role: str = "",
+ ) -> FakeResult:
+ return FakeResult()
+
+ db.is_access_token_revoked.return_value = False
+ db.save_finding = AsyncMock()
+ db.get_campaign.return_value = {
+ "id": "camp-telemetry",
+ "name": "Telemetry",
+ "client": "Internal",
+ "operator": "admin",
+ "noise_profile": "stealth",
+ "status": "created",
+ "scope_json": '[{"cidr": "127.0.0.1/32", "description": ""}]',
+ "targets_json": '["127.0.0.1"]',
+ "notes": "",
+ "created_at": "2026-06-27 02:15:19",
+ "updated_at": "2026-06-27 02:15:19",
+ }
+ monkeypatch.setattr(
+ "ares.api.server.enrich_finding_with_cvss",
+ lambda finding: finding,
+ raising=False,
+ )
+ app.dependency_overrides[get_engine] = lambda: FakeEngine()
+ try:
+ r = await c.post(
+ "/modules/demo.telemetry/run",
+ json={
+ "campaign_id": "camp-telemetry",
+ "params": {"target": "127.0.0.1"},
+ "dry_run": False,
+ },
+ headers=_auth("admin", "team_lead"),
+ )
+ t = await c.get("/telemetry", headers=_auth("admin", "team_lead"))
+ finally:
+ app.dependency_overrides.pop(get_engine, None)
+ telemetry._global_collector = None
+
+ assert r.status_code == 200
+ assert t.status_code == 200
+ snapshot = t.json()
+ assert snapshot["modules"]["total"] == 1
+ assert snapshot["modules"]["success"] == 1
+ assert snapshot["findings"] == 1
+ assert snapshot["latency_ms"]["p50"] == 42.5
+
class TestReportEndpoints:
def setup_method(self) -> None:
diff --git a/tests/unit/test_cli_reporting_goal_planning.py b/tests/unit/test_cli_reporting_goal_planning.py
index 8a29d86..9311709 100644
--- a/tests/unit/test_cli_reporting_goal_planning.py
+++ b/tests/unit/test_cli_reporting_goal_planning.py
@@ -158,6 +158,38 @@ class TestReportGenerator:
assert "<!DOCTYPE html" in html or "<html" in html
assert campaign.name in html or campaign.client in html
+ def test_generate_html_report_uses_readable_evidence_table(self):
+ from ares.modules.reporting.report_gen import ReportGenerator
+
+ campaign = _make_campaign(n_findings=1)
+ campaign.findings[0].evidence = {
+ "host": "10.0.0.1",
+ "port": 8888,
+ "tech": "Apache",
+ "version": "2.4.49",
+ "compliance_mapping": {"PCI-DSS": ["8.2.3", "8.3.6"]},
+ }
+ with tempfile.TemporaryDirectory() as tmpdir:
+ gen = ReportGenerator(output_dir=tmpdir)
+ path = gen.generate(campaign, fmt="html")
+ html = path.read_text()
+ assert 'class="evidence-table"' in html
+ assert "<th>Host</th><td>10.0.0.1</td>" in html
+ assert "<th>Compliance Mapping</th><td>PCI-DSS:" in html
+ assert '"host": "10.0.0.1"' not in html
+ assert '"PCI-DSS":' not in html
+
+ def test_report_footer_reserves_print_safe_space(self):
+ from ares.modules.reporting.report_gen import ReportGenerator
+
+ campaign = _make_campaign(n_findings=0)
+ with tempfile.TemporaryDirectory() as tmpdir:
+ gen = ReportGenerator(output_dir=tmpdir)
+ path = gen.generate(campaign, fmt="html")
+ html = path.read_text()
+ assert "padding-bottom: 18mm" in html
+ assert "width: 54px" in html
+
def test_generate_markdown_report(self):
from ares.modules.reporting.report_gen import ReportGenerator
campaign = _make_campaign(n_findings=2)