@zivis/mcp 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client.d.ts +42 -0
- package/dist/api-client.js +145 -0
- package/dist/api-client.js.map +1 -0
- package/dist/auth/index.d.ts +29 -0
- package/dist/auth/index.js +73 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/jwt.d.ts +24 -0
- package/dist/auth/jwt.js +25 -0
- package/dist/auth/jwt.js.map +1 -0
- package/dist/auth/keychain.d.ts +34 -0
- package/dist/auth/keychain.js +272 -0
- package/dist/auth/keychain.js.map +1 -0
- package/dist/auth/oauth.d.ts +38 -0
- package/dist/auth/oauth.js +241 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/sessions.d.ts +28 -0
- package/dist/auth/sessions.js +69 -0
- package/dist/auth/sessions.js.map +1 -0
- package/dist/auth/token-refresh.d.ts +24 -0
- package/dist/auth/token-refresh.js +91 -0
- package/dist/auth/token-refresh.js.map +1 -0
- package/dist/cli.d.ts +23 -0
- package/dist/cli.js +962 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/project-binding.d.ts +25 -0
- package/dist/project-binding.js +67 -0
- package/dist/project-binding.js.map +1 -0
- package/dist/resolve-application-id.d.ts +12 -0
- package/dist/resolve-application-id.js +21 -0
- package/dist/resolve-application-id.js.map +1 -0
- package/dist/sanitize.d.ts +23 -0
- package/dist/sanitize.js +125 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.js +447 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/check-project.d.ts +32 -0
- package/dist/tools/check-project.js +180 -0
- package/dist/tools/check-project.js.map +1 -0
- package/dist/tools/check-repo-trust.d.ts +33 -0
- package/dist/tools/check-repo-trust.js +212 -0
- package/dist/tools/check-repo-trust.js.map +1 -0
- package/dist/tools/create-diagram.d.ts +114 -0
- package/dist/tools/create-diagram.js +176 -0
- package/dist/tools/create-diagram.js.map +1 -0
- package/dist/tools/create-document.d.ts +28 -0
- package/dist/tools/create-document.js +53 -0
- package/dist/tools/create-document.js.map +1 -0
- package/dist/tools/discover-local-infra.d.ts +24 -0
- package/dist/tools/discover-local-infra.js +763 -0
- package/dist/tools/discover-local-infra.js.map +1 -0
- package/dist/tools/enterprise/capture-evidence.d.ts +54 -0
- package/dist/tools/enterprise/capture-evidence.js +72 -0
- package/dist/tools/enterprise/capture-evidence.js.map +1 -0
- package/dist/tools/enterprise/create-report-ticket.d.ts +34 -0
- package/dist/tools/enterprise/create-report-ticket.js +44 -0
- package/dist/tools/enterprise/create-report-ticket.js.map +1 -0
- package/dist/tools/enterprise/end-pentest-session.d.ts +33 -0
- package/dist/tools/enterprise/end-pentest-session.js +42 -0
- package/dist/tools/enterprise/end-pentest-session.js.map +1 -0
- package/dist/tools/enterprise/generate-report.d.ts +55 -0
- package/dist/tools/enterprise/generate-report.js +111 -0
- package/dist/tools/enterprise/generate-report.js.map +1 -0
- package/dist/tools/enterprise/get-org-zat.d.ts +27 -0
- package/dist/tools/enterprise/get-org-zat.js +62 -0
- package/dist/tools/enterprise/get-org-zat.js.map +1 -0
- package/dist/tools/enterprise/get-report-status.d.ts +27 -0
- package/dist/tools/enterprise/get-report-status.js +38 -0
- package/dist/tools/enterprise/get-report-status.js.map +1 -0
- package/dist/tools/enterprise/get-threat-model.d.ts +29 -0
- package/dist/tools/enterprise/get-threat-model.js +83 -0
- package/dist/tools/enterprise/get-threat-model.js.map +1 -0
- package/dist/tools/enterprise/list-agents.d.ts +42 -0
- package/dist/tools/enterprise/list-agents.js +95 -0
- package/dist/tools/enterprise/list-agents.js.map +1 -0
- package/dist/tools/enterprise/list-report-issues.d.ts +36 -0
- package/dist/tools/enterprise/list-report-issues.js +50 -0
- package/dist/tools/enterprise/list-report-issues.js.map +1 -0
- package/dist/tools/enterprise/list-threat-models.d.ts +36 -0
- package/dist/tools/enterprise/list-threat-models.js +82 -0
- package/dist/tools/enterprise/list-threat-models.js.map +1 -0
- package/dist/tools/enterprise/manage-actor.d.ts +58 -0
- package/dist/tools/enterprise/manage-actor.js +99 -0
- package/dist/tools/enterprise/manage-actor.js.map +1 -0
- package/dist/tools/enterprise/manage-attack-scenario.d.ts +70 -0
- package/dist/tools/enterprise/manage-attack-scenario.js +89 -0
- package/dist/tools/enterprise/manage-attack-scenario.js.map +1 -0
- package/dist/tools/enterprise/manage-component.d.ts +58 -0
- package/dist/tools/enterprise/manage-component.js +90 -0
- package/dist/tools/enterprise/manage-component.js.map +1 -0
- package/dist/tools/enterprise/manage-data-asset.d.ts +53 -0
- package/dist/tools/enterprise/manage-data-asset.js +90 -0
- package/dist/tools/enterprise/manage-data-asset.js.map +1 -0
- package/dist/tools/enterprise/manage-data-flow.d.ts +57 -0
- package/dist/tools/enterprise/manage-data-flow.js +98 -0
- package/dist/tools/enterprise/manage-data-flow.js.map +1 -0
- package/dist/tools/enterprise/manage-finding.d.ts +69 -0
- package/dist/tools/enterprise/manage-finding.js +106 -0
- package/dist/tools/enterprise/manage-finding.js.map +1 -0
- package/dist/tools/enterprise/manage-security-control.d.ts +59 -0
- package/dist/tools/enterprise/manage-security-control.js +96 -0
- package/dist/tools/enterprise/manage-security-control.js.map +1 -0
- package/dist/tools/enterprise/manage-test-case.d.ts +88 -0
- package/dist/tools/enterprise/manage-test-case.js +119 -0
- package/dist/tools/enterprise/manage-test-case.js.map +1 -0
- package/dist/tools/enterprise/promote-finding-to-issue.d.ts +36 -0
- package/dist/tools/enterprise/promote-finding-to-issue.js +65 -0
- package/dist/tools/enterprise/promote-finding-to-issue.js.map +1 -0
- package/dist/tools/enterprise/publish-report-version.d.ts +34 -0
- package/dist/tools/enterprise/publish-report-version.js +75 -0
- package/dist/tools/enterprise/publish-report-version.js.map +1 -0
- package/dist/tools/enterprise/publish-test-to-library.d.ts +31 -0
- package/dist/tools/enterprise/publish-test-to-library.js +40 -0
- package/dist/tools/enterprise/publish-test-to-library.js.map +1 -0
- package/dist/tools/enterprise/record-test-result.d.ts +67 -0
- package/dist/tools/enterprise/record-test-result.js +75 -0
- package/dist/tools/enterprise/record-test-result.js.map +1 -0
- package/dist/tools/enterprise/start-pentest-session.d.ts +35 -0
- package/dist/tools/enterprise/start-pentest-session.js +50 -0
- package/dist/tools/enterprise/start-pentest-session.js.map +1 -0
- package/dist/tools/enterprise/sync-report-section.d.ts +41 -0
- package/dist/tools/enterprise/sync-report-section.js +79 -0
- package/dist/tools/enterprise/sync-report-section.js.map +1 -0
- package/dist/tools/enterprise/update-report-issue.d.ts +55 -0
- package/dist/tools/enterprise/update-report-issue.js +69 -0
- package/dist/tools/enterprise/update-report-issue.js.map +1 -0
- package/dist/tools/generate-diagram.d.ts +36 -0
- package/dist/tools/generate-diagram.js +153 -0
- package/dist/tools/generate-diagram.js.map +1 -0
- package/dist/tools/get-agent-test-results.d.ts +41 -0
- package/dist/tools/get-agent-test-results.js +86 -0
- package/dist/tools/get-agent-test-results.js.map +1 -0
- package/dist/tools/get-application-overview.d.ts +27 -0
- package/dist/tools/get-application-overview.js +143 -0
- package/dist/tools/get-application-overview.js.map +1 -0
- package/dist/tools/get-application.d.ts +27 -0
- package/dist/tools/get-application.js +83 -0
- package/dist/tools/get-application.js.map +1 -0
- package/dist/tools/get-artifact-content.d.ts +29 -0
- package/dist/tools/get-artifact-content.js +86 -0
- package/dist/tools/get-artifact-content.js.map +1 -0
- package/dist/tools/get-diagram.d.ts +27 -0
- package/dist/tools/get-diagram.js +109 -0
- package/dist/tools/get-diagram.js.map +1 -0
- package/dist/tools/get-document.d.ts +22 -0
- package/dist/tools/get-document.js +43 -0
- package/dist/tools/get-document.js.map +1 -0
- package/dist/tools/get-finding-details.d.ts +28 -0
- package/dist/tools/get-finding-details.js +43 -0
- package/dist/tools/get-finding-details.js.map +1 -0
- package/dist/tools/get-findings.d.ts +57 -0
- package/dist/tools/get-findings.js +103 -0
- package/dist/tools/get-findings.js.map +1 -0
- package/dist/tools/get-oss-zat.d.ts +27 -0
- package/dist/tools/get-oss-zat.js +105 -0
- package/dist/tools/get-oss-zat.js.map +1 -0
- package/dist/tools/get-recon-scan.d.ts +27 -0
- package/dist/tools/get-recon-scan.js +46 -0
- package/dist/tools/get-recon-scan.js.map +1 -0
- package/dist/tools/get-scan-output.d.ts +27 -0
- package/dist/tools/get-scan-output.js +64 -0
- package/dist/tools/get-scan-output.js.map +1 -0
- package/dist/tools/get-scenario-details.d.ts +27 -0
- package/dist/tools/get-scenario-details.js +46 -0
- package/dist/tools/get-scenario-details.js.map +1 -0
- package/dist/tools/get-test-case-results.d.ts +37 -0
- package/dist/tools/get-test-case-results.js +66 -0
- package/dist/tools/get-test-case-results.js.map +1 -0
- package/dist/tools/get-test-details.d.ts +29 -0
- package/dist/tools/get-test-details.js +49 -0
- package/dist/tools/get-test-details.js.map +1 -0
- package/dist/tools/get-trust-keys.d.ts +22 -0
- package/dist/tools/get-trust-keys.js +67 -0
- package/dist/tools/get-trust-keys.js.map +1 -0
- package/dist/tools/import-openapi-endpoints.d.ts +33 -0
- package/dist/tools/import-openapi-endpoints.js +93 -0
- package/dist/tools/import-openapi-endpoints.js.map +1 -0
- package/dist/tools/inspect-zat.d.ts +26 -0
- package/dist/tools/inspect-zat.js +247 -0
- package/dist/tools/inspect-zat.js.map +1 -0
- package/dist/tools/list-agent-test-cases.d.ts +41 -0
- package/dist/tools/list-agent-test-cases.js +73 -0
- package/dist/tools/list-agent-test-cases.js.map +1 -0
- package/dist/tools/list-applications.d.ts +34 -0
- package/dist/tools/list-applications.js +74 -0
- package/dist/tools/list-applications.js.map +1 -0
- package/dist/tools/list-diagrams.d.ts +42 -0
- package/dist/tools/list-diagrams.js +81 -0
- package/dist/tools/list-diagrams.js.map +1 -0
- package/dist/tools/list-documents.d.ts +24 -0
- package/dist/tools/list-documents.js +50 -0
- package/dist/tools/list-documents.js.map +1 -0
- package/dist/tools/list-endpoints.d.ts +47 -0
- package/dist/tools/list-endpoints.js +98 -0
- package/dist/tools/list-endpoints.js.map +1 -0
- package/dist/tools/list-recon-scans.d.ts +36 -0
- package/dist/tools/list-recon-scans.js +74 -0
- package/dist/tools/list-recon-scans.js.map +1 -0
- package/dist/tools/list-scan-artifacts.d.ts +41 -0
- package/dist/tools/list-scan-artifacts.js +63 -0
- package/dist/tools/list-scan-artifacts.js.map +1 -0
- package/dist/tools/list-scans.d.ts +44 -0
- package/dist/tools/list-scans.js +91 -0
- package/dist/tools/list-scans.js.map +1 -0
- package/dist/tools/list-test-library.d.ts +44 -0
- package/dist/tools/list-test-library.js +83 -0
- package/dist/tools/list-test-library.js.map +1 -0
- package/dist/tools/list-test-scenarios.d.ts +31 -0
- package/dist/tools/list-test-scenarios.js +66 -0
- package/dist/tools/list-test-scenarios.js.map +1 -0
- package/dist/tools/local-scan.d.ts +40 -0
- package/dist/tools/local-scan.js +261 -0
- package/dist/tools/local-scan.js.map +1 -0
- package/dist/tools/manage-diagram.d.ts +109 -0
- package/dist/tools/manage-diagram.js +316 -0
- package/dist/tools/manage-diagram.js.map +1 -0
- package/dist/tools/open-in-ide.d.ts +39 -0
- package/dist/tools/open-in-ide.js +61 -0
- package/dist/tools/open-in-ide.js.map +1 -0
- package/dist/tools/run-test-scenario.d.ts +37 -0
- package/dist/tools/run-test-scenario.js +70 -0
- package/dist/tools/run-test-scenario.js.map +1 -0
- package/dist/tools/scan-pr.d.ts +27 -0
- package/dist/tools/scan-pr.js +51 -0
- package/dist/tools/scan-pr.js.map +1 -0
- package/dist/tools/security-review.d.ts +65 -0
- package/dist/tools/security-review.js +378 -0
- package/dist/tools/security-review.js.map +1 -0
- package/dist/tools/setup-red-team-target.d.ts +79 -0
- package/dist/tools/setup-red-team-target.js +430 -0
- package/dist/tools/setup-red-team-target.js.map +1 -0
- package/dist/tools/triage-finding.d.ts +47 -0
- package/dist/tools/triage-finding.js +116 -0
- package/dist/tools/triage-finding.js.map +1 -0
- package/dist/tools/update-document.d.ts +28 -0
- package/dist/tools/update-document.js +63 -0
- package/dist/tools/update-document.js.map +1 -0
- package/dist/tools/update-endpoint.d.ts +65 -0
- package/dist/tools/update-endpoint.js +145 -0
- package/dist/tools/update-endpoint.js.map +1 -0
- package/dist/tools/update-mermaid-source.d.ts +34 -0
- package/dist/tools/update-mermaid-source.js +76 -0
- package/dist/tools/update-mermaid-source.js.map +1 -0
- package/dist/tools/verify-trust-mark.d.ts +29 -0
- package/dist/tools/verify-trust-mark.js +108 -0
- package/dist/tools/verify-trust-mark.js.map +1 -0
- package/dist/types.d.ts +220 -0
- package/dist/types.js +33 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_manage_test_case — Create, update, or delete test cases in a threat model
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/test-cases
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const MANAGE_TEST_CASE_NAME = "zivis_manage_test_case";
|
|
9
|
+
export const MANAGE_TEST_CASE_DESCRIPTION = `Create, update, or delete a test case in a threat model.
|
|
10
|
+
|
|
11
|
+
Test cases define specific security tests to validate whether vulnerabilities exist. They link to attack scenarios and can be automated or manual. Test case IDs follow the TC-X.Y format.
|
|
12
|
+
|
|
13
|
+
Actions:
|
|
14
|
+
- create: Add a new test case (requires name, description, success_criteria)
|
|
15
|
+
- update: Modify an existing test case (requires test_case_id) — use this to record test results
|
|
16
|
+
- delete: Remove a test case (requires test_case_id)`;
|
|
17
|
+
export const MANAGE_TEST_CASE_SCHEMA = {
|
|
18
|
+
threat_model_id: z.string().describe("Threat model UUID (from zivis_list_threat_models, NOT a scan ID or agent ID)"),
|
|
19
|
+
action: z.enum(["create", "update", "delete"]).describe("CRUD action to perform"),
|
|
20
|
+
test_case_id: z.string().optional().describe("Test case UUID (required for update/delete)"),
|
|
21
|
+
name: z.string().optional().describe("Test case name (e.g., 'SQL Injection in Login')"),
|
|
22
|
+
description: z.string().optional().describe("Detailed description of what to test"),
|
|
23
|
+
attack_scenario_id: z.string().optional().describe("Attack scenario UUID this test validates"),
|
|
24
|
+
preconditions: z.array(z.string()).optional().describe("Prerequisites before running the test"),
|
|
25
|
+
test_steps: z.array(z.object({
|
|
26
|
+
step: z.number(),
|
|
27
|
+
action: z.string(),
|
|
28
|
+
expected: z.string(),
|
|
29
|
+
actual: z.string().optional(),
|
|
30
|
+
})).optional().describe("Ordered list of test steps with expected outcomes"),
|
|
31
|
+
success_criteria: z.string().optional().describe("What constitutes a successful test (finding a vulnerability)"),
|
|
32
|
+
evidence_type: z
|
|
33
|
+
.enum(["screenshot", "http_request", "code_snippet", "log_entry", "video", "manual_notes"])
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Type of evidence to collect"),
|
|
36
|
+
result: z
|
|
37
|
+
.enum(["not_tested", "pass", "fail", "partial", "blocked"])
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Test result (use update action to set this after testing)"),
|
|
40
|
+
severity: z.enum(["critical", "high", "medium", "low", "info"]).optional().describe("Severity if vulnerability confirmed"),
|
|
41
|
+
findings: z.string().optional().describe("Description of what was found during testing"),
|
|
42
|
+
automatable: z.boolean().optional().describe("Whether this test can be automated"),
|
|
43
|
+
automation_tool: z.string().optional().describe("Tool for automation (nuclei, burp, zap, custom)"),
|
|
44
|
+
};
|
|
45
|
+
export function createManageTestCaseHandler(apiClient) {
|
|
46
|
+
return async (params) => {
|
|
47
|
+
try {
|
|
48
|
+
const { threat_model_id, action, test_case_id } = params;
|
|
49
|
+
if ((action === "update" || action === "delete") && !test_case_id) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: "text", text: "Error: test_case_id is required for update/delete" }],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
let data;
|
|
56
|
+
if (action === "create") {
|
|
57
|
+
if (!params.name || !params.description || !params.success_criteria) {
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: "text", text: "Error: name, description, and success_criteria are required for create" }],
|
|
60
|
+
isError: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
data = await apiClient.post(`/api/threat-models/${threat_model_id}/test-cases`, {
|
|
64
|
+
name: params.name,
|
|
65
|
+
description: params.description,
|
|
66
|
+
attackScenarioId: params.attack_scenario_id,
|
|
67
|
+
preconditions: params.preconditions,
|
|
68
|
+
testSteps: params.test_steps,
|
|
69
|
+
successCriteria: params.success_criteria,
|
|
70
|
+
evidenceType: params.evidence_type || "other",
|
|
71
|
+
automatable: params.automatable,
|
|
72
|
+
automationTool: params.automation_tool,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else if (action === "update") {
|
|
76
|
+
const body = {};
|
|
77
|
+
if (params.name)
|
|
78
|
+
body.name = params.name;
|
|
79
|
+
if (params.description !== undefined)
|
|
80
|
+
body.description = params.description;
|
|
81
|
+
if (params.attack_scenario_id)
|
|
82
|
+
body.attackScenarioId = params.attack_scenario_id;
|
|
83
|
+
if (params.preconditions)
|
|
84
|
+
body.preconditions = params.preconditions;
|
|
85
|
+
if (params.test_steps)
|
|
86
|
+
body.testSteps = params.test_steps;
|
|
87
|
+
if (params.success_criteria)
|
|
88
|
+
body.successCriteria = params.success_criteria;
|
|
89
|
+
if (params.evidence_type)
|
|
90
|
+
body.evidenceType = params.evidence_type;
|
|
91
|
+
if (params.result)
|
|
92
|
+
body.result = params.result;
|
|
93
|
+
if (params.severity)
|
|
94
|
+
body.severity = params.severity;
|
|
95
|
+
if (params.findings !== undefined)
|
|
96
|
+
body.findings = params.findings;
|
|
97
|
+
if (params.automatable !== undefined)
|
|
98
|
+
body.automatable = params.automatable;
|
|
99
|
+
if (params.automation_tool !== undefined)
|
|
100
|
+
body.automationTool = params.automation_tool;
|
|
101
|
+
data = await apiClient.patch(`/api/threat-models/${threat_model_id}/test-cases/${test_case_id}`, body);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
data = await apiClient.del(`/api/threat-models/${threat_model_id}/test-cases/${test_case_id}`);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
content: [{ type: "text", text: JSON.stringify(sanitizeResponse(data), null, 2) }],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
const message = err instanceof Error ? err.message : "Failed to manage test case";
|
|
112
|
+
return {
|
|
113
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
114
|
+
isError: true,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=manage-test-case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-test-case.js","sourceRoot":"","sources":["../../../src/tools/enterprise/manage-test-case.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;qDAOS,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IACpH,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACjF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC3F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD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AAM,CAAC,QAAQ,KAAK,SAAS;oBAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACnE,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS;oBAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;gBAC5E,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS;oBAAE,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC;gBAEvF,IAAI,GAAG,MAAM,SAAS,CAAC,KAAK,CAC1B,sBAAsB,eAAe,eAAe,YAAY,EAAE,EAClE,IAAI,CACL,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,MAAM,SAAS,CAAC,GAAG,CACxB,sBAAsB,eAAe,eAAe,YAAY,EAAE,CACnE,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5F,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC;YAClF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_promote_finding_to_issue — Promote campaign findings to report issues
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/reports/:reportId/issues/promote
|
|
5
|
+
* Also uses: POST /api/reports/for-campaign/:campaignId to auto-create report
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { ApiClient } from "../../api-client.js";
|
|
9
|
+
export declare const PROMOTE_FINDING_TO_ISSUE_NAME = "zivis_promote_finding_to_issue";
|
|
10
|
+
export declare const PROMOTE_FINDING_TO_ISSUE_DESCRIPTION = "Promote one or more campaign findings to a report issue for the remediation checklist.\n\nCreates a curated report issue from raw scan findings. Multiple findings can be grouped into a single issue (e.g., same root cause across different URLs). The issue gets its own title, description, and recommendation that can differ from the raw finding.\n\nIf no report exists for the campaign yet, one is automatically created.\n\nUse this after reviewing findings to build the official pen test report.";
|
|
11
|
+
export declare const PROMOTE_FINDING_TO_ISSUE_SCHEMA: {
|
|
12
|
+
campaign_id: z.ZodString;
|
|
13
|
+
finding_ids: z.ZodArray<z.ZodString>;
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
recommendation: z.ZodOptional<z.ZodString>;
|
|
17
|
+
};
|
|
18
|
+
export declare function createPromoteFindingToIssueHandler(apiClient: ApiClient): (params: {
|
|
19
|
+
campaign_id: string;
|
|
20
|
+
finding_ids: string[];
|
|
21
|
+
title?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
recommendation?: string;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError: boolean;
|
|
30
|
+
} | {
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError?: undefined;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_promote_finding_to_issue — Promote campaign findings to report issues
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/reports/:reportId/issues/promote
|
|
5
|
+
* Also uses: POST /api/reports/for-campaign/:campaignId to auto-create report
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
9
|
+
export const PROMOTE_FINDING_TO_ISSUE_NAME = "zivis_promote_finding_to_issue";
|
|
10
|
+
export const PROMOTE_FINDING_TO_ISSUE_DESCRIPTION = `Promote one or more campaign findings to a report issue for the remediation checklist.
|
|
11
|
+
|
|
12
|
+
Creates a curated report issue from raw scan findings. Multiple findings can be grouped into a single issue (e.g., same root cause across different URLs). The issue gets its own title, description, and recommendation that can differ from the raw finding.
|
|
13
|
+
|
|
14
|
+
If no report exists for the campaign yet, one is automatically created.
|
|
15
|
+
|
|
16
|
+
Use this after reviewing findings to build the official pen test report.`;
|
|
17
|
+
export const PROMOTE_FINDING_TO_ISSUE_SCHEMA = {
|
|
18
|
+
campaign_id: z.string().describe("Campaign UUID — used to find or create the campaign report"),
|
|
19
|
+
finding_ids: z.array(z.string()).min(1).describe("Array of CampaignFinding UUIDs to promote"),
|
|
20
|
+
title: z.string().optional().describe("Custom issue title (defaults to finding title)"),
|
|
21
|
+
description: z.string().optional().describe("Custom issue description"),
|
|
22
|
+
recommendation: z.string().optional().describe("Custom remediation recommendation"),
|
|
23
|
+
};
|
|
24
|
+
export function createPromoteFindingToIssueHandler(apiClient) {
|
|
25
|
+
return async (params) => {
|
|
26
|
+
try {
|
|
27
|
+
// Step 1: Get or create the report for this campaign
|
|
28
|
+
const reportData = await apiClient.post(`/api/reports/for-campaign/${params.campaign_id}`, {});
|
|
29
|
+
const reportId = reportData.reportId;
|
|
30
|
+
if (!reportId) {
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: "text", text: "Error: Could not get or create report for campaign" }],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
// Step 2: Promote findings to an issue
|
|
37
|
+
const issue = await apiClient.post(`/api/reports/${reportId}/issues/promote`, {
|
|
38
|
+
campaignFindingIds: params.finding_ids,
|
|
39
|
+
title: params.title,
|
|
40
|
+
description: params.description,
|
|
41
|
+
recommendation: params.recommendation,
|
|
42
|
+
});
|
|
43
|
+
const result = sanitizeResponse({
|
|
44
|
+
issue,
|
|
45
|
+
reportId,
|
|
46
|
+
nextSteps: [
|
|
47
|
+
"Issue added to remediation checklist.",
|
|
48
|
+
"Use zivis_list_report_issues to see all issues.",
|
|
49
|
+
"Use zivis_update_report_issue to change status (open → in_progress → done).",
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
const message = err instanceof Error ? err.message : "Failed to promote finding to issue";
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
60
|
+
isError: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=promote-finding-to-issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote-finding-to-issue.js","sourceRoot":"","sources":["../../../src/tools/enterprise/promote-finding-to-issue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,6BAA6B,GAAG,gCAAgC,CAAC;AAE9E,MAAM,CAAC,MAAM,oCAAoC,GAAG;;;;;;yEAMqB,CAAC;AAE1E,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IAC9F,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CA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AAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,oCAAoC,CAAC;YAC1F,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_publish_report_version — Publish a report version and optionally export PDF
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/reports/:reportId/publish
|
|
5
|
+
* + POST /api/reports/:reportId/export (optional)
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { ApiClient } from "../../api-client.js";
|
|
9
|
+
export declare const PUBLISH_REPORT_VERSION_NAME = "zivis_publish_report_version";
|
|
10
|
+
export declare const PUBLISH_REPORT_VERSION_DESCRIPTION = "Publish a new version of the campaign report and optionally export as PDF.\n\nPublishing creates an immutable snapshot of the current report state (all sections, issues, remediation status). Each version gets a version number and optional changelog.\n\nUse this when the report is ready for delivery or when you want to checkpoint progress.\n\nWorkflow: Write sections \u2192 promote findings \u2192 publish version \u2192 export PDF.";
|
|
11
|
+
export declare const PUBLISH_REPORT_VERSION_SCHEMA: {
|
|
12
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
13
|
+
report_id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
15
|
+
export_pdf: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
};
|
|
17
|
+
export declare function createPublishReportVersionHandler(apiClient: ApiClient): (params: {
|
|
18
|
+
campaign_id?: string;
|
|
19
|
+
report_id?: string;
|
|
20
|
+
changelog?: string;
|
|
21
|
+
export_pdf?: boolean;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
isError: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
content: {
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
isError?: undefined;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_publish_report_version — Publish a report version and optionally export PDF
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/reports/:reportId/publish
|
|
5
|
+
* + POST /api/reports/:reportId/export (optional)
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
9
|
+
export const PUBLISH_REPORT_VERSION_NAME = "zivis_publish_report_version";
|
|
10
|
+
export const PUBLISH_REPORT_VERSION_DESCRIPTION = `Publish a new version of the campaign report and optionally export as PDF.
|
|
11
|
+
|
|
12
|
+
Publishing creates an immutable snapshot of the current report state (all sections, issues, remediation status). Each version gets a version number and optional changelog.
|
|
13
|
+
|
|
14
|
+
Use this when the report is ready for delivery or when you want to checkpoint progress.
|
|
15
|
+
|
|
16
|
+
Workflow: Write sections → promote findings → publish version → export PDF.`;
|
|
17
|
+
export const PUBLISH_REPORT_VERSION_SCHEMA = {
|
|
18
|
+
campaign_id: z.string().optional().describe("Campaign UUID — auto-resolves to report"),
|
|
19
|
+
report_id: z.string().optional().describe("Report UUID (alternative to campaign_id)"),
|
|
20
|
+
changelog: z.string().optional().describe("What changed in this version (e.g., 'Added SQL injection findings')"),
|
|
21
|
+
export_pdf: z.boolean().default(false).describe("Also trigger PDF export after publishing"),
|
|
22
|
+
};
|
|
23
|
+
export function createPublishReportVersionHandler(apiClient) {
|
|
24
|
+
return async (params) => {
|
|
25
|
+
try {
|
|
26
|
+
let reportId = params.report_id;
|
|
27
|
+
// Resolve campaign → report if needed
|
|
28
|
+
if (!reportId && params.campaign_id) {
|
|
29
|
+
const reportData = await apiClient.post(`/api/reports/for-campaign/${params.campaign_id}`, {});
|
|
30
|
+
reportId = reportData.reportId;
|
|
31
|
+
}
|
|
32
|
+
if (!reportId) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: "Error: Provide either campaign_id or report_id" }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
// Publish version
|
|
39
|
+
const version = await apiClient.post(`/api/reports/${reportId}/publish`, { changelog: params.changelog });
|
|
40
|
+
// Optionally export PDF
|
|
41
|
+
let pdfExport = null;
|
|
42
|
+
if (params.export_pdf) {
|
|
43
|
+
try {
|
|
44
|
+
pdfExport = await apiClient.post(`/api/reports/${reportId}/export`, {});
|
|
45
|
+
}
|
|
46
|
+
catch (pdfErr) {
|
|
47
|
+
console.error("PDF export failed:", pdfErr);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const result = sanitizeResponse({
|
|
51
|
+
version,
|
|
52
|
+
pdfExport,
|
|
53
|
+
reportId,
|
|
54
|
+
nextSteps: [
|
|
55
|
+
"Version published successfully.",
|
|
56
|
+
pdfExport
|
|
57
|
+
? "PDF export triggered. Check status with zivis_get_report_status."
|
|
58
|
+
: "Use export_pdf: true to generate a PDF.",
|
|
59
|
+
"View the report at the campaign's Report tab in the platform.",
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const message = err instanceof Error ? err.message : "Failed to publish report version";
|
|
68
|
+
return {
|
|
69
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
70
|
+
isError: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=publish-report-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-report-version.js","sourceRoot":"","sources":["../../../src/tools/enterprise/publish-report-version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,2BAA2B,GAAG,8BAA8B,CAAC;AAE1E,MAAM,CAAC,MAAM,kCAAkC,GAAG;;;;;;4EAM0B,CAAC;AAE7E,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACtF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IACrF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IAChH,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC5F,CAAC;AAEF,MAAM,UAAU,iCAAiC,CAAC,SAAoB;IACpE,OAAO,KAAK,EAAE,MAKb,EAAE,EAAE;QACH,IAAI,CAAC;YACH,IAAI,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;YAEhC,sCAAsC;YACtC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;gBACpC,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,IAAI,CACrC,6BAA6B,MAAM,CAAC,WAAW,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AAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC;YACxF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_publish_test_to_library — Publish a manual test to the agent test case library
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/pentest-sessions/:id/results/:resultId/publish
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const PUBLISH_TEST_TO_LIBRARY_NAME = "zivis_publish_test_to_library";
|
|
9
|
+
export declare const PUBLISH_TEST_TO_LIBRARY_DESCRIPTION = "Publish a manual test result to the ZIVIS agent test case library.\n\nWhen you discover a good test case during manual pen testing, use this to make it available to automated ZIVIS agents (pen test agent, red team agent). The test case will be added to the specified agent instance's test library with source=\"user\".";
|
|
10
|
+
export declare const PUBLISH_TEST_TO_LIBRARY_SCHEMA: {
|
|
11
|
+
session_id: z.ZodString;
|
|
12
|
+
result_id: z.ZodString;
|
|
13
|
+
agent_instance_id: z.ZodString;
|
|
14
|
+
};
|
|
15
|
+
export declare function createPublishTestToLibraryHandler(apiClient: ApiClient): (params: {
|
|
16
|
+
session_id: string;
|
|
17
|
+
result_id: string;
|
|
18
|
+
agent_instance_id: string;
|
|
19
|
+
}) => Promise<{
|
|
20
|
+
content: {
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
isError?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
content: {
|
|
27
|
+
type: "text";
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
isError: boolean;
|
|
31
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_publish_test_to_library — Publish a manual test to the agent test case library
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/pentest-sessions/:id/results/:resultId/publish
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const PUBLISH_TEST_TO_LIBRARY_NAME = "zivis_publish_test_to_library";
|
|
9
|
+
export const PUBLISH_TEST_TO_LIBRARY_DESCRIPTION = `Publish a manual test result to the ZIVIS agent test case library.
|
|
10
|
+
|
|
11
|
+
When you discover a good test case during manual pen testing, use this to make it available to automated ZIVIS agents (pen test agent, red team agent). The test case will be added to the specified agent instance's test library with source="user".`;
|
|
12
|
+
export const PUBLISH_TEST_TO_LIBRARY_SCHEMA = {
|
|
13
|
+
session_id: z.string().describe("Pen test session UUID"),
|
|
14
|
+
result_id: z.string().describe("Test result UUID to publish"),
|
|
15
|
+
agent_instance_id: z.string().describe("Agent instance UUID to add the test case to"),
|
|
16
|
+
};
|
|
17
|
+
export function createPublishTestToLibraryHandler(apiClient) {
|
|
18
|
+
return async (params) => {
|
|
19
|
+
try {
|
|
20
|
+
const data = await apiClient.post(`/api/pentest-sessions/${params.session_id}/results/${params.result_id}/publish`, { agentInstanceId: params.agent_instance_id });
|
|
21
|
+
const sanitized = sanitizeResponse(data);
|
|
22
|
+
return {
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: JSON.stringify(sanitized, null, 2),
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
const message = err instanceof Error ? err.message : "Failed to publish test to library";
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=publish-test-to-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-test-to-library.js","sourceRoot":"","sources":["../../../src/tools/enterprise/publish-test-to-library.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAE5E,MAAM,CAAC,MAAM,mCAAmC,GAAG;;uPAEoM,CAAC;AAExP,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC7D,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;CACtF,CAAC;AAEF,MAAM,UAAU,iCAAiC,CAAC,SAAoB;IACpE,OAAO,KAAK,EAAE,MAIb,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAC/B,yBAAyB,MAAM,CAAC,UAAU,YAAY,MAAM,CAAC,SAAS,UAAU,EAChF,EAAE,eAAe,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAC9C,CAAC;YAEF,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAEzC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;qBACzC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAmC,CAAC;YACzF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_record_test_result — Record a test result in a pen test session
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/pentest-sessions/:id/results
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const RECORD_TEST_RESULT_NAME = "zivis_record_test_result";
|
|
9
|
+
export declare const RECORD_TEST_RESULT_DESCRIPTION = "Record the result of a specific test within a pen test session.\n\nAfter running a manual test (e.g., SQL injection attempt, auth bypass), use this tool to log the outcome. If the test is linked to a threat model test case, the test case result will be updated automatically.\n\nInclude evidence IDs from zivis_capture_evidence to link screenshots or terminal output to the result.";
|
|
10
|
+
export declare const RECORD_TEST_RESULT_SCHEMA: {
|
|
11
|
+
session_id: z.ZodString;
|
|
12
|
+
test_name: z.ZodString;
|
|
13
|
+
result: z.ZodEnum<{
|
|
14
|
+
partial: "partial";
|
|
15
|
+
not_tested: "not_tested";
|
|
16
|
+
pass: "pass";
|
|
17
|
+
fail: "fail";
|
|
18
|
+
blocked: "blocked";
|
|
19
|
+
}>;
|
|
20
|
+
test_description: z.ZodOptional<z.ZodString>;
|
|
21
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
critical: "critical";
|
|
23
|
+
high: "high";
|
|
24
|
+
medium: "medium";
|
|
25
|
+
low: "low";
|
|
26
|
+
info: "info";
|
|
27
|
+
}>>;
|
|
28
|
+
findings: z.ZodOptional<z.ZodString>;
|
|
29
|
+
steps_performed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
|
+
step: z.ZodNumber;
|
|
31
|
+
action: z.ZodString;
|
|
32
|
+
expected: z.ZodString;
|
|
33
|
+
actual: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
evidence_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
test_case_id: z.ZodOptional<z.ZodString>;
|
|
37
|
+
threat_finding_id: z.ZodOptional<z.ZodString>;
|
|
38
|
+
};
|
|
39
|
+
export declare function createRecordTestResultHandler(apiClient: ApiClient): (params: {
|
|
40
|
+
session_id: string;
|
|
41
|
+
test_name: string;
|
|
42
|
+
result: string;
|
|
43
|
+
test_description?: string;
|
|
44
|
+
severity?: string;
|
|
45
|
+
findings?: string;
|
|
46
|
+
steps_performed?: Array<{
|
|
47
|
+
step: number;
|
|
48
|
+
action: string;
|
|
49
|
+
expected: string;
|
|
50
|
+
actual?: string;
|
|
51
|
+
}>;
|
|
52
|
+
evidence_ids?: string[];
|
|
53
|
+
test_case_id?: string;
|
|
54
|
+
threat_finding_id?: string;
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
content: {
|
|
57
|
+
type: "text";
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
isError?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
content: {
|
|
63
|
+
type: "text";
|
|
64
|
+
text: string;
|
|
65
|
+
}[];
|
|
66
|
+
isError: boolean;
|
|
67
|
+
}>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_record_test_result — Record a test result in a pen test session
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST /api/pentest-sessions/:id/results
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const RECORD_TEST_RESULT_NAME = "zivis_record_test_result";
|
|
9
|
+
export const RECORD_TEST_RESULT_DESCRIPTION = `Record the result of a specific test within a pen test session.
|
|
10
|
+
|
|
11
|
+
After running a manual test (e.g., SQL injection attempt, auth bypass), use this tool to log the outcome. If the test is linked to a threat model test case, the test case result will be updated automatically.
|
|
12
|
+
|
|
13
|
+
Include evidence IDs from zivis_capture_evidence to link screenshots or terminal output to the result.`;
|
|
14
|
+
export const RECORD_TEST_RESULT_SCHEMA = {
|
|
15
|
+
session_id: z.string().describe("Pen test session UUID"),
|
|
16
|
+
test_name: z.string().describe("Name of the test performed"),
|
|
17
|
+
result: z
|
|
18
|
+
.enum(["pass", "fail", "partial", "blocked", "not_tested"])
|
|
19
|
+
.describe("Test result (pass = no vulnerability found, fail = vulnerability confirmed)"),
|
|
20
|
+
test_description: z.string().optional().describe("Description of what was tested"),
|
|
21
|
+
severity: z
|
|
22
|
+
.enum(["critical", "high", "medium", "low", "info"])
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Severity if vulnerability found (typically set when result is 'fail')"),
|
|
25
|
+
findings: z.string().optional().describe("Description of what was discovered"),
|
|
26
|
+
steps_performed: z
|
|
27
|
+
.array(z.object({
|
|
28
|
+
step: z.number(),
|
|
29
|
+
action: z.string(),
|
|
30
|
+
expected: z.string(),
|
|
31
|
+
actual: z.string().optional(),
|
|
32
|
+
}))
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Steps performed during the test"),
|
|
35
|
+
evidence_ids: z
|
|
36
|
+
.array(z.string())
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Evidence UUIDs to link to this result (from zivis_capture_evidence)"),
|
|
39
|
+
test_case_id: z.string().optional().describe("Threat model test case UUID (auto-updates the test case result)"),
|
|
40
|
+
threat_finding_id: z.string().optional().describe("Existing threat finding UUID to link this result to"),
|
|
41
|
+
};
|
|
42
|
+
export function createRecordTestResultHandler(apiClient) {
|
|
43
|
+
return async (params) => {
|
|
44
|
+
try {
|
|
45
|
+
const data = await apiClient.post(`/api/pentest-sessions/${params.session_id}/results`, {
|
|
46
|
+
testName: params.test_name,
|
|
47
|
+
result: params.result,
|
|
48
|
+
testDescription: params.test_description,
|
|
49
|
+
severity: params.severity,
|
|
50
|
+
findings: params.findings,
|
|
51
|
+
stepsPerformed: params.steps_performed,
|
|
52
|
+
evidenceIds: params.evidence_ids,
|
|
53
|
+
testCaseId: params.test_case_id,
|
|
54
|
+
threatFindingId: params.threat_finding_id,
|
|
55
|
+
});
|
|
56
|
+
const sanitized = sanitizeResponse(data);
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: JSON.stringify(sanitized, null, 2),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const message = err instanceof Error ? err.message : "Failed to record test result";
|
|
68
|
+
return {
|
|
69
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
70
|
+
isError: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=record-test-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-test-result.js","sourceRoot":"","sources":["../../../src/tools/enterprise/record-test-result.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;uGAIyD,CAAC;AAExG,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAA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
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const START_PENTEST_SESSION_NAME = "zivis_start_pentest_session";
|
|
9
|
+
export declare const START_PENTEST_SESSION_DESCRIPTION = "Start a new manual pen test session. This creates a tracking record for your pen testing work in Claude Code.\n\nOptionally link the session to a threat model and/or campaign for organizational context. Test results recorded during this session will be tracked and can be published to the agent test case library.\n\nReturns the session ID which you'll need for recording test results and ending the session.";
|
|
10
|
+
export declare const START_PENTEST_SESSION_SCHEMA: {
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
tester_name: z.ZodString;
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
threat_model_id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
};
|
|
17
|
+
export declare function createStartPentestSessionHandler(apiClient: ApiClient): (params: {
|
|
18
|
+
name: string;
|
|
19
|
+
tester_name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
threat_model_id?: string;
|
|
22
|
+
campaign_id?: string;
|
|
23
|
+
}) => Promise<{
|
|
24
|
+
content: {
|
|
25
|
+
type: "text";
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
isError?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
content: {
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
isError: boolean;
|
|
35
|
+
}>;
|