feat(tests): execution start/end times on red team, detection/containment times on blue team
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
This commit is contained in:
@@ -34,11 +34,15 @@ export interface RedUpdatePayload {
|
||||
tool_used?: string;
|
||||
attack_success?: boolean;
|
||||
red_summary?: string;
|
||||
execution_start_time?: string;
|
||||
execution_end_time?: string;
|
||||
}
|
||||
|
||||
export interface BlueUpdatePayload {
|
||||
detection_result?: TestResult;
|
||||
containment_result?: ContainmentResult;
|
||||
detection_time?: string;
|
||||
containment_time?: string;
|
||||
blue_summary?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ interface TeamTabsProps {
|
||||
tool_used: string;
|
||||
attack_success: boolean;
|
||||
red_summary: string;
|
||||
execution_start_time: string;
|
||||
execution_end_time: string;
|
||||
};
|
||||
|
||||
// Blue Team field handlers
|
||||
@@ -90,6 +92,8 @@ interface TeamTabsProps {
|
||||
blueDraft: {
|
||||
detection_result: TestResult | "";
|
||||
containment_result: ContainmentResult | "";
|
||||
detection_time: string;
|
||||
containment_time: string;
|
||||
blue_summary: string;
|
||||
};
|
||||
|
||||
@@ -230,6 +234,44 @@ export default function TeamTabs({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Execution times */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
Execution Start (UTC)
|
||||
</label>
|
||||
{canEditRed ? (
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={redDraft.execution_start_time}
|
||||
onChange={(e) => onRedFieldChange("execution_start_time", e.target.value)}
|
||||
className="w-full rounded-lg border border-gray-700 bg-gray-800 px-3 py-2 text-sm text-gray-200 focus:border-cyan-500 focus:outline-none focus:ring-1 focus:ring-cyan-500"
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-gray-400">
|
||||
{test.execution_start_time ? new Date(test.execution_start_time + "Z").toUTCString().replace(" GMT", " UTC") : "—"}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
Execution End (UTC)
|
||||
</label>
|
||||
{canEditRed ? (
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={redDraft.execution_end_time}
|
||||
onChange={(e) => onRedFieldChange("execution_end_time", e.target.value)}
|
||||
className="w-full rounded-lg border border-gray-700 bg-gray-800 px-3 py-2 text-sm text-gray-200 focus:border-cyan-500 focus:outline-none focus:ring-1 focus:ring-cyan-500"
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-gray-400">
|
||||
{test.execution_end_time ? new Date(test.execution_end_time + "Z").toUTCString().replace(" GMT", " UTC") : "—"}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Red Summary */}
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
@@ -396,6 +438,46 @@ export default function TeamTabs({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Detection & Containment times — only relevant when detected */}
|
||||
{(canEditBlue || test.detection_result === "detected" || test.detection_result === "partially_detected") && (
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
Detection Time (UTC)
|
||||
</label>
|
||||
{canEditBlue ? (
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={blueDraft.detection_time}
|
||||
onChange={(e) => onBlueFieldChange("detection_time", e.target.value)}
|
||||
className="w-full rounded-lg border border-gray-700 bg-gray-800 px-3 py-2 text-sm text-gray-200 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-gray-400">
|
||||
{test.detection_time ? new Date(test.detection_time + "Z").toUTCString().replace(" GMT", " UTC") : "—"}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
Containment Time (UTC)
|
||||
</label>
|
||||
{canEditBlue ? (
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={blueDraft.containment_time}
|
||||
onChange={(e) => onBlueFieldChange("containment_time", e.target.value)}
|
||||
className="w-full rounded-lg border border-gray-700 bg-gray-800 px-3 py-2 text-sm text-gray-200 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm text-gray-400">
|
||||
{test.containment_time ? new Date(test.containment_time + "Z").toUTCString().replace(" GMT", " UTC") : "—"}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Blue Summary */}
|
||||
<div>
|
||||
<label className="mb-1.5 block text-sm font-medium text-gray-300">
|
||||
|
||||
@@ -34,6 +34,13 @@ import JiraLinkPanel from "../components/JiraLinkPanel";
|
||||
import TestPhaseTimeline from "../components/TestPhaseTimeline";
|
||||
import { createTemplate } from "../api/test-templates";
|
||||
|
||||
// ── Helpers ────────────────────────────────────────────────────────
|
||||
|
||||
function isoToDatetimeLocal(iso: string | null): string {
|
||||
if (!iso) return "";
|
||||
return iso.replace("Z", "").replace(/\.\d+$/, "").slice(0, 16);
|
||||
}
|
||||
|
||||
// ── Page Component ─────────────────────────────────────────────────
|
||||
|
||||
export default function TestDetailPage() {
|
||||
@@ -58,15 +65,21 @@ export default function TestDetailPage() {
|
||||
tool_used: "",
|
||||
attack_success: false,
|
||||
red_summary: "",
|
||||
execution_start_time: "",
|
||||
execution_end_time: "",
|
||||
});
|
||||
|
||||
const [blueDraft, setBlueDraft] = useState<{
|
||||
detection_result: TestResult | "";
|
||||
containment_result: ContainmentResult | "";
|
||||
detection_time: string;
|
||||
containment_time: string;
|
||||
blue_summary: string;
|
||||
}>({
|
||||
detection_result: "",
|
||||
containment_result: "",
|
||||
detection_time: "",
|
||||
containment_time: "",
|
||||
blue_summary: "",
|
||||
});
|
||||
|
||||
@@ -108,10 +121,14 @@ export default function TestDetailPage() {
|
||||
tool_used: test.tool_used || "",
|
||||
attack_success: test.attack_success ?? false,
|
||||
red_summary: test.red_summary || "",
|
||||
execution_start_time: isoToDatetimeLocal(test.execution_start_time),
|
||||
execution_end_time: isoToDatetimeLocal(test.execution_end_time),
|
||||
});
|
||||
setBlueDraft({
|
||||
detection_result: test.detection_result || "",
|
||||
containment_result: test.containment_result || "",
|
||||
detection_time: isoToDatetimeLocal(test.detection_time),
|
||||
containment_time: isoToDatetimeLocal(test.containment_time),
|
||||
blue_summary: test.blue_summary || "",
|
||||
});
|
||||
}
|
||||
@@ -152,6 +169,8 @@ export default function TestDetailPage() {
|
||||
tool_used: redDraft.tool_used || undefined,
|
||||
attack_success: redDraft.attack_success,
|
||||
red_summary: redDraft.red_summary || undefined,
|
||||
execution_start_time: redDraft.execution_start_time || undefined,
|
||||
execution_end_time: redDraft.execution_end_time || undefined,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
invalidateAll();
|
||||
@@ -165,6 +184,8 @@ export default function TestDetailPage() {
|
||||
updateTestBlue(testId!, {
|
||||
detection_result: (blueDraft.detection_result as TestResult) || undefined,
|
||||
containment_result: (blueDraft.containment_result as ContainmentResult) || undefined,
|
||||
detection_time: blueDraft.detection_time || undefined,
|
||||
containment_time: blueDraft.containment_time || undefined,
|
||||
blue_summary: blueDraft.blue_summary || undefined,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
|
||||
@@ -86,6 +86,8 @@ export interface Test {
|
||||
// Red Team fields
|
||||
red_summary: string | null;
|
||||
attack_success: boolean | null;
|
||||
execution_start_time: string | null;
|
||||
execution_end_time: string | null;
|
||||
red_validated_by: string | null;
|
||||
red_validated_at: string | null;
|
||||
red_validation_status: ValidationStatus | null;
|
||||
@@ -95,6 +97,8 @@ export interface Test {
|
||||
blue_summary: string | null;
|
||||
detection_result: TestResult | null;
|
||||
containment_result: ContainmentResult | null;
|
||||
detection_time: string | null;
|
||||
containment_time: string | null;
|
||||
blue_validated_by: string | null;
|
||||
blue_validated_at: string | null;
|
||||
blue_validation_status: ValidationStatus | null;
|
||||
|
||||
Reference in New Issue
Block a user