fix(iwooos): close Wazuh SOC runtime slice
Some checks failed
CD Pipeline / select-latest-carrier (push) Successful in 48s
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m22s
CD Pipeline / revalidate-deploy-carrier (push) Successful in 36s
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / revalidate-post-deploy-carrier (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled

This commit is contained in:
Your Name
2026-07-22 14:32:51 +08:00
parent 52ad145847
commit 1144ddee7d
15 changed files with 1683 additions and 87 deletions

View File

@@ -57,6 +57,17 @@ type Copy = {
forbiddenSources: string;
imagePolicy: string;
publicTls: string;
wazuhSlice: string;
protectedAssets: string;
ownerTelemetry: string;
identityLink: string;
incident: string;
verifier: string;
recipientReceipt: string;
remainingGaps: string;
delivered: string;
closed: string;
open: string;
certificates: string;
tlsEvidence: string;
tlsHealthy: string;
@@ -113,6 +124,17 @@ const COPY: Record<"zh" | "en", Copy> = {
forbiddenSources: "禁用來源",
imagePolicy: "映像政策",
publicTls: "Public TLS",
wazuhSlice: "Wazuh AI SOC 同 run",
protectedAssets: "受保護資產",
ownerTelemetry: "Owner / 遙測",
identityLink: "Identity 串接",
incident: "事件處置",
verifier: "獨立驗證",
recipientReceipt: "Telegram 收據",
remainingGaps: "剩餘缺口",
delivered: "已送達",
closed: "已閉環",
open: "未閉環",
certificates: "憑證資產",
tlsEvidence: "Live 驗證",
tlsHealthy: "健康憑證",
@@ -167,6 +189,17 @@ const COPY: Record<"zh" | "en", Copy> = {
forbiddenSources: "Forbidden sources",
imagePolicy: "Image policy",
publicTls: "Public TLS",
wazuhSlice: "Wazuh AI SOC same run",
protectedAssets: "Protected assets",
ownerTelemetry: "Owner / telemetry",
identityLink: "Identity link",
incident: "Incident",
verifier: "Independent verify",
recipientReceipt: "Telegram receipt",
remainingGaps: "Remaining gaps",
delivered: "DELIVERED",
closed: "CLOSED",
open: "OPEN",
certificates: "Certificates",
tlsEvidence: "Live evidence",
tlsHealthy: "Healthy certs",
@@ -290,12 +323,14 @@ function TruthCell({
icon: Icon,
tone = "neutral",
wideOnMobile = false,
title,
}: {
label: string;
value: string | number;
icon: typeof ShieldCheck;
tone?: "neutral" | "healthy" | "critical";
wideOnMobile?: boolean;
title?: string;
}) {
return (
<div
@@ -303,6 +338,8 @@ function TruthCell({
"flex min-w-0 items-center gap-2 bg-white px-3 py-2.5",
wideOnMobile && "last:col-span-2 lg:last:col-span-1",
)}
title={title}
aria-label={title}
>
<Icon
className={cn(
@@ -400,6 +437,128 @@ function CertificateTruthStrip({
);
}
function WazuhSocTruthStrip({
copy,
payload,
}: {
copy: Copy;
payload: SecurityAssetControlPlanePayload | null;
}) {
const wazuh = payload?.wazuh_soc_slice;
const assetCount = wazuh?.canonical_asset_count ?? 0;
const ownerAndTelemetryReady = Boolean(
wazuh &&
wazuh.owner_verified_asset_count === assetCount &&
wazuh.telemetry_covered_asset_count === assetCount &&
assetCount > 0,
);
const identityReady = Boolean(
wazuh && wazuh.identity_kind_count === wazuh.required_identity_kind_count,
);
const receiptVisible =
wazuh?.recipient_receipt_status === "recipient_visible";
const verifierRef = wazuh?.verifier_receipt_ref ?? "";
const recipientMessageRef = wazuh?.recipient_provider_message_ref ?? "";
return (
<div className="border-t border-[#d8d3c7] bg-[#f6f4ee] px-3 py-2">
<div className="mb-1.5 flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1 text-[10px] font-semibold text-[#4f4d47]">
<div className="flex min-w-0 flex-wrap items-center gap-1.5">
<Radar className="h-3.5 w-3.5 shrink-0" aria-hidden="true" />
<span>{copy.wazuhSlice}</span>
<span className="max-w-full break-all font-mono text-[#17602a]">
{wazuh?.protected_asset_ref ?? wazuh?.canonical_asset_ref ?? "--"}
</span>
<span aria-hidden="true"></span>
<span className="max-w-full break-all font-mono text-[#17602a]">
{wazuh?.incident_ref ?? "--"}
</span>
</div>
<span
className="font-mono text-[#9f2f25]"
title={wazuh?.remaining_gap_codes.join(", ")}
>
{copy.remainingGaps} {wazuh?.remaining_gap_codes.length ?? "--"}
</span>
</div>
<div
className="grid grid-cols-2 gap-px bg-[#d8d3c7] sm:grid-cols-3 lg:grid-cols-6"
data-testid="security-wazuh-soc-truth"
>
<TruthCell
label={copy.protectedAssets}
value={wazuh ? `${wazuh.protected_asset_count}/${assetCount}` : "--"}
icon={ShieldCheck}
title={
wazuh?.protected_asset_ref
? `${copy.protectedAssets}: ${wazuh.protected_asset_ref}`
: undefined
}
tone={
(wazuh?.protected_asset_count ?? 0) > 0 ? "healthy" : "critical"
}
/>
<TruthCell
label={copy.ownerTelemetry}
value={
wazuh
? `${wazuh.owner_verified_asset_count}/${assetCount} · ${wazuh.telemetry_covered_asset_count}/${assetCount}`
: "--"
}
icon={Activity}
tone={ownerAndTelemetryReady ? "healthy" : "critical"}
/>
<TruthCell
label={copy.identityLink}
value={
wazuh
? `${wazuh.identity_kind_count}/${wazuh.required_identity_kind_count}`
: "--"
}
icon={Boxes}
tone={identityReady ? "healthy" : "critical"}
/>
<TruthCell
label={copy.incident}
value={
wazuh
? `${wazuh.same_run_closed ? copy.closed : copy.open} · ${wazuh.same_run_present_stage_count}/${wazuh.same_run_required_stage_count}`
: "--"
}
icon={wazuh?.same_run_closed ? CheckCircle2 : TriangleAlert}
tone={wazuh?.same_run_closed ? "healthy" : "critical"}
/>
<TruthCell
label={copy.verifier}
value={
wazuh?.verifier_status === "passed"
? `${copy.success} · ${verifierRef.slice(0, 8)}`
: copy.failed
}
icon={CheckCircle2}
tone={wazuh?.verifier_status === "passed" ? "healthy" : "critical"}
title={verifierRef ? `${copy.verifier}: ${verifierRef}` : undefined}
/>
<TruthCell
label={copy.recipientReceipt}
value={
receiptVisible
? `${copy.delivered} · #${recipientMessageRef}`
: copy.notEvidenced
}
icon={receiptVisible ? CheckCircle2 : ShieldAlert}
tone={receiptVisible ? "healthy" : "critical"}
title={
receiptVisible
? `${copy.recipientReceipt}: ${wazuh?.recipient_receipt_ref ?? "--"} / #${recipientMessageRef}`
: undefined
}
/>
</div>
</div>
);
}
function StageStrip({
title,
stages,
@@ -627,6 +786,10 @@ export function SecurityAssetControlPlaneCockpit({
</div>
) : null}
{view === "command" ? (
<WazuhSocTruthStrip copy={copy} payload={payload} />
) : null}
{view === "command" ? (
<div
className="grid grid-cols-3 gap-px border-t border-[#d8d3c7] bg-[#d8d3c7] lg:grid-cols-5"