ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.
Python active-directorycloud-securitydefensive-validationfastapigood-first-issuemitre-attackopsecreactred-teamreportingsecurity
feat(ui): display filtered findings count in module run summary
Mafifrizi17fb9f8f5784
diff --git a/frontend/src/features/dashboard/DashboardPages.tsx b/frontend/src/features/dashboard/DashboardPages.tsxindex b331188..671c5bf 100644--- a/frontend/src/features/dashboard/DashboardPages.tsx+++ b/frontend/src/features/dashboard/DashboardPages.tsx@@ -5508,7 +5508,7 @@ function DiscoveredTicketsEvidenceViewer({);}-function ModuleRunSummary({+export function ModuleRunSummary({result,error,onSelectModule@@ -5553,6 +5553,23 @@ function ModuleRunSummary({const hasOutcomeError = ["operator_error", "dependency_error", "network_error", "unsupported", "module_error", "failed", "timeout"].includes(displayOutcome);const openPorts = Array.isArray(rawOutput?.open_ports) ? (rawOutput.open_ports as (number | string)[]) : [];const hasPerimeter = openPorts.length > 0 || Object.keys((rawOutput?.service_versions ?? {}) as object).length > 0;+ const filteredFindings = (result?.filtered_findings as { count?: number; reasons?: Record<string, number> } | undefined) ?? {};+ const filteredCount = typeof filteredFindings.count === "number" ? filteredFindings.count : 0;+ const filteredReasons = filteredFindings.reasons && typeof filteredFindings.reasons === "object" ? filteredFindings.reasons : {};+ let topReasonLabel = "below reporting threshold";+ const reasonEntries = Object.entries(filteredReasons).sort((a, b) => b[1] - a[1]);+ if (reasonEntries.length > 0) {+ const topKey = reasonEntries[0][0];+ if (topKey === "below_confidence_threshold") {+ topReasonLabel = "below reporting threshold";+ } else if (topKey === "no_evidence") {+ topReasonLabel = "no evidence";+ } else if (topKey === "validator_rejected") {+ topReasonLabel = "validator rejected";+ } else {+ topReasonLabel = topKey.replace(/_/g, " ");+ }+ }const emptyText = dryRun? "No live execution was performed.": rawError@@ -5783,6 +5800,18 @@ function ModuleRunSummary({) : (<EmptyState text={emptyText} />)}++ {filteredCount > 0 && (+ <div+ data-testid="filtered-findings-notice"+ className="flex items-center gap-2 px-3 py-2 rounded-sm border border-zinc-800 bg-zinc-900/60 text-xs font-mono text-zinc-400 mt-2"+ >+ <Info size={13} className="text-zinc-500 shrink-0" />+ <span>+ {filteredCount} finding{filteredCount === 1 ? "" : "s"} filtered as low-confidence ({topReasonLabel})+ </span>+ </div>+ )}</section>);}diff --git a/frontend/src/features/dashboard/ModuleRunSummary.test.tsx b/frontend/src/features/dashboard/ModuleRunSummary.test.tsxnew file mode 100644index 0000000..73e8bf0--- /dev/null+++ b/frontend/src/features/dashboard/ModuleRunSummary.test.tsx@@ -0,0 +1,128 @@+// @vitest-environment jsdom+import "../../test/setup";+import { cleanup, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it } from "vitest";+import { ModuleRunSummary } from "./DashboardPages";++afterEach(() => {+ cleanup();+});++describe("ModuleRunSummary filtered_findings indicator (Step 4 Verification)", () => {+ it("renders 1 finding filtered as low-confidence (below reporting threshold) for lateral.winrm", () => {+ const winrmResult = {+ module_id: "lateral.winrm",+ status: "done",+ findings: [],+ raw_output: { target: "10.0.0.5" },+ filtered_findings: {+ count: 1,+ reasons: { below_confidence_threshold: 1 },+ },+ };++ render(<ModuleRunSummary result={winrmResult} />);++ const notice = screen.getByTestId("filtered-findings-notice");+ expect(notice).not.toBeNull();+ expect(notice.textContent).toContain("1 finding filtered as low-confidence (below reporting threshold)");+ });++ it("renders 1 finding filtered as low-confidence (no evidence) for ad.kerberoast", () => {+ const kerbResult = {+ module_id: "ad.kerberoast",+ status: "done",+ findings: [],+ raw_output: { spns: [] },+ filtered_findings: {+ count: 1,+ reasons: { no_evidence: 1 },+ },+ };++ render(<ModuleRunSummary result={kerbResult} />);++ const notice = screen.getByTestId("filtered-findings-notice");+ expect(notice).not.toBeNull();+ expect(notice.textContent).toContain("1 finding filtered as low-confidence (no evidence)");+ });++ it("renders 3 findings filtered as low-confidence with pluralization and top reason", () => {+ const multiResult = {+ module_id: "ad.kerberoast",+ status: "done",+ findings: [],+ filtered_findings: {+ count: 3,+ reasons: { below_confidence_threshold: 2, no_evidence: 1 },+ },+ };++ render(<ModuleRunSummary result={multiResult} />);++ const notice = screen.getByTestId("filtered-findings-notice");+ expect(notice).not.toBeNull();+ expect(notice.textContent).toContain("3 findings filtered as low-confidence (below reporting threshold)");+ });++ it("renders mixed reasons using the highest-count reason (no evidence)", () => {+ const mixedResult = {+ module_id: "ad.kerberoast",+ status: "done",+ findings: [],+ filtered_findings: {+ count: 3,+ reasons: { no_evidence: 2, below_confidence_threshold: 1 },+ },+ };++ render(<ModuleRunSummary result={mixedResult} />);++ const notice = screen.getByTestId("filtered-findings-notice");+ expect(notice).not.toBeNull();+ expect(notice.textContent).toContain("3 findings filtered as low-confidence (no evidence)");+ });++ it("does NOT render indicator when filtered_findings.count is 0 (network.port_scan)", () => {+ const portScanResult = {+ module_id: "network.port_scan",+ status: "done",+ findings: [+ {+ id: "f-1",+ title: "Open Port 80/http",+ severity: "info",+ confidence: 1.0,+ validated: true,+ },+ ],+ raw_output: { open_ports: [80] },+ filtered_findings: {+ count: 0,+ reasons: {},+ },+ };++ render(<ModuleRunSummary result={portScanResult} />);++ const notice = screen.queryByTestId("filtered-findings-notice");+ expect(notice).toBeNull();+ expect(screen.queryByText(/filtered as low-confidence/i)).toBeNull();+ });++ it("does NOT render indicator when filtered_findings is undefined (older responses)", () => {+ const legacyResult = {+ module_id: "network.port_scan",+ status: "done",+ findings: [],+ raw_output: {},+ };++ render(<ModuleRunSummary result={legacyResult} />);++ const notice = screen.queryByTestId("filtered-findings-notice");+ expect(notice).toBeNull();+ expect(screen.queryByText(/filtered as low-confidence/i)).toBeNull();+ });+});+