@zivis/mcp 0.1.8 → 0.1.10
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/LICENSE +201 -0
- package/README.md +19 -0
- package/dist/api-client.d.ts +2 -24
- package/dist/api-client.js +32 -52
- package/dist/auth/index.d.ts +1 -22
- package/dist/auth/index.js +17 -38
- package/dist/auth/jwt.d.ts +0 -16
- package/dist/auth/jwt.js +0 -13
- package/dist/auth/keychain.d.ts +6 -32
- package/dist/auth/keychain.js +83 -114
- package/dist/auth/oauth.d.ts +3 -32
- package/dist/auth/oauth.js +67 -61
- package/dist/auth/sessions.d.ts +5 -25
- package/dist/auth/sessions.js +20 -39
- package/dist/auth/token-refresh.d.ts +2 -22
- package/dist/auth/token-refresh.js +33 -36
- package/dist/cli.d.ts +1 -18
- package/dist/cli.js +30 -908
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -7
- package/dist/lib/inspect-cache.d.ts +10 -0
- package/dist/lib/inspect-cache.js +75 -0
- package/dist/lib/next-steps.d.ts +27 -0
- package/dist/lib/next-steps.js +21 -0
- package/dist/matcher/ast-eval.d.ts +8 -0
- package/dist/matcher/ast-eval.js +95 -0
- package/dist/matcher/finding.d.ts +55 -0
- package/dist/matcher/finding.js +1 -0
- package/dist/matcher/index.d.ts +8 -0
- package/dist/matcher/index.js +202 -0
- package/dist/matcher/inference-candidates.d.ts +26 -0
- package/dist/matcher/inference-candidates.js +81 -0
- package/dist/matcher/walker.d.ts +7 -0
- package/dist/matcher/walker.js +71 -0
- package/dist/pattern-pack/index.d.ts +125 -0
- package/dist/pattern-pack/index.js +189 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/agents/privilege-separation.yaml +224 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/prompting/self-consistency-no-isolation.yaml +237 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/retrieval/context-injection-no-validator.yaml +348 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/security/late-org-filter.yaml +266 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/external_validator_on_facts.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/fact_validator_present.yaml +68 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/human_approval_gate.yaml +44 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/langgraph_state_machine_with_per_node_tools.yaml +35 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml +38 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/prisma_extension_or_middleware_attaching_org_filter.yaml +31 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/row_level_security_policy.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/source_attribution_present.yaml +58 -0
- package/dist/pattern-packs/zivis-public-0.2.0/manifest.json +167 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/agents/privilege-separation/identify.md +54 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/prompting/self-consistency-no-isolation/identify.md +60 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/retrieval/context-injection-no-validator/identify.md +109 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/security/late-org-filter/identify.md +78 -0
- package/dist/project-binding.d.ts +2 -19
- package/dist/project-binding.js +38 -21
- package/dist/prompts/audit-dependencies.d.ts +2 -0
- package/dist/prompts/audit-dependencies.js +47 -0
- package/dist/prompts/getting-started.d.ts +2 -0
- package/dist/prompts/getting-started.js +37 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.js +6 -0
- package/dist/resolve-application-id.d.ts +0 -4
- package/dist/resolve-application-id.js +0 -5
- package/dist/sanitize.d.ts +1 -21
- package/dist/sanitize.js +7 -41
- package/dist/server.d.ts +1 -13
- package/dist/server.js +142 -265
- package/dist/tools/artifacts.d.ts +76 -0
- package/dist/tools/artifacts.js +178 -0
- package/dist/tools/check-project.d.ts +5 -18
- package/dist/tools/check-project.js +122 -110
- package/dist/tools/check-repo-trust.d.ts +4 -19
- package/dist/tools/check-repo-trust.js +56 -47
- package/dist/tools/create-diagram.d.ts +0 -5
- package/dist/tools/create-diagram.js +0 -10
- package/dist/tools/create-document.d.ts +0 -5
- package/dist/tools/create-document.js +3 -9
- package/dist/tools/create-finding.d.ts +85 -0
- package/dist/tools/create-finding.js +136 -0
- package/dist/tools/delete-finding.d.ts +19 -0
- package/dist/tools/delete-finding.js +36 -0
- package/dist/tools/devx-run.d.ts +88 -0
- package/dist/tools/devx-run.js +175 -0
- package/dist/tools/discover-local-infra.d.ts +0 -10
- package/dist/tools/discover-local-infra.js +3 -73
- package/dist/tools/enterprise/get-org-zat.d.ts +0 -5
- package/dist/tools/enterprise/get-org-zat.js +0 -6
- package/dist/tools/explain-signal-for-diff.d.ts +34 -0
- package/dist/tools/explain-signal-for-diff.js +75 -0
- package/dist/tools/generate-diagram.d.ts +0 -6
- package/dist/tools/generate-diagram.js +21 -13
- package/dist/tools/get-application-overview.d.ts +0 -5
- package/dist/tools/get-application-overview.js +0 -6
- package/dist/tools/get-application.d.ts +0 -5
- package/dist/tools/get-application.js +0 -6
- package/dist/tools/get-diagram.d.ts +0 -5
- package/dist/tools/get-diagram.js +1 -11
- package/dist/tools/get-document.d.ts +0 -5
- package/dist/tools/get-document.js +0 -6
- package/dist/tools/get-oss-zat.d.ts +0 -5
- package/dist/tools/get-oss-zat.js +0 -7
- package/dist/tools/get-signal.d.ts +24 -0
- package/dist/tools/get-signal.js +75 -0
- package/dist/tools/get-started.d.ts +18 -0
- package/dist/tools/get-started.js +470 -0
- package/dist/tools/get-trust-keys.d.ts +0 -5
- package/dist/tools/get-trust-keys.js +0 -6
- package/dist/tools/import-openapi-endpoints.d.ts +0 -5
- package/dist/tools/import-openapi-endpoints.js +0 -6
- package/dist/tools/inspect-zat.d.ts +0 -5
- package/dist/tools/inspect-zat.js +0 -19
- package/dist/tools/inspect.d.ts +21 -0
- package/dist/tools/inspect.js +222 -0
- package/dist/tools/list-applications.d.ts +1 -6
- package/dist/tools/list-applications.js +0 -6
- package/dist/tools/list-diagrams.d.ts +0 -5
- package/dist/tools/list-diagrams.js +0 -6
- package/dist/tools/list-documents.d.ts +0 -5
- package/dist/tools/list-documents.js +0 -6
- package/dist/tools/list-endpoints.d.ts +1 -6
- package/dist/tools/list-endpoints.js +0 -6
- package/dist/tools/list-signals.d.ts +37 -0
- package/dist/tools/list-signals.js +83 -0
- package/dist/tools/manage-application.d.ts +64 -0
- package/dist/tools/manage-application.js +129 -0
- package/dist/tools/manage-diagram.d.ts +0 -5
- package/dist/tools/manage-diagram.js +0 -16
- package/dist/tools/manage-endpoint-lifecycle.d.ts +80 -0
- package/dist/tools/manage-endpoint-lifecycle.js +180 -0
- package/dist/tools/open-in-ide.d.ts +2 -14
- package/dist/tools/open-in-ide.js +0 -13
- package/dist/tools/review-change.d.ts +34 -0
- package/dist/tools/review-change.js +93 -0
- package/dist/tools/security-memory.d.ts +76 -0
- package/dist/tools/security-memory.js +202 -0
- package/dist/tools/security-review.d.ts +1 -21
- package/dist/tools/security-review.js +8 -108
- package/dist/tools/threat-get-capsule.d.ts +15 -0
- package/dist/tools/threat-get-capsule.js +53 -0
- package/dist/tools/threat-get-inference-prompt.d.ts +15 -0
- package/dist/tools/threat-get-inference-prompt.js +73 -0
- package/dist/tools/threat-list-relevant-capsules.d.ts +17 -0
- package/dist/tools/threat-list-relevant-capsules.js +158 -0
- package/dist/tools/threat-run-matcher.d.ts +17 -0
- package/dist/tools/threat-run-matcher.js +145 -0
- package/dist/tools/update-document.d.ts +0 -5
- package/dist/tools/update-document.js +3 -9
- package/dist/tools/update-endpoint.d.ts +1 -6
- package/dist/tools/update-endpoint.js +0 -7
- package/dist/tools/update-finding.d.ts +61 -0
- package/dist/tools/update-finding.js +80 -0
- package/dist/tools/update-mermaid-source.d.ts +0 -13
- package/dist/tools/update-mermaid-source.js +0 -14
- package/dist/tools/verify-trust-mark.d.ts +0 -5
- package/dist/tools/verify-trust-mark.js +0 -6
- package/dist/types.d.ts +14 -14
- package/dist/types.js +22 -28
- package/package.json +38 -15
- package/dist/api-client.js.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/jwt.js.map +0 -1
- package/dist/auth/keychain.js.map +0 -1
- package/dist/auth/oauth.js.map +0 -1
- package/dist/auth/sessions.js.map +0 -1
- package/dist/auth/token-refresh.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/project-binding.js.map +0 -1
- package/dist/resolve-application-id.js.map +0 -1
- package/dist/sanitize.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/check-project.js.map +0 -1
- package/dist/tools/check-repo-trust.js.map +0 -1
- package/dist/tools/create-diagram.js.map +0 -1
- package/dist/tools/create-document.js.map +0 -1
- package/dist/tools/discover-local-infra.js.map +0 -1
- package/dist/tools/enterprise/capture-evidence.d.ts +0 -54
- package/dist/tools/enterprise/capture-evidence.js +0 -72
- package/dist/tools/enterprise/capture-evidence.js.map +0 -1
- package/dist/tools/enterprise/create-report-ticket.d.ts +0 -34
- package/dist/tools/enterprise/create-report-ticket.js +0 -44
- package/dist/tools/enterprise/create-report-ticket.js.map +0 -1
- package/dist/tools/enterprise/end-pentest-session.d.ts +0 -33
- package/dist/tools/enterprise/end-pentest-session.js +0 -42
- package/dist/tools/enterprise/end-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/generate-report.d.ts +0 -55
- package/dist/tools/enterprise/generate-report.js +0 -111
- package/dist/tools/enterprise/generate-report.js.map +0 -1
- package/dist/tools/enterprise/get-org-zat.js.map +0 -1
- package/dist/tools/enterprise/get-report-status.d.ts +0 -27
- package/dist/tools/enterprise/get-report-status.js +0 -38
- package/dist/tools/enterprise/get-report-status.js.map +0 -1
- package/dist/tools/enterprise/get-threat-model.d.ts +0 -29
- package/dist/tools/enterprise/get-threat-model.js +0 -83
- package/dist/tools/enterprise/get-threat-model.js.map +0 -1
- package/dist/tools/enterprise/list-agents.d.ts +0 -42
- package/dist/tools/enterprise/list-agents.js +0 -95
- package/dist/tools/enterprise/list-agents.js.map +0 -1
- package/dist/tools/enterprise/list-report-issues.d.ts +0 -36
- package/dist/tools/enterprise/list-report-issues.js +0 -50
- package/dist/tools/enterprise/list-report-issues.js.map +0 -1
- package/dist/tools/enterprise/list-threat-models.d.ts +0 -36
- package/dist/tools/enterprise/list-threat-models.js +0 -82
- package/dist/tools/enterprise/list-threat-models.js.map +0 -1
- package/dist/tools/enterprise/manage-actor.d.ts +0 -58
- package/dist/tools/enterprise/manage-actor.js +0 -99
- package/dist/tools/enterprise/manage-actor.js.map +0 -1
- package/dist/tools/enterprise/manage-attack-scenario.d.ts +0 -70
- package/dist/tools/enterprise/manage-attack-scenario.js +0 -89
- package/dist/tools/enterprise/manage-attack-scenario.js.map +0 -1
- package/dist/tools/enterprise/manage-component.d.ts +0 -58
- package/dist/tools/enterprise/manage-component.js +0 -90
- package/dist/tools/enterprise/manage-component.js.map +0 -1
- package/dist/tools/enterprise/manage-data-asset.d.ts +0 -53
- package/dist/tools/enterprise/manage-data-asset.js +0 -90
- package/dist/tools/enterprise/manage-data-asset.js.map +0 -1
- package/dist/tools/enterprise/manage-data-flow.d.ts +0 -57
- package/dist/tools/enterprise/manage-data-flow.js +0 -98
- package/dist/tools/enterprise/manage-data-flow.js.map +0 -1
- package/dist/tools/enterprise/manage-finding.d.ts +0 -69
- package/dist/tools/enterprise/manage-finding.js +0 -106
- package/dist/tools/enterprise/manage-finding.js.map +0 -1
- package/dist/tools/enterprise/manage-security-control.d.ts +0 -59
- package/dist/tools/enterprise/manage-security-control.js +0 -96
- package/dist/tools/enterprise/manage-security-control.js.map +0 -1
- package/dist/tools/enterprise/manage-test-case.d.ts +0 -88
- package/dist/tools/enterprise/manage-test-case.js +0 -119
- package/dist/tools/enterprise/manage-test-case.js.map +0 -1
- package/dist/tools/enterprise/promote-finding-to-issue.d.ts +0 -36
- package/dist/tools/enterprise/promote-finding-to-issue.js +0 -65
- package/dist/tools/enterprise/promote-finding-to-issue.js.map +0 -1
- package/dist/tools/enterprise/publish-report-version.d.ts +0 -34
- package/dist/tools/enterprise/publish-report-version.js +0 -75
- package/dist/tools/enterprise/publish-report-version.js.map +0 -1
- package/dist/tools/enterprise/publish-test-to-library.d.ts +0 -31
- package/dist/tools/enterprise/publish-test-to-library.js +0 -40
- package/dist/tools/enterprise/publish-test-to-library.js.map +0 -1
- package/dist/tools/enterprise/record-test-result.d.ts +0 -67
- package/dist/tools/enterprise/record-test-result.js +0 -75
- package/dist/tools/enterprise/record-test-result.js.map +0 -1
- package/dist/tools/enterprise/start-pentest-session.d.ts +0 -35
- package/dist/tools/enterprise/start-pentest-session.js +0 -50
- package/dist/tools/enterprise/start-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/sync-report-section.d.ts +0 -41
- package/dist/tools/enterprise/sync-report-section.js +0 -79
- package/dist/tools/enterprise/sync-report-section.js.map +0 -1
- package/dist/tools/enterprise/update-report-issue.d.ts +0 -55
- package/dist/tools/enterprise/update-report-issue.js +0 -69
- package/dist/tools/enterprise/update-report-issue.js.map +0 -1
- package/dist/tools/generate-diagram.js.map +0 -1
- package/dist/tools/get-agent-test-results.d.ts +0 -41
- package/dist/tools/get-agent-test-results.js +0 -86
- package/dist/tools/get-agent-test-results.js.map +0 -1
- package/dist/tools/get-application-overview.js.map +0 -1
- package/dist/tools/get-application.js.map +0 -1
- package/dist/tools/get-artifact-content.d.ts +0 -29
- package/dist/tools/get-artifact-content.js +0 -86
- package/dist/tools/get-artifact-content.js.map +0 -1
- package/dist/tools/get-diagram.js.map +0 -1
- package/dist/tools/get-document.js.map +0 -1
- package/dist/tools/get-finding-details.d.ts +0 -28
- package/dist/tools/get-finding-details.js +0 -43
- package/dist/tools/get-finding-details.js.map +0 -1
- package/dist/tools/get-findings.d.ts +0 -57
- package/dist/tools/get-findings.js +0 -103
- package/dist/tools/get-findings.js.map +0 -1
- package/dist/tools/get-oss-zat.js.map +0 -1
- package/dist/tools/get-recon-scan.d.ts +0 -27
- package/dist/tools/get-recon-scan.js +0 -46
- package/dist/tools/get-recon-scan.js.map +0 -1
- package/dist/tools/get-scan-output.d.ts +0 -27
- package/dist/tools/get-scan-output.js +0 -64
- package/dist/tools/get-scan-output.js.map +0 -1
- package/dist/tools/get-scenario-details.d.ts +0 -27
- package/dist/tools/get-scenario-details.js +0 -46
- package/dist/tools/get-scenario-details.js.map +0 -1
- package/dist/tools/get-test-case-results.d.ts +0 -37
- package/dist/tools/get-test-case-results.js +0 -66
- package/dist/tools/get-test-case-results.js.map +0 -1
- package/dist/tools/get-test-details.d.ts +0 -29
- package/dist/tools/get-test-details.js +0 -49
- package/dist/tools/get-test-details.js.map +0 -1
- package/dist/tools/get-trust-keys.js.map +0 -1
- package/dist/tools/import-openapi-endpoints.js.map +0 -1
- package/dist/tools/inspect-zat.js.map +0 -1
- package/dist/tools/list-agent-test-cases.d.ts +0 -41
- package/dist/tools/list-agent-test-cases.js +0 -73
- package/dist/tools/list-agent-test-cases.js.map +0 -1
- package/dist/tools/list-applications.js.map +0 -1
- package/dist/tools/list-diagrams.js.map +0 -1
- package/dist/tools/list-documents.js.map +0 -1
- package/dist/tools/list-endpoints.js.map +0 -1
- package/dist/tools/list-recon-scans.d.ts +0 -36
- package/dist/tools/list-recon-scans.js +0 -74
- package/dist/tools/list-recon-scans.js.map +0 -1
- package/dist/tools/list-scan-artifacts.d.ts +0 -41
- package/dist/tools/list-scan-artifacts.js +0 -63
- package/dist/tools/list-scan-artifacts.js.map +0 -1
- package/dist/tools/list-scans.d.ts +0 -44
- package/dist/tools/list-scans.js +0 -91
- package/dist/tools/list-scans.js.map +0 -1
- package/dist/tools/list-test-library.d.ts +0 -44
- package/dist/tools/list-test-library.js +0 -83
- package/dist/tools/list-test-library.js.map +0 -1
- package/dist/tools/list-test-scenarios.d.ts +0 -31
- package/dist/tools/list-test-scenarios.js +0 -66
- package/dist/tools/list-test-scenarios.js.map +0 -1
- package/dist/tools/local-scan.d.ts +0 -40
- package/dist/tools/local-scan.js +0 -261
- package/dist/tools/local-scan.js.map +0 -1
- package/dist/tools/manage-diagram.js.map +0 -1
- package/dist/tools/open-in-ide.js.map +0 -1
- package/dist/tools/run-test-scenario.d.ts +0 -37
- package/dist/tools/run-test-scenario.js +0 -70
- package/dist/tools/run-test-scenario.js.map +0 -1
- package/dist/tools/scan-pr.d.ts +0 -27
- package/dist/tools/scan-pr.js +0 -51
- package/dist/tools/scan-pr.js.map +0 -1
- package/dist/tools/security-review.js.map +0 -1
- package/dist/tools/setup-red-team-target.d.ts +0 -79
- package/dist/tools/setup-red-team-target.js +0 -430
- package/dist/tools/setup-red-team-target.js.map +0 -1
- package/dist/tools/triage-finding.d.ts +0 -47
- package/dist/tools/triage-finding.js +0 -116
- package/dist/tools/triage-finding.js.map +0 -1
- package/dist/tools/update-document.js.map +0 -1
- package/dist/tools/update-endpoint.js.map +0 -1
- package/dist/tools/update-mermaid-source.js.map +0 -1
- package/dist/tools/verify-trust-mark.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,iCAA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A+D;iBAChE;aACF,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,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,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"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,67 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CA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,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_start_pentest_session — Start a manual pen test session
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST /api/pentest-sessions
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
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
|
-
}>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_start_pentest_session — Start a manual pen test session
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST /api/pentest-sessions
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
|
-
export const START_PENTEST_SESSION_NAME = "zivis_start_pentest_session";
|
|
9
|
-
export 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.
|
|
10
|
-
|
|
11
|
-
Optionally 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.
|
|
12
|
-
|
|
13
|
-
Returns the session ID which you'll need for recording test results and ending the session.`;
|
|
14
|
-
export const START_PENTEST_SESSION_SCHEMA = {
|
|
15
|
-
name: z.string().describe("Session name (e.g., 'API Auth Testing - Sprint 12')"),
|
|
16
|
-
tester_name: z.string().describe("Name of the pen tester"),
|
|
17
|
-
description: z.string().optional().describe("Description of the testing scope and objectives"),
|
|
18
|
-
threat_model_id: z.string().optional().describe("Threat model UUID to link this session to"),
|
|
19
|
-
campaign_id: z.string().optional().describe("Campaign UUID to link this session to"),
|
|
20
|
-
};
|
|
21
|
-
export function createStartPentestSessionHandler(apiClient) {
|
|
22
|
-
return async (params) => {
|
|
23
|
-
try {
|
|
24
|
-
const data = await apiClient.post("/api/pentest-sessions", {
|
|
25
|
-
name: params.name,
|
|
26
|
-
testerName: params.tester_name,
|
|
27
|
-
description: params.description,
|
|
28
|
-
threatModelId: params.threat_model_id,
|
|
29
|
-
campaignId: params.campaign_id,
|
|
30
|
-
});
|
|
31
|
-
const sanitized = sanitizeResponse(data);
|
|
32
|
-
return {
|
|
33
|
-
content: [
|
|
34
|
-
{
|
|
35
|
-
type: "text",
|
|
36
|
-
text: JSON.stringify(sanitized, null, 2),
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
const message = err instanceof Error ? err.message : "Failed to start pentest session";
|
|
43
|
-
return {
|
|
44
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
45
|
-
isError: true,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=start-pentest-session.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start-pentest-session.js","sourceRoot":"","sources":["../../../src/tools/enterprise/start-pentest-session.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,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;4FAI2C,CAAC;AAE7F,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IAChF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC1D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC9F,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAC5F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CACrF,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAAC,SAAoB;IACnE,OAAO,KAAK,EAAE,MAMb,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAC/B,uBAAuB,EACvB;gBACE,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,WAAW;gBAC9B,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,aAAa,EAAE,MAAM,CAAC,eAAe;gBACrC,UAAU,EAAE,MAAM,CAAC,WAAW;aAC/B,CACF,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,iCAAiC,CAAC;YACvF,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"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_sync_report_section — Push a markdown report section to the platform
|
|
3
|
-
*
|
|
4
|
-
* Maps to: PATCH /api/reports/:reportId/sections/:sectionKey
|
|
5
|
-
*
|
|
6
|
-
* This is the core tool for the repo-based reporting workflow.
|
|
7
|
-
* The pen tester writes markdown locally, and this tool pushes
|
|
8
|
-
* sections to the platform for rendering in the Report tab.
|
|
9
|
-
*/
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
import type { ApiClient } from "../../api-client.js";
|
|
12
|
-
export declare const SYNC_REPORT_SECTION_NAME = "zivis_sync_report_section";
|
|
13
|
-
export declare const SYNC_REPORT_SECTION_DESCRIPTION = "Push a markdown report section to the ZIVIS platform.\n\nUse this to sync report content written locally (in your editor/repo) to the platform. Each section is identified by a key and can be updated independently.\n\nStandard section keys:\n- executive_summary\n- scope_and_methodology\n- attack_surface\n- findings_detail\n- remediation_checklist\n- appendix\n\nYou can also create custom sections with any key.\n\nWorkflow: Write markdown locally \u2192 call this tool to push to platform \u2192 view in Report tab.";
|
|
14
|
-
export declare const SYNC_REPORT_SECTION_SCHEMA: {
|
|
15
|
-
campaign_id: z.ZodOptional<z.ZodString>;
|
|
16
|
-
report_id: z.ZodOptional<z.ZodString>;
|
|
17
|
-
section_key: z.ZodString;
|
|
18
|
-
title: z.ZodString;
|
|
19
|
-
content: z.ZodString;
|
|
20
|
-
order_index: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
};
|
|
22
|
-
export declare function createSyncReportSectionHandler(apiClient: ApiClient): (params: {
|
|
23
|
-
campaign_id?: string;
|
|
24
|
-
report_id?: string;
|
|
25
|
-
section_key: string;
|
|
26
|
-
title: string;
|
|
27
|
-
content: string;
|
|
28
|
-
order_index?: number;
|
|
29
|
-
}) => Promise<{
|
|
30
|
-
content: {
|
|
31
|
-
type: "text";
|
|
32
|
-
text: string;
|
|
33
|
-
}[];
|
|
34
|
-
isError: boolean;
|
|
35
|
-
} | {
|
|
36
|
-
content: {
|
|
37
|
-
type: "text";
|
|
38
|
-
text: string;
|
|
39
|
-
}[];
|
|
40
|
-
isError?: undefined;
|
|
41
|
-
}>;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_sync_report_section — Push a markdown report section to the platform
|
|
3
|
-
*
|
|
4
|
-
* Maps to: PATCH /api/reports/:reportId/sections/:sectionKey
|
|
5
|
-
*
|
|
6
|
-
* This is the core tool for the repo-based reporting workflow.
|
|
7
|
-
* The pen tester writes markdown locally, and this tool pushes
|
|
8
|
-
* sections to the platform for rendering in the Report tab.
|
|
9
|
-
*/
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
import { sanitizeResponse } from "../../sanitize.js";
|
|
12
|
-
export const SYNC_REPORT_SECTION_NAME = "zivis_sync_report_section";
|
|
13
|
-
export const SYNC_REPORT_SECTION_DESCRIPTION = `Push a markdown report section to the ZIVIS platform.
|
|
14
|
-
|
|
15
|
-
Use this to sync report content written locally (in your editor/repo) to the platform. Each section is identified by a key and can be updated independently.
|
|
16
|
-
|
|
17
|
-
Standard section keys:
|
|
18
|
-
- executive_summary
|
|
19
|
-
- scope_and_methodology
|
|
20
|
-
- attack_surface
|
|
21
|
-
- findings_detail
|
|
22
|
-
- remediation_checklist
|
|
23
|
-
- appendix
|
|
24
|
-
|
|
25
|
-
You can also create custom sections with any key.
|
|
26
|
-
|
|
27
|
-
Workflow: Write markdown locally → call this tool to push to platform → view in Report tab.`;
|
|
28
|
-
export const SYNC_REPORT_SECTION_SCHEMA = {
|
|
29
|
-
campaign_id: z.string().optional().describe("Campaign UUID — auto-resolves to report"),
|
|
30
|
-
report_id: z.string().optional().describe("Report UUID (alternative to campaign_id)"),
|
|
31
|
-
section_key: z.string().describe("Section identifier (e.g., 'executive_summary', 'findings_detail')"),
|
|
32
|
-
title: z.string().describe("Section display title (e.g., 'Executive Summary')"),
|
|
33
|
-
content: z.string().describe("Markdown content for this section"),
|
|
34
|
-
order_index: z.number().optional().describe("Display order (0-based, lower = earlier)"),
|
|
35
|
-
};
|
|
36
|
-
export function createSyncReportSectionHandler(apiClient) {
|
|
37
|
-
return async (params) => {
|
|
38
|
-
try {
|
|
39
|
-
let reportId = params.report_id;
|
|
40
|
-
// Resolve campaign → report if needed
|
|
41
|
-
if (!reportId && params.campaign_id) {
|
|
42
|
-
const reportData = await apiClient.post(`/api/reports/for-campaign/${params.campaign_id}`, {});
|
|
43
|
-
reportId = reportData.reportId;
|
|
44
|
-
}
|
|
45
|
-
if (!reportId) {
|
|
46
|
-
return {
|
|
47
|
-
content: [{ type: "text", text: "Error: Provide either campaign_id or report_id" }],
|
|
48
|
-
isError: true,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const data = await apiClient.post(`/api/reports/${reportId}/sections`, {
|
|
52
|
-
sectionKey: params.section_key,
|
|
53
|
-
title: params.title,
|
|
54
|
-
content: params.content,
|
|
55
|
-
orderIndex: params.order_index,
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
content: [
|
|
59
|
-
{
|
|
60
|
-
type: "text",
|
|
61
|
-
text: JSON.stringify(sanitizeResponse({
|
|
62
|
-
...data,
|
|
63
|
-
reportId,
|
|
64
|
-
message: `Section "${params.title}" synced to report.`,
|
|
65
|
-
}), null, 2),
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
const message = err instanceof Error ? err.message : "Failed to sync report section";
|
|
72
|
-
return {
|
|
73
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
74
|
-
isError: true,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=sync-report-section.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-report-section.js","sourceRoot":"","sources":["../../../src/tools/enterprise/sync-report-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;;;;;;;;4FAc6C,CAAC;AAE7F,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,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,WAAW,EAAE,CAAC,C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,CAClB,gBAAgB,CAAC;4BACf,GAAG,IAAI;4BACP,QAAQ;4BACR,OAAO,EAAE,YAAY,MAAM,CAAC,KAAK,qBAAqB;yBACvD,CAAC,EACF,IAAI,EACJ,CAAC,CACF;qBACF;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,+BAA+B,CAAC;YACrF,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"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_update_report_issue — Update a report issue's status, content, or severity
|
|
3
|
-
*
|
|
4
|
-
* Maps to: PATCH /api/reports/:reportId/issues/:issueId
|
|
5
|
-
* + DELETE /api/reports/:reportId/issues/:issueId
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import type { ApiClient } from "../../api-client.js";
|
|
9
|
-
export declare const UPDATE_REPORT_ISSUE_NAME = "zivis_update_report_issue";
|
|
10
|
-
export declare const UPDATE_REPORT_ISSUE_DESCRIPTION = "Update or remove a report issue in the remediation checklist.\n\nActions:\n- update: Change status (open \u2192 in_progress \u2192 done), edit title/description/recommendation/severity\n- remove: Remove the issue from the report (does not affect the underlying finding)\n\nCommon workflow: After remediation is confirmed, update status to \"done\".";
|
|
11
|
-
export declare const UPDATE_REPORT_ISSUE_SCHEMA: {
|
|
12
|
-
report_id: z.ZodString;
|
|
13
|
-
issue_id: z.ZodString;
|
|
14
|
-
action: z.ZodDefault<z.ZodEnum<{
|
|
15
|
-
update: "update";
|
|
16
|
-
remove: "remove";
|
|
17
|
-
}>>;
|
|
18
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
19
|
-
open: "open";
|
|
20
|
-
in_progress: "in_progress";
|
|
21
|
-
done: "done";
|
|
22
|
-
}>>;
|
|
23
|
-
title: z.ZodOptional<z.ZodString>;
|
|
24
|
-
description: z.ZodOptional<z.ZodString>;
|
|
25
|
-
recommendation: z.ZodOptional<z.ZodString>;
|
|
26
|
-
severity: z.ZodOptional<z.ZodEnum<{
|
|
27
|
-
critical: "critical";
|
|
28
|
-
high: "high";
|
|
29
|
-
medium: "medium";
|
|
30
|
-
low: "low";
|
|
31
|
-
info: "info";
|
|
32
|
-
}>>;
|
|
33
|
-
};
|
|
34
|
-
export declare function createUpdateReportIssueHandler(apiClient: ApiClient): (params: {
|
|
35
|
-
report_id: string;
|
|
36
|
-
issue_id: string;
|
|
37
|
-
action?: "update" | "remove";
|
|
38
|
-
status?: string;
|
|
39
|
-
title?: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
recommendation?: string;
|
|
42
|
-
severity?: string;
|
|
43
|
-
}) => Promise<{
|
|
44
|
-
content: {
|
|
45
|
-
type: "text";
|
|
46
|
-
text: string;
|
|
47
|
-
}[];
|
|
48
|
-
isError?: undefined;
|
|
49
|
-
} | {
|
|
50
|
-
content: {
|
|
51
|
-
type: "text";
|
|
52
|
-
text: string;
|
|
53
|
-
}[];
|
|
54
|
-
isError: boolean;
|
|
55
|
-
}>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_update_report_issue — Update a report issue's status, content, or severity
|
|
3
|
-
*
|
|
4
|
-
* Maps to: PATCH /api/reports/:reportId/issues/:issueId
|
|
5
|
-
* + DELETE /api/reports/:reportId/issues/:issueId
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { sanitizeResponse } from "../../sanitize.js";
|
|
9
|
-
export const UPDATE_REPORT_ISSUE_NAME = "zivis_update_report_issue";
|
|
10
|
-
export const UPDATE_REPORT_ISSUE_DESCRIPTION = `Update or remove a report issue in the remediation checklist.
|
|
11
|
-
|
|
12
|
-
Actions:
|
|
13
|
-
- update: Change status (open → in_progress → done), edit title/description/recommendation/severity
|
|
14
|
-
- remove: Remove the issue from the report (does not affect the underlying finding)
|
|
15
|
-
|
|
16
|
-
Common workflow: After remediation is confirmed, update status to "done".`;
|
|
17
|
-
export const UPDATE_REPORT_ISSUE_SCHEMA = {
|
|
18
|
-
report_id: z.string().describe("Report UUID"),
|
|
19
|
-
issue_id: z.string().describe("Report issue UUID"),
|
|
20
|
-
action: z.enum(["update", "remove"]).default("update").describe("Action to perform"),
|
|
21
|
-
status: z.enum(["open", "in_progress", "done"]).optional().describe("New status"),
|
|
22
|
-
title: z.string().optional().describe("Updated title"),
|
|
23
|
-
description: z.string().optional().describe("Updated description"),
|
|
24
|
-
recommendation: z.string().optional().describe("Updated remediation recommendation"),
|
|
25
|
-
severity: z.enum(["critical", "high", "medium", "low", "info"]).optional().describe("Updated severity"),
|
|
26
|
-
};
|
|
27
|
-
export function createUpdateReportIssueHandler(apiClient) {
|
|
28
|
-
return async (params) => {
|
|
29
|
-
try {
|
|
30
|
-
const { report_id, issue_id, action = "update" } = params;
|
|
31
|
-
if (action === "remove") {
|
|
32
|
-
await apiClient.del(`/api/reports/${report_id}/issues/${issue_id}`);
|
|
33
|
-
return {
|
|
34
|
-
content: [{ type: "text", text: "Issue removed from remediation checklist." }],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
// Build update payload
|
|
38
|
-
const body = {};
|
|
39
|
-
if (params.status)
|
|
40
|
-
body.status = params.status;
|
|
41
|
-
if (params.title)
|
|
42
|
-
body.title = params.title;
|
|
43
|
-
if (params.description !== undefined)
|
|
44
|
-
body.description = params.description;
|
|
45
|
-
if (params.recommendation !== undefined)
|
|
46
|
-
body.recommendation = params.recommendation;
|
|
47
|
-
if (params.severity)
|
|
48
|
-
body.severity = params.severity;
|
|
49
|
-
if (Object.keys(body).length === 0) {
|
|
50
|
-
return {
|
|
51
|
-
content: [{ type: "text", text: "Error: No fields to update. Provide status, title, description, recommendation, or severity." }],
|
|
52
|
-
isError: true,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const data = await apiClient.patch(`/api/reports/${report_id}/issues/${issue_id}`, body);
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: "text", text: JSON.stringify(sanitizeResponse(data), null, 2) }],
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
const message = err instanceof Error ? err.message : "Failed to update report issue";
|
|
62
|
-
return {
|
|
63
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
64
|
-
isError: true,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=update-report-issue.js.map
|