feat(tests): make Expected Detection editable when creating a test from template
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

Leads can now edit Expected Detection in the create-from-template
form, same as Suggested Attack Procedure — the edit seeds the new
test's detect_procedure via a detect_procedure_override, without
touching the template itself. The template only updates later through
the existing procedure-suggestion approval flow, once a round is
actually submitted — same mechanism as the red side, no new bypass.
This commit is contained in:
kitos
2026-07-15 11:05:41 +02:00
parent 60f9464ec5
commit 8973f199b8
6 changed files with 48 additions and 8 deletions
+1
View File
@@ -144,6 +144,7 @@ export async function createTestFromTemplate(
platform?: string;
procedure_text?: string;
tool_used?: string;
detect_procedure?: string;
},
): Promise<Test> {
const { data } = await client.post<Test>("/tests/from-template", {
@@ -75,6 +75,7 @@ export default function TestFromTemplateForm({
platform: platform.trim() || undefined,
procedure_text: procedureText.trim() || undefined,
tool_used: toolUsed.trim() || undefined,
detect_procedure: expectedDetection.trim() || undefined,
}),
onSuccess: (test) => {
navigate(`/tests/${test.id}`);
@@ -208,17 +209,18 @@ export default function TestFromTemplateForm({
/>
</div>
{/* Expected Detection (read-only reference for Blue Team) */}
{/* Expected Detection */}
<div>
<label className="mb-1.5 block text-sm font-medium text-gray-300">
Expected Detection
<span className="ml-2 text-xs text-gray-500">(read-only reference for Blue Team)</span>
</label>
<div className="rounded-lg border border-gray-700 bg-gray-800/50 p-3">
<p className="whitespace-pre-wrap font-mono text-sm text-gray-400">
{expectedDetection || "No detection guidance provided in template."}
</p>
</div>
<textarea
value={expectedDetection}
onChange={(e) => setExpectedDetection(e.target.value)}
rows={5}
className="w-full rounded-lg border border-gray-700 bg-gray-800 px-3 py-2 font-mono text-sm text-gray-200 placeholder-gray-500 focus:border-cyan-500 focus:outline-none focus:ring-1 focus:ring-cyan-500"
placeholder="What the blue team should detect, and how..."
/>
</div>
{/* Error */}