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

This commit is contained in:
kitos
2026-06-24 13:09:13 +02:00
parent 2e45cf1be0
commit cef082d0c4
7 changed files with 150 additions and 0 deletions
@@ -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">