@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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_get_report_status — Check report generation and PDF export status
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/reports/:id
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const GET_REPORT_STATUS_NAME = "zivis_get_report_status";
|
|
9
|
+
export declare const GET_REPORT_STATUS_DESCRIPTION = "Check the status of a report, including content generation progress and PDF export status.\n\nUse this after calling zivis_generate_report to monitor progress.";
|
|
10
|
+
export declare const GET_REPORT_STATUS_SCHEMA: {
|
|
11
|
+
report_id: z.ZodString;
|
|
12
|
+
};
|
|
13
|
+
export declare function createGetReportStatusHandler(apiClient: ApiClient): (params: {
|
|
14
|
+
report_id: string;
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
content: {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[];
|
|
20
|
+
isError?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
content: {
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
isError: boolean;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_get_report_status — Check report generation and PDF export status
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/reports/:id
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const GET_REPORT_STATUS_NAME = "zivis_get_report_status";
|
|
9
|
+
export const GET_REPORT_STATUS_DESCRIPTION = `Check the status of a report, including content generation progress and PDF export status.
|
|
10
|
+
|
|
11
|
+
Use this after calling zivis_generate_report to monitor progress.`;
|
|
12
|
+
export const GET_REPORT_STATUS_SCHEMA = {
|
|
13
|
+
report_id: z.string().describe("Report UUID to check status for"),
|
|
14
|
+
};
|
|
15
|
+
export function createGetReportStatusHandler(apiClient) {
|
|
16
|
+
return async (params) => {
|
|
17
|
+
try {
|
|
18
|
+
const data = await apiClient.get(`/api/reports/${params.report_id}`);
|
|
19
|
+
const sanitized = sanitizeResponse(data);
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify(sanitized, null, 2),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const message = err instanceof Error ? err.message : "Failed to get report status";
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=get-report-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-report-status.js","sourceRoot":"","sources":["../../../src/tools/enterprise/get-report-status.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,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE,MAAM,CAAC,MAAM,6BAA6B,GAAG;;kEAEqB,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CAClE,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,SAAoB;IAC/D,OAAO,KAAK,EAAE,MAA6B,EAAE,EAAE;QAC7C,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,GAAG,CAC9B,gBAAgB,MAAM,CAAC,SAAS,EAAE,CACnC,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,6BAA6B,CAAC;YACnF,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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_get_threat_model — Get a threat model with all entities
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/threat-models/:id
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const GET_THREAT_MODEL_NAME = "zivis_get_threat_model";
|
|
9
|
+
export declare const GET_THREAT_MODEL_DESCRIPTION = "Get a threat model with ALL its entities \u2014 actors, components, data flows, attack scenarios, security controls, data assets, test cases, findings, AND any linked diagrams.\n\nReturns the complete threat model including:\n- **Actors**: Who interacts with the system (external users, attackers, internal services)\n- **Components**: System parts (APIs, databases, frontends, services) with technology and trust level\n- **Data Flows**: How data moves between components (protocol, encryption, auth mechanism)\n- **Attack Scenarios**: STRIDE-categorized threats with severity, likelihood, attack vectors\n- **Security Controls**: Existing mitigations (preventive, detective, corrective) with effectiveness\n- **Data Assets**: What sensitive data exists and how it's classified\n- **Test Cases**: Security tests with results (pass/fail/partial/not_tested)\n- **Findings**: Discovered vulnerabilities with severity and remediation recommendations\n- **Linked Diagrams**: Architecture, data flow, trust boundary, and other diagrams associated with this threat model\n\nIMPORTANT: The threat_model_id must be a threat model UUID from zivis_list_threat_models, NOT a scan ID or agent instance ID.\n\nUse this to understand the full security posture before making changes, adding entities, or running pen tests.\nAfter viewing, use zivis_manage_actor, zivis_manage_component, zivis_manage_data_flow, etc. to add or update entities.\nUse zivis_get_diagram with a diagram_id from the linked_diagrams to view full diagram details (nodes, connections, boundaries).";
|
|
10
|
+
export declare const GET_THREAT_MODEL_SCHEMA: {
|
|
11
|
+
threat_model_id: z.ZodString;
|
|
12
|
+
include_test_cases: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
};
|
|
14
|
+
export declare function createGetThreatModelHandler(apiClient: ApiClient): (params: {
|
|
15
|
+
threat_model_id: string;
|
|
16
|
+
include_test_cases?: boolean;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
content: {
|
|
19
|
+
type: "text";
|
|
20
|
+
text: string;
|
|
21
|
+
}[];
|
|
22
|
+
isError?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
content: {
|
|
25
|
+
type: "text";
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
isError: boolean;
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_get_threat_model — Get a threat model with all entities
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/threat-models/:id
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const GET_THREAT_MODEL_NAME = "zivis_get_threat_model";
|
|
9
|
+
export const GET_THREAT_MODEL_DESCRIPTION = `Get a threat model with ALL its entities — actors, components, data flows, attack scenarios, security controls, data assets, test cases, findings, AND any linked diagrams.
|
|
10
|
+
|
|
11
|
+
Returns the complete threat model including:
|
|
12
|
+
- **Actors**: Who interacts with the system (external users, attackers, internal services)
|
|
13
|
+
- **Components**: System parts (APIs, databases, frontends, services) with technology and trust level
|
|
14
|
+
- **Data Flows**: How data moves between components (protocol, encryption, auth mechanism)
|
|
15
|
+
- **Attack Scenarios**: STRIDE-categorized threats with severity, likelihood, attack vectors
|
|
16
|
+
- **Security Controls**: Existing mitigations (preventive, detective, corrective) with effectiveness
|
|
17
|
+
- **Data Assets**: What sensitive data exists and how it's classified
|
|
18
|
+
- **Test Cases**: Security tests with results (pass/fail/partial/not_tested)
|
|
19
|
+
- **Findings**: Discovered vulnerabilities with severity and remediation recommendations
|
|
20
|
+
- **Linked Diagrams**: Architecture, data flow, trust boundary, and other diagrams associated with this threat model
|
|
21
|
+
|
|
22
|
+
IMPORTANT: The threat_model_id must be a threat model UUID from zivis_list_threat_models, NOT a scan ID or agent instance ID.
|
|
23
|
+
|
|
24
|
+
Use this to understand the full security posture before making changes, adding entities, or running pen tests.
|
|
25
|
+
After viewing, use zivis_manage_actor, zivis_manage_component, zivis_manage_data_flow, etc. to add or update entities.
|
|
26
|
+
Use zivis_get_diagram with a diagram_id from the linked_diagrams to view full diagram details (nodes, connections, boundaries).`;
|
|
27
|
+
export const GET_THREAT_MODEL_SCHEMA = {
|
|
28
|
+
threat_model_id: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe("Threat model UUID (from zivis_list_threat_models, NOT a scan ID or agent ID)"),
|
|
31
|
+
include_test_cases: z
|
|
32
|
+
.boolean()
|
|
33
|
+
.default(true)
|
|
34
|
+
.describe("Whether to include test cases in the response"),
|
|
35
|
+
};
|
|
36
|
+
export function createGetThreatModelHandler(apiClient) {
|
|
37
|
+
return async (params) => {
|
|
38
|
+
try {
|
|
39
|
+
// Fetch threat model and linked diagrams in parallel
|
|
40
|
+
const [threatModelData, diagramsData] = await Promise.all([
|
|
41
|
+
apiClient.get(`/api/threat-models/${params.threat_model_id}?include=all`),
|
|
42
|
+
apiClient
|
|
43
|
+
.get(`/api/diagrams?linkedThreatModelId=${params.threat_model_id}&take=50`)
|
|
44
|
+
.catch(() => ({ diagrams: [], total: 0 })),
|
|
45
|
+
]);
|
|
46
|
+
const sanitized = sanitizeResponse(threatModelData);
|
|
47
|
+
// Attach linked diagrams summary to the response
|
|
48
|
+
const diagrams = Array.isArray(diagramsData.diagrams)
|
|
49
|
+
? diagramsData.diagrams.map((d) => ({
|
|
50
|
+
diagram_id: d.id,
|
|
51
|
+
name: d.name,
|
|
52
|
+
diagram_type: d.diagramType,
|
|
53
|
+
content_type: d.contentType,
|
|
54
|
+
description: d.description || null,
|
|
55
|
+
node_count: d._count?.nodes ?? null,
|
|
56
|
+
connection_count: d._count?.connections ?? null,
|
|
57
|
+
updated_at: d.updatedAt,
|
|
58
|
+
}))
|
|
59
|
+
: [];
|
|
60
|
+
const result = {
|
|
61
|
+
...sanitized,
|
|
62
|
+
linked_diagrams: diagrams,
|
|
63
|
+
linked_diagrams_count: diagramsData.total,
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
type: "text",
|
|
69
|
+
text: JSON.stringify(result, null, 2),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
const message = err instanceof Error ? err.message : "Failed to get threat model";
|
|
76
|
+
return {
|
|
77
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
78
|
+
isError: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=get-threat-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-threat-model.js","sourceRoot":"","sources":["../../../src/tools/enterprise/get-threat-model.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;;;;;;;;;;;;;;;;;gIAiBoF,CAAC;AAEjI,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,kBAAkB,EAAE,CAAC;SAClB,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,SAAoB;IAC9D,OAAO,KAAK,EAAE,MAAiE,EAAE,EAAE;QACjF,IAAI,CAAC;YACH,qDAAqD;YACrD,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBACxD,SAAS,CAAC,GAAG,CACX,sBAAsB,MAAM,CAAC,eAAe,cAAc,CAC3D;gBACD,SAAS;qBACN,GAAG,CACF,qCAAqC,MAAM,CAAC,eAAe,UAAU,CACtE;qBACA,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aAC7C,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,gBAA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AC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_list_agents — List agent instances for the org
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/agent-instances
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const LIST_AGENTS_NAME = "zivis_list_agents";
|
|
9
|
+
export declare const LIST_AGENTS_DESCRIPTION = "List all configured agent instances for your organization.\n\nIMPORTANT \u2014 Understand the ZIVIS entity hierarchy:\n- **Agent instance** = a configured agent (e.g., \"Production Recon Agent\", \"API Pen Test Agent\"). Each has a UUID, an agent type, a target URL, and configuration. This tool lists these.\n- **Scan** = a single execution run of an agent instance. One agent can have many scans. Use zivis_list_scans to see scan runs.\n- **Threat model** = a structured security model (components, data flows, actors, findings). Created/updated by threat-analysis agent scans. Use zivis_list_threat_models to see these.\n\nAgent types:\n- **recon**: Reconnaissance \u2014 discovers attack surface, endpoints, technologies\n- **pen-test**: Penetration testing \u2014 actively tests for vulnerabilities\n- **ai-red-team**: AI/LLM red teaming \u2014 tests AI systems for prompt injection, jailbreaks, etc.\n- **threat-analysis**: Threat modeling \u2014 builds structured threat models (automated LLM threat ID is pipeline-specific)\n- **code-monitor**: Code monitoring \u2014 continuous scanning of repositories\n- **evidence**: Evidence collection \u2014 gathers compliance evidence\n\nWhen users ask about \"the threat model agent\" or \"the recon agent\", use this tool to find the agent instance, NOT zivis_list_scans.";
|
|
10
|
+
export declare const LIST_AGENTS_SCHEMA: {
|
|
11
|
+
agent_type: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
"pen-test": "pen-test";
|
|
13
|
+
recon: "recon";
|
|
14
|
+
"ai-red-team": "ai-red-team";
|
|
15
|
+
"threat-analysis": "threat-analysis";
|
|
16
|
+
"code-monitor": "code-monitor";
|
|
17
|
+
evidence: "evidence";
|
|
18
|
+
}>>;
|
|
19
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
archived: "archived";
|
|
21
|
+
paused: "paused";
|
|
22
|
+
active: "active";
|
|
23
|
+
}>>;
|
|
24
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
};
|
|
26
|
+
export declare function createListAgentsHandler(apiClient: ApiClient): (params: {
|
|
27
|
+
agent_type?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
limit?: number;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
content: {
|
|
38
|
+
type: "text";
|
|
39
|
+
text: string;
|
|
40
|
+
}[];
|
|
41
|
+
isError: boolean;
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_list_agents — List agent instances for the org
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/agent-instances
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const LIST_AGENTS_NAME = "zivis_list_agents";
|
|
9
|
+
export const LIST_AGENTS_DESCRIPTION = `List all configured agent instances for your organization.
|
|
10
|
+
|
|
11
|
+
IMPORTANT — Understand the ZIVIS entity hierarchy:
|
|
12
|
+
- **Agent instance** = a configured agent (e.g., "Production Recon Agent", "API Pen Test Agent"). Each has a UUID, an agent type, a target URL, and configuration. This tool lists these.
|
|
13
|
+
- **Scan** = a single execution run of an agent instance. One agent can have many scans. Use zivis_list_scans to see scan runs.
|
|
14
|
+
- **Threat model** = a structured security model (components, data flows, actors, findings). Created/updated by threat-analysis agent scans. Use zivis_list_threat_models to see these.
|
|
15
|
+
|
|
16
|
+
Agent types:
|
|
17
|
+
- **recon**: Reconnaissance — discovers attack surface, endpoints, technologies
|
|
18
|
+
- **pen-test**: Penetration testing — actively tests for vulnerabilities
|
|
19
|
+
- **ai-red-team**: AI/LLM red teaming — tests AI systems for prompt injection, jailbreaks, etc.
|
|
20
|
+
- **threat-analysis**: Threat modeling — builds structured threat models (automated LLM threat ID is pipeline-specific)
|
|
21
|
+
- **code-monitor**: Code monitoring — continuous scanning of repositories
|
|
22
|
+
- **evidence**: Evidence collection — gathers compliance evidence
|
|
23
|
+
|
|
24
|
+
When users ask about "the threat model agent" or "the recon agent", use this tool to find the agent instance, NOT zivis_list_scans.`;
|
|
25
|
+
export const LIST_AGENTS_SCHEMA = {
|
|
26
|
+
agent_type: z
|
|
27
|
+
.enum(["pen-test", "ai-red-team", "recon", "threat-analysis", "code-monitor", "evidence"])
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Filter by agent type"),
|
|
30
|
+
status: z
|
|
31
|
+
.enum(["active", "paused", "archived"])
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Filter by agent status"),
|
|
34
|
+
limit: z
|
|
35
|
+
.number()
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(50)
|
|
38
|
+
.default(20)
|
|
39
|
+
.describe("Maximum number of results (1-50, default 20)"),
|
|
40
|
+
};
|
|
41
|
+
export function createListAgentsHandler(apiClient) {
|
|
42
|
+
return async (params) => {
|
|
43
|
+
try {
|
|
44
|
+
const query = new URLSearchParams();
|
|
45
|
+
if (params.agent_type)
|
|
46
|
+
query.set("agentType", params.agent_type);
|
|
47
|
+
if (params.status)
|
|
48
|
+
query.set("status", params.status);
|
|
49
|
+
if (params.limit)
|
|
50
|
+
query.set("limit", String(params.limit));
|
|
51
|
+
query.set("includeOpenStats", "true");
|
|
52
|
+
const queryStr = query.toString();
|
|
53
|
+
const path = `/api/agent-instances${queryStr ? `?${queryStr}` : ""}`;
|
|
54
|
+
const data = await apiClient.get(path);
|
|
55
|
+
const sanitized = sanitizeResponse(data);
|
|
56
|
+
const instances = Array.isArray(sanitized.instances) ? sanitized.instances : [];
|
|
57
|
+
const summary = instances.map((agent) => ({
|
|
58
|
+
agent_instance_id: agent.id,
|
|
59
|
+
name: agent.name,
|
|
60
|
+
agent_type: agent.agentType,
|
|
61
|
+
status: agent.status,
|
|
62
|
+
target_url: agent.targetUrl,
|
|
63
|
+
description: agent.description || null,
|
|
64
|
+
is_enabled: agent.isEnabled,
|
|
65
|
+
last_scan_at: agent.lastScanAt || null,
|
|
66
|
+
created_at: agent.createdAt,
|
|
67
|
+
updated_at: agent.updatedAt,
|
|
68
|
+
open_critical_count: agent.openCriticalCount ?? null,
|
|
69
|
+
open_findings_total: agent.openFindingsTotal ?? null,
|
|
70
|
+
campaigns: Array.isArray(agent.campaignLinks)
|
|
71
|
+
? agent.campaignLinks.map((link) => {
|
|
72
|
+
const campaign = link.campaign;
|
|
73
|
+
return campaign ? { id: campaign.id, name: campaign.name } : null;
|
|
74
|
+
}).filter(Boolean)
|
|
75
|
+
: [],
|
|
76
|
+
}));
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: JSON.stringify({ total: data.total, agents: summary }, null, 2),
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
const message = err instanceof Error ? err.message : "Failed to list agents";
|
|
88
|
+
return {
|
|
89
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=list-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-agents.js","sourceRoot":"","sources":["../../../src/tools/enterprise/list-agents.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,gBAAgB,GAA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AE,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;oBACpE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;oBACpB,CAAC,CAAC,EAAE;aACP,CAAC,CAAC,CAAC;YAEJ,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtE;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,uBAAuB,CAAC;YAC7E,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_list_report_issues — List remediation checklist issues for a campaign report
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/reports/:reportId/issues
|
|
5
|
+
* Also uses: POST /api/reports/for-campaign/:campaignId
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { ApiClient } from "../../api-client.js";
|
|
9
|
+
export declare const LIST_REPORT_ISSUES_NAME = "zivis_list_report_issues";
|
|
10
|
+
export declare const LIST_REPORT_ISSUES_DESCRIPTION = "List all issues in a campaign's remediation checklist with status summary.\n\nReturns issues grouped by severity with stats (open/in_progress/done counts). Use campaign_id to auto-resolve the report, or provide report_id directly.\n\nFilter by status to see only open, in-progress, or completed items.";
|
|
11
|
+
export declare const LIST_REPORT_ISSUES_SCHEMA: {
|
|
12
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
13
|
+
report_id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
open: "open";
|
|
16
|
+
in_progress: "in_progress";
|
|
17
|
+
done: "done";
|
|
18
|
+
}>>;
|
|
19
|
+
};
|
|
20
|
+
export declare function createListReportIssuesHandler(apiClient: ApiClient): (params: {
|
|
21
|
+
campaign_id?: string;
|
|
22
|
+
report_id?: string;
|
|
23
|
+
status?: 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,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_list_report_issues — List remediation checklist issues for a campaign report
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/reports/:reportId/issues
|
|
5
|
+
* Also uses: POST /api/reports/for-campaign/:campaignId
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
9
|
+
export const LIST_REPORT_ISSUES_NAME = "zivis_list_report_issues";
|
|
10
|
+
export const LIST_REPORT_ISSUES_DESCRIPTION = `List all issues in a campaign's remediation checklist with status summary.
|
|
11
|
+
|
|
12
|
+
Returns issues grouped by severity with stats (open/in_progress/done counts). Use campaign_id to auto-resolve the report, or provide report_id directly.
|
|
13
|
+
|
|
14
|
+
Filter by status to see only open, in-progress, or completed items.`;
|
|
15
|
+
export const LIST_REPORT_ISSUES_SCHEMA = {
|
|
16
|
+
campaign_id: z.string().optional().describe("Campaign UUID — auto-resolves to report"),
|
|
17
|
+
report_id: z.string().optional().describe("Report UUID (alternative to campaign_id)"),
|
|
18
|
+
status: z.enum(["open", "in_progress", "done"]).optional().describe("Filter by status"),
|
|
19
|
+
};
|
|
20
|
+
export function createListReportIssuesHandler(apiClient) {
|
|
21
|
+
return async (params) => {
|
|
22
|
+
try {
|
|
23
|
+
let reportId = params.report_id;
|
|
24
|
+
// Resolve campaign → report if needed
|
|
25
|
+
if (!reportId && params.campaign_id) {
|
|
26
|
+
const reportData = await apiClient.post(`/api/reports/for-campaign/${params.campaign_id}`, {});
|
|
27
|
+
reportId = reportData.reportId;
|
|
28
|
+
}
|
|
29
|
+
if (!reportId) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: "Error: Provide either campaign_id or report_id" }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const queryParams = params.status ? `?status=${params.status}` : "";
|
|
36
|
+
const data = await apiClient.get(`/api/reports/${reportId}/issues${queryParams}`);
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: "text", text: JSON.stringify(sanitizeResponse(data), null, 2) }],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const message = err instanceof Error ? err.message : "Failed to list report issues";
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
45
|
+
isError: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=list-report-issues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-report-issues.js","sourceRoot":"","sources":["../../../src/tools/enterprise/list-report-issues.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM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,gBAAgB,QAAQ,UAAU,WAAW,EAAE,CAChD,CAAC;YAEF,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,8BAA8B,CAAC;YACpF,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_list_threat_models — List threat models for the org
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/threat-models
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const LIST_THREAT_MODELS_NAME = "zivis_list_threat_models";
|
|
9
|
+
export declare const LIST_THREAT_MODELS_DESCRIPTION = "List all threat models for your organization. Returns name, status, summary info, and linked diagram counts for each threat model.\n\nAlso fetches any diagrams linked to each threat model, so you can see which threat models have associated architecture, data flow, or trust boundary diagrams. Use zivis_get_threat_model to see full diagram details.\n\nIMPORTANT: Threat models are NOT scans and NOT agents. They are separate entities:\n- A **threat model** (returned here) has its own UUID and contains components, data flows, actors, findings, etc.\n- A **scan** is an agent execution run (from zivis_list_scans) \u2014 scans may CREATE or UPDATE threat models, but scan IDs \u2260 threat model IDs.\n- An **agent instance** is a configured agent (from the UI) \u2014 agents RUN scans which produce threat models.\n\nUse the threat model ID (from this tool's response) when calling zivis_get_threat_model, zivis_manage_component, zivis_manage_finding, etc. Do NOT pass scan IDs or agent instance IDs to those tools.";
|
|
10
|
+
export declare const LIST_THREAT_MODELS_SCHEMA: {
|
|
11
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
draft: "draft";
|
|
13
|
+
analyzing: "analyzing";
|
|
14
|
+
analyzed: "analyzed";
|
|
15
|
+
reviewed: "reviewed";
|
|
16
|
+
approved: "approved";
|
|
17
|
+
archived: "archived";
|
|
18
|
+
}>>;
|
|
19
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
};
|
|
21
|
+
export declare function createListThreatModelsHandler(apiClient: ApiClient): (params: {
|
|
22
|
+
status?: string;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError: boolean;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_list_threat_models — List threat models for the org
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/threat-models
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
+
export const LIST_THREAT_MODELS_NAME = "zivis_list_threat_models";
|
|
9
|
+
export const LIST_THREAT_MODELS_DESCRIPTION = `List all threat models for your organization. Returns name, status, summary info, and linked diagram counts for each threat model.
|
|
10
|
+
|
|
11
|
+
Also fetches any diagrams linked to each threat model, so you can see which threat models have associated architecture, data flow, or trust boundary diagrams. Use zivis_get_threat_model to see full diagram details.
|
|
12
|
+
|
|
13
|
+
IMPORTANT: Threat models are NOT scans and NOT agents. They are separate entities:
|
|
14
|
+
- A **threat model** (returned here) has its own UUID and contains components, data flows, actors, findings, etc.
|
|
15
|
+
- A **scan** is an agent execution run (from zivis_list_scans) — scans may CREATE or UPDATE threat models, but scan IDs ≠ threat model IDs.
|
|
16
|
+
- An **agent instance** is a configured agent (from the UI) — agents RUN scans which produce threat models.
|
|
17
|
+
|
|
18
|
+
Use the threat model ID (from this tool's response) when calling zivis_get_threat_model, zivis_manage_component, zivis_manage_finding, etc. Do NOT pass scan IDs or agent instance IDs to those tools.`;
|
|
19
|
+
export const LIST_THREAT_MODELS_SCHEMA = {
|
|
20
|
+
status: z
|
|
21
|
+
.enum(["draft", "analyzing", "analyzed", "reviewed", "approved", "archived"])
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Filter by threat model status"),
|
|
24
|
+
limit: z
|
|
25
|
+
.number()
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(100)
|
|
28
|
+
.default(20)
|
|
29
|
+
.describe("Maximum number of results (1-100, default 20)"),
|
|
30
|
+
};
|
|
31
|
+
export function createListThreatModelsHandler(apiClient) {
|
|
32
|
+
return async (params) => {
|
|
33
|
+
try {
|
|
34
|
+
const query = new URLSearchParams();
|
|
35
|
+
if (params.status)
|
|
36
|
+
query.set("status", params.status);
|
|
37
|
+
if (params.limit)
|
|
38
|
+
query.set("limit", String(params.limit));
|
|
39
|
+
const queryStr = query.toString();
|
|
40
|
+
const path = `/api/threat-models${queryStr ? `?${queryStr}` : ""}`;
|
|
41
|
+
const data = await apiClient.get(path);
|
|
42
|
+
const sanitized = sanitizeResponse(data);
|
|
43
|
+
// Fetch diagram counts for each threat model in parallel
|
|
44
|
+
const threatModels = Array.isArray(sanitized) ? sanitized : [];
|
|
45
|
+
const diagramCounts = await Promise.all(threatModels.map((tm) => apiClient
|
|
46
|
+
.get(`/api/diagrams?linkedThreatModelId=${tm.id}&take=1`)
|
|
47
|
+
.then((res) => res.total ?? 0)
|
|
48
|
+
.catch(() => 0)));
|
|
49
|
+
// Format with clear ID labeling to prevent confusion with scan/agent IDs
|
|
50
|
+
const summary = Array.isArray(sanitized)
|
|
51
|
+
? sanitized.map((tm, i) => ({
|
|
52
|
+
threat_model_id: tm.id,
|
|
53
|
+
name: tm.name,
|
|
54
|
+
status: tm.status,
|
|
55
|
+
description: tm.description,
|
|
56
|
+
application: tm.applicationName || null,
|
|
57
|
+
campaign: tm.campaignName || null,
|
|
58
|
+
latest_version: tm.latestVersion || null,
|
|
59
|
+
linked_diagrams_count: diagramCounts[i],
|
|
60
|
+
created_at: tm.createdAt,
|
|
61
|
+
updated_at: tm.updatedAt,
|
|
62
|
+
}))
|
|
63
|
+
: sanitized;
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
text: JSON.stringify(summary, null, 2),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
const message = err instanceof Error ? err.message : "Failed to list threat models";
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
77
|
+
isError: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=list-threat-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-threat-models.js","sourceRoot":"","sources":["../../../src/tools/enterprise/list-threat-models.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;;;;;;;;;uMASyJ,CAAC;AAExM,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,O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AAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_manage_actor — Create, update, or delete threat actors in a threat model
|
|
3
|
+
*
|
|
4
|
+
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/actors
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { ApiClient } from "../../api-client.js";
|
|
8
|
+
export declare const MANAGE_ACTOR_NAME = "zivis_manage_actor";
|
|
9
|
+
export declare const MANAGE_ACTOR_DESCRIPTION = "Create, update, or delete a threat actor in a threat model.\n\nThreat actors represent entities that interact with or threaten the system (e.g., external users, attackers, services). Each actor has a trust level, type, and capabilities.\n\nActions:\n- create: Add a new threat actor (requires name, actor_type, trust_level)\n- update: Modify an existing actor (requires actor_id)\n- delete: Remove an actor (requires actor_id)";
|
|
10
|
+
export declare const MANAGE_ACTOR_SCHEMA: {
|
|
11
|
+
threat_model_id: z.ZodString;
|
|
12
|
+
action: z.ZodEnum<{
|
|
13
|
+
create: "create";
|
|
14
|
+
update: "update";
|
|
15
|
+
delete: "delete";
|
|
16
|
+
}>;
|
|
17
|
+
actor_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
name: z.ZodOptional<z.ZodString>;
|
|
19
|
+
actor_type: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
external: "external";
|
|
21
|
+
internal: "internal";
|
|
22
|
+
system: "system";
|
|
23
|
+
third_party: "third_party";
|
|
24
|
+
}>>;
|
|
25
|
+
trust_level: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
high: "high";
|
|
27
|
+
medium: "medium";
|
|
28
|
+
low: "low";
|
|
29
|
+
untrusted: "untrusted";
|
|
30
|
+
privileged: "privileged";
|
|
31
|
+
}>>;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
motivation: z.ZodOptional<z.ZodString>;
|
|
34
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
};
|
|
36
|
+
export declare function createManageActorHandler(apiClient: ApiClient): (params: {
|
|
37
|
+
threat_model_id: string;
|
|
38
|
+
action: "create" | "update" | "delete";
|
|
39
|
+
actor_id?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
actor_type?: string;
|
|
42
|
+
trust_level?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
motivation?: string;
|
|
45
|
+
capabilities?: string[];
|
|
46
|
+
}) => Promise<{
|
|
47
|
+
content: {
|
|
48
|
+
type: "text";
|
|
49
|
+
text: string;
|
|
50
|
+
}[];
|
|
51
|
+
isError: boolean;
|
|
52
|
+
} | {
|
|
53
|
+
content: {
|
|
54
|
+
type: "text";
|
|
55
|
+
text: string;
|
|
56
|
+
}[];
|
|
57
|
+
isError?: undefined;
|
|
58
|
+
}>;
|