sophos-central-mcp-server 0.1.6 → 0.1.7
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/README.md +60 -5
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/tools/cases.d.ts +10 -0
- package/dist/tools/cases.d.ts.map +1 -0
- package/dist/tools/cases.js +338 -0
- package/dist/tools/cases.js.map +1 -0
- package/dist/tools/detections.d.ts +11 -0
- package/dist/tools/detections.d.ts.map +1 -0
- package/dist/tools/detections.js +325 -0
- package/dist/tools/detections.js.map +1 -0
- package/dist/tools/live-discover.d.ts +12 -0
- package/dist/tools/live-discover.d.ts.map +1 -0
- package/dist/tools/live-discover.js +273 -0
- package/dist/tools/live-discover.js.map +1 -0
- package/dist/tools/siem.d.ts +10 -0
- package/dist/tools/siem.d.ts.map +1 -0
- package/dist/tools/siem.js +152 -0
- package/dist/tools/siem.js.map +1 -0
- package/dist/tools/xdr.d.ts +10 -0
- package/dist/tools/xdr.d.ts.map +1 -0
- package/dist/tools/xdr.js +181 -0
- package/dist/tools/xdr.js.map +1 -0
- package/dist/types/sophos.d.ts +179 -0
- package/dist/types/sophos.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -128,6 +128,60 @@ TRANSPORT=http
|
|
|
128
128
|
| `sophos_add_blocked_item` | Block an item by SHA256, path, or certificate signer |
|
|
129
129
|
| `sophos_delete_blocked_item` | Remove a blocked item |
|
|
130
130
|
|
|
131
|
+
### Investigation
|
|
132
|
+
|
|
133
|
+
#### Cases
|
|
134
|
+
|
|
135
|
+
| Tool | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `sophos_list_cases` | List investigation cases with pagination |
|
|
138
|
+
| `sophos_get_case` | Get full case details |
|
|
139
|
+
| `sophos_create_case` | Create a new self-managed investigation case |
|
|
140
|
+
| `sophos_update_case` | Update case status, severity, assignee, or overview |
|
|
141
|
+
| `sophos_list_case_detections` | List detections linked to a case |
|
|
142
|
+
| `sophos_get_case_mitre_summary` | Get MITRE ATT&CK tactic/technique breakdown for a case |
|
|
143
|
+
|
|
144
|
+
#### Detections
|
|
145
|
+
|
|
146
|
+
Async API — start a query, poll for completion, then fetch results.
|
|
147
|
+
|
|
148
|
+
| Tool | Description |
|
|
149
|
+
|------|-------------|
|
|
150
|
+
| `sophos_run_detections_query` | Start an async query for individual XDR/EDR detections |
|
|
151
|
+
| `sophos_get_detections_run` | Poll the status of a detections query run |
|
|
152
|
+
| `sophos_get_detections_results` | Fetch results from a completed detections query |
|
|
153
|
+
| `sophos_run_detection_groups_query` | Start an async query for grouped detections |
|
|
154
|
+
| `sophos_get_detection_groups_run` | Poll the status of a detection groups query run |
|
|
155
|
+
| `sophos_get_detection_groups_results` | Fetch results from a completed detection groups query |
|
|
156
|
+
|
|
157
|
+
#### SIEM Events
|
|
158
|
+
|
|
159
|
+
| Tool | Description |
|
|
160
|
+
|------|-------------|
|
|
161
|
+
| `sophos_list_siem_events` | Stream security events via cursor-based pagination (last 24h) |
|
|
162
|
+
| `sophos_list_siem_alerts` | Stream security alerts via cursor-based pagination (last 24h) |
|
|
163
|
+
|
|
164
|
+
#### XDR Data Lake
|
|
165
|
+
|
|
166
|
+
Async API — submit a SQL query against historical telemetry, poll for completion, then fetch results.
|
|
167
|
+
|
|
168
|
+
| Tool | Description |
|
|
169
|
+
|------|-------------|
|
|
170
|
+
| `sophos_run_xdr_query` | Start an async SQL query against the Sophos Data Lake |
|
|
171
|
+
| `sophos_get_xdr_query_run` | Poll the status of an XDR query run |
|
|
172
|
+
| `sophos_get_xdr_query_results` | Fetch paginated results from a completed XDR query |
|
|
173
|
+
|
|
174
|
+
#### Live Discover
|
|
175
|
+
|
|
176
|
+
Async API — run OSquery SQL on live endpoints in real time. Rate limited to 10 runs/minute, 500/day.
|
|
177
|
+
|
|
178
|
+
| Tool | Description |
|
|
179
|
+
|------|-------------|
|
|
180
|
+
| `sophos_list_live_discover_queries` | List available saved OSquery queries |
|
|
181
|
+
| `sophos_run_live_discover_query` | Run a saved or ad hoc OSquery against live endpoints |
|
|
182
|
+
| `sophos_get_live_discover_run` | Poll the status of a Live Discover query run |
|
|
183
|
+
| `sophos_get_live_discover_results` | Fetch paginated results from a completed Live Discover run |
|
|
184
|
+
|
|
131
185
|
### Tenant context
|
|
132
186
|
|
|
133
187
|
For **partner/org** callers, every tenant-scoped tool requires a `tenant_id` parameter. Use `sophos_list_tenants` first to discover available tenant IDs.
|
|
@@ -178,14 +232,15 @@ src/
|
|
|
178
232
|
│ ├── directory.ts # sophos_list_users, list_admins, list_roles
|
|
179
233
|
│ ├── policies.ts # sophos_list/get/clone/update_policy
|
|
180
234
|
│ ├── groups.ts # sophos_list/get/create/update/delete_endpoint_group, add/remove endpoints
|
|
181
|
-
│
|
|
235
|
+
│ ├── exclusions.ts # sophos_list/add/delete exclusions, allowed items, blocked items
|
|
236
|
+
│ ├── cases.ts # sophos_list/get/create/update_case, list_case_detections, mitre_summary
|
|
237
|
+
│ ├── detections.ts # sophos_run/get/results for detections and detection-groups
|
|
238
|
+
│ ├── siem.ts # sophos_list_siem_events, sophos_list_siem_alerts
|
|
239
|
+
│ ├── xdr.ts # sophos_run/get/results for XDR Data Lake queries
|
|
240
|
+
│ └── live-discover.ts # sophos_list_queries, run/get/results for Live Discover
|
|
182
241
|
└── types/sophos.ts # Sophos API response types
|
|
183
242
|
```
|
|
184
243
|
|
|
185
|
-
## Roadmap
|
|
186
|
-
|
|
187
|
-
- **Phase 3 (Investigation)**: XDR Data Lake queries, Live Discover, detections, cases, SIEM events
|
|
188
|
-
|
|
189
244
|
## Security
|
|
190
245
|
|
|
191
246
|
- Credentials are read from environment variables only, never logged
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,11 @@ import { registerDirectoryTools } from "./tools/directory.js";
|
|
|
23
23
|
import { registerPolicyTools } from "./tools/policies.js";
|
|
24
24
|
import { registerGroupTools } from "./tools/groups.js";
|
|
25
25
|
import { registerExclusionTools } from "./tools/exclusions.js";
|
|
26
|
+
import { registerCaseTools } from "./tools/cases.js";
|
|
27
|
+
import { registerDetectionTools } from "./tools/detections.js";
|
|
28
|
+
import { registerSiemTools } from "./tools/siem.js";
|
|
29
|
+
import { registerXdrTools } from "./tools/xdr.js";
|
|
30
|
+
import { registerLiveDiscoverTools } from "./tools/live-discover.js";
|
|
26
31
|
async function main() {
|
|
27
32
|
// Load and validate config
|
|
28
33
|
const config = loadConfig();
|
|
@@ -41,7 +46,7 @@ async function main() {
|
|
|
41
46
|
// Create the MCP server
|
|
42
47
|
const server = new McpServer({
|
|
43
48
|
name: "sophos-central-mcp-server",
|
|
44
|
-
version: "0.1.
|
|
49
|
+
version: "0.1.7",
|
|
45
50
|
});
|
|
46
51
|
// Register tools based on identity type
|
|
47
52
|
console.error(`[sophos-mcp] Registering tools for ${identity.idType} caller...`);
|
|
@@ -58,6 +63,12 @@ async function main() {
|
|
|
58
63
|
registerPolicyTools(server, sophosClient, tenantResolver);
|
|
59
64
|
registerGroupTools(server, sophosClient, tenantResolver);
|
|
60
65
|
registerExclusionTools(server, sophosClient, tenantResolver);
|
|
66
|
+
// Phase 3: Investigation tools
|
|
67
|
+
registerCaseTools(server, sophosClient, tenantResolver);
|
|
68
|
+
registerDetectionTools(server, sophosClient, tenantResolver);
|
|
69
|
+
registerSiemTools(server, sophosClient, tenantResolver);
|
|
70
|
+
registerXdrTools(server, sophosClient, tenantResolver);
|
|
71
|
+
registerLiveDiscoverTools(server, sophosClient, tenantResolver);
|
|
61
72
|
console.error("[sophos-mcp] All tools registered.");
|
|
62
73
|
// Start transport
|
|
63
74
|
if (config.transport === "http") {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,E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,EAAE,WAAW,EAAE,GAAG,EAAE;QACjC,OAAO,CAAC,KAAK,CAAC,0DAA0D,IAAI,MAAM,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,MAAiB;IACvC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC3D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools: sophos_list_cases, sophos_get_case, sophos_create_case, sophos_update_case,
|
|
3
|
+
* sophos_list_case_detections, sophos_get_case_mitre_summary
|
|
4
|
+
* Interact with the Sophos Cases API /cases/v1/cases
|
|
5
|
+
*/
|
|
6
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import type { SophosClient } from "../client/sophos-client.js";
|
|
8
|
+
import type { TenantResolver } from "../client/tenant-resolver.js";
|
|
9
|
+
export declare function registerCaseTools(server: McpServer, client: SophosClient, tenantResolver: TenantResolver): void;
|
|
10
|
+
//# sourceMappingURL=cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cases.d.ts","sourceRoot":"","sources":["../../src/tools/cases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAYnE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,cAAc,GAC7B,IAAI,CAuWN"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools: sophos_list_cases, sophos_get_case, sophos_create_case, sophos_update_case,
|
|
3
|
+
* sophos_list_case_detections, sophos_get_case_mitre_summary
|
|
4
|
+
* Interact with the Sophos Cases API /cases/v1/cases
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { jsonResult, withErrorHandling } from "./helpers.js";
|
|
8
|
+
// Cases API max page size is 50
|
|
9
|
+
const CASES_MAX_PAGE_SIZE = 50;
|
|
10
|
+
export function registerCaseTools(server, client, tenantResolver) {
|
|
11
|
+
// --- List Cases ---
|
|
12
|
+
server.registerTool("sophos_list_cases", {
|
|
13
|
+
title: "List Sophos Cases",
|
|
14
|
+
description: `List investigation cases from a Sophos Central tenant.
|
|
15
|
+
|
|
16
|
+
Retrieves cases from the Cases API with optional pagination.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
20
|
+
- limit (number, optional): Results per page (1-50, default 50).
|
|
21
|
+
- page (number, optional): Page number (default 1).
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
Paginated list of cases with: id, name, type, severity, status, assignee, detectionCount, createdAt, updatedAt.`,
|
|
25
|
+
inputSchema: {
|
|
26
|
+
tenant_id: z
|
|
27
|
+
.string()
|
|
28
|
+
.uuid()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
31
|
+
limit: z
|
|
32
|
+
.number()
|
|
33
|
+
.int()
|
|
34
|
+
.min(1)
|
|
35
|
+
.max(CASES_MAX_PAGE_SIZE)
|
|
36
|
+
.optional()
|
|
37
|
+
.default(CASES_MAX_PAGE_SIZE)
|
|
38
|
+
.describe("Results per page (max 50)"),
|
|
39
|
+
page: z
|
|
40
|
+
.number()
|
|
41
|
+
.int()
|
|
42
|
+
.min(1)
|
|
43
|
+
.optional()
|
|
44
|
+
.default(1)
|
|
45
|
+
.describe("Page number (default 1)"),
|
|
46
|
+
},
|
|
47
|
+
annotations: {
|
|
48
|
+
readOnlyHint: true,
|
|
49
|
+
destructiveHint: false,
|
|
50
|
+
idempotentHint: true,
|
|
51
|
+
openWorldHint: true,
|
|
52
|
+
},
|
|
53
|
+
}, withErrorHandling(async ({ tenant_id, limit, page }) => {
|
|
54
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
55
|
+
const data = await client.tenantRequest(resolvedTenantId, "/cases/v1/cases", {
|
|
56
|
+
params: {
|
|
57
|
+
pageSize: String(limit),
|
|
58
|
+
page: String(page),
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return jsonResult({
|
|
62
|
+
total: data.pages.total,
|
|
63
|
+
page: data.pages.current ?? page,
|
|
64
|
+
page_size: data.pages.size,
|
|
65
|
+
total_pages: data.pages.total,
|
|
66
|
+
cases: data.items.map(formatCase),
|
|
67
|
+
});
|
|
68
|
+
}));
|
|
69
|
+
// --- Get Case ---
|
|
70
|
+
server.registerTool("sophos_get_case", {
|
|
71
|
+
title: "Get Sophos Case",
|
|
72
|
+
description: `Get full details of a specific Sophos Central case by ID.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
- case_id (string): The case ID.
|
|
76
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
Full case details including name, severity, status, assignee, overview, detectionCount, createdAt, updatedAt.`,
|
|
80
|
+
inputSchema: {
|
|
81
|
+
case_id: z.string().uuid().describe("Case ID to retrieve"),
|
|
82
|
+
tenant_id: z
|
|
83
|
+
.string()
|
|
84
|
+
.uuid()
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
87
|
+
},
|
|
88
|
+
annotations: {
|
|
89
|
+
readOnlyHint: true,
|
|
90
|
+
destructiveHint: false,
|
|
91
|
+
idempotentHint: true,
|
|
92
|
+
openWorldHint: true,
|
|
93
|
+
},
|
|
94
|
+
}, withErrorHandling(async ({ case_id, tenant_id }) => {
|
|
95
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
96
|
+
const data = await client.tenantRequest(resolvedTenantId, `/cases/v1/cases/${case_id}`);
|
|
97
|
+
return jsonResult(formatCase(data));
|
|
98
|
+
}));
|
|
99
|
+
// --- Create Case ---
|
|
100
|
+
server.registerTool("sophos_create_case", {
|
|
101
|
+
title: "Create Sophos Case",
|
|
102
|
+
description: `Create a new self-managed investigation case in Sophos Central.
|
|
103
|
+
|
|
104
|
+
Only self-managed cases can be created via the API.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
108
|
+
- name (string): Case name.
|
|
109
|
+
- severity (string): Case severity: "informational", "low", "medium", "high", "critical".
|
|
110
|
+
- status (string): Initial status: "new" or "investigating".
|
|
111
|
+
- initial_detection_id (string): ID of the detection that triggered this case.
|
|
112
|
+
- assignee (string, optional): Email address of the assignee.
|
|
113
|
+
- overview (string, optional): Case overview/description.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
The created case object.`,
|
|
117
|
+
inputSchema: {
|
|
118
|
+
tenant_id: z
|
|
119
|
+
.string()
|
|
120
|
+
.uuid()
|
|
121
|
+
.optional()
|
|
122
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
123
|
+
name: z.string().describe("Case name"),
|
|
124
|
+
severity: z
|
|
125
|
+
.enum(["informational", "low", "medium", "high", "critical"])
|
|
126
|
+
.describe("Case severity"),
|
|
127
|
+
status: z
|
|
128
|
+
.enum(["new", "investigating"])
|
|
129
|
+
.describe("Initial case status"),
|
|
130
|
+
initial_detection_id: z
|
|
131
|
+
.string()
|
|
132
|
+
.uuid()
|
|
133
|
+
.describe("ID of the detection that triggered this case"),
|
|
134
|
+
assignee: z
|
|
135
|
+
.string()
|
|
136
|
+
.email()
|
|
137
|
+
.optional()
|
|
138
|
+
.describe("Email address of the assignee"),
|
|
139
|
+
overview: z
|
|
140
|
+
.string()
|
|
141
|
+
.optional()
|
|
142
|
+
.describe("Case overview/description"),
|
|
143
|
+
},
|
|
144
|
+
annotations: {
|
|
145
|
+
readOnlyHint: false,
|
|
146
|
+
destructiveHint: false,
|
|
147
|
+
idempotentHint: false,
|
|
148
|
+
openWorldHint: true,
|
|
149
|
+
},
|
|
150
|
+
}, withErrorHandling(async ({ tenant_id, name, severity, status, initial_detection_id, assignee, overview }) => {
|
|
151
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
152
|
+
const body = {
|
|
153
|
+
type: "investigation",
|
|
154
|
+
name,
|
|
155
|
+
severity,
|
|
156
|
+
status,
|
|
157
|
+
initialDetectionId: initial_detection_id,
|
|
158
|
+
};
|
|
159
|
+
if (assignee)
|
|
160
|
+
body.assignee = assignee;
|
|
161
|
+
if (overview)
|
|
162
|
+
body.overview = overview;
|
|
163
|
+
const data = await client.tenantRequest(resolvedTenantId, "/cases/v1/cases", { method: "POST", body });
|
|
164
|
+
return jsonResult(formatCase(data));
|
|
165
|
+
}));
|
|
166
|
+
// --- Update Case ---
|
|
167
|
+
server.registerTool("sophos_update_case", {
|
|
168
|
+
title: "Update Sophos Case",
|
|
169
|
+
description: `Update an existing self-managed case in Sophos Central.
|
|
170
|
+
|
|
171
|
+
Only self-managed cases can be updated via the API. Supply only the fields to change.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
- case_id (string): The case ID to update.
|
|
175
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
176
|
+
- name (string, optional): New case name.
|
|
177
|
+
- severity (string, optional): New severity: "informational", "low", "medium", "high", "critical".
|
|
178
|
+
- status (string, optional): New status: "new", "investigating", "closed".
|
|
179
|
+
- assignee (string, optional): Email address of the new assignee.
|
|
180
|
+
- overview (string, optional): Updated case overview.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
The updated case object.`,
|
|
184
|
+
inputSchema: {
|
|
185
|
+
case_id: z.string().uuid().describe("Case ID to update"),
|
|
186
|
+
tenant_id: z
|
|
187
|
+
.string()
|
|
188
|
+
.uuid()
|
|
189
|
+
.optional()
|
|
190
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
191
|
+
name: z.string().optional().describe("New case name"),
|
|
192
|
+
severity: z
|
|
193
|
+
.enum(["informational", "low", "medium", "high", "critical"])
|
|
194
|
+
.optional()
|
|
195
|
+
.describe("New severity"),
|
|
196
|
+
status: z
|
|
197
|
+
.enum(["new", "investigating", "closed"])
|
|
198
|
+
.optional()
|
|
199
|
+
.describe("New status"),
|
|
200
|
+
assignee: z
|
|
201
|
+
.string()
|
|
202
|
+
.email()
|
|
203
|
+
.optional()
|
|
204
|
+
.describe("Email address of the new assignee"),
|
|
205
|
+
overview: z.string().optional().describe("Updated case overview"),
|
|
206
|
+
},
|
|
207
|
+
annotations: {
|
|
208
|
+
readOnlyHint: false,
|
|
209
|
+
destructiveHint: false,
|
|
210
|
+
idempotentHint: true,
|
|
211
|
+
openWorldHint: true,
|
|
212
|
+
},
|
|
213
|
+
}, withErrorHandling(async ({ case_id, tenant_id, name, severity, status, assignee, overview }) => {
|
|
214
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
215
|
+
const body = {};
|
|
216
|
+
if (name !== undefined)
|
|
217
|
+
body.name = name;
|
|
218
|
+
if (severity !== undefined)
|
|
219
|
+
body.severity = severity;
|
|
220
|
+
if (status !== undefined)
|
|
221
|
+
body.status = status;
|
|
222
|
+
if (assignee !== undefined)
|
|
223
|
+
body.assignee = assignee;
|
|
224
|
+
if (overview !== undefined)
|
|
225
|
+
body.overview = overview;
|
|
226
|
+
const data = await client.tenantRequest(resolvedTenantId, `/cases/v1/cases/${case_id}`, { method: "PATCH", body });
|
|
227
|
+
return jsonResult(formatCase(data));
|
|
228
|
+
}));
|
|
229
|
+
// --- List Case Detections ---
|
|
230
|
+
server.registerTool("sophos_list_case_detections", {
|
|
231
|
+
title: "List Sophos Case Detections",
|
|
232
|
+
description: `List the detections associated with a specific Sophos Central case.
|
|
233
|
+
|
|
234
|
+
Args:
|
|
235
|
+
- case_id (string): The case ID.
|
|
236
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
237
|
+
- limit (number, optional): Results per page (1-50, default 50).
|
|
238
|
+
- page (number, optional): Page number (default 1).
|
|
239
|
+
|
|
240
|
+
Returns:
|
|
241
|
+
Paginated list of detections: id, attackType, detectionRule, severity, sensorGeneratedAt, device, sensor.`,
|
|
242
|
+
inputSchema: {
|
|
243
|
+
case_id: z.string().uuid().describe("Case ID to list detections for"),
|
|
244
|
+
tenant_id: z
|
|
245
|
+
.string()
|
|
246
|
+
.uuid()
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
249
|
+
limit: z
|
|
250
|
+
.number()
|
|
251
|
+
.int()
|
|
252
|
+
.min(1)
|
|
253
|
+
.max(CASES_MAX_PAGE_SIZE)
|
|
254
|
+
.optional()
|
|
255
|
+
.default(CASES_MAX_PAGE_SIZE)
|
|
256
|
+
.describe("Results per page (max 50)"),
|
|
257
|
+
page: z
|
|
258
|
+
.number()
|
|
259
|
+
.int()
|
|
260
|
+
.min(1)
|
|
261
|
+
.optional()
|
|
262
|
+
.default(1)
|
|
263
|
+
.describe("Page number (default 1)"),
|
|
264
|
+
},
|
|
265
|
+
annotations: {
|
|
266
|
+
readOnlyHint: true,
|
|
267
|
+
destructiveHint: false,
|
|
268
|
+
idempotentHint: true,
|
|
269
|
+
openWorldHint: true,
|
|
270
|
+
},
|
|
271
|
+
}, withErrorHandling(async ({ case_id, tenant_id, limit, page }) => {
|
|
272
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
273
|
+
const data = await client.tenantRequest(resolvedTenantId, `/cases/v1/cases/${case_id}/detections`, {
|
|
274
|
+
params: {
|
|
275
|
+
pageSize: String(limit),
|
|
276
|
+
page: String(page),
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
return jsonResult({
|
|
280
|
+
case_id,
|
|
281
|
+
total: data.pages.total ?? data.pages.items ?? data.items.length,
|
|
282
|
+
page: data.pages.current ?? page,
|
|
283
|
+
page_size: data.pages.size,
|
|
284
|
+
detections: data.items,
|
|
285
|
+
});
|
|
286
|
+
}));
|
|
287
|
+
// --- Get Case MITRE ATT&CK Summary ---
|
|
288
|
+
server.registerTool("sophos_get_case_mitre_summary", {
|
|
289
|
+
title: "Get Case MITRE ATT&CK Summary",
|
|
290
|
+
description: `Get the MITRE ATT&CK tactics and techniques summary for a Sophos Central case.
|
|
291
|
+
|
|
292
|
+
Provides a breakdown of ATT&CK tactics observed in the case detections, with associated techniques and counts.
|
|
293
|
+
|
|
294
|
+
Args:
|
|
295
|
+
- case_id (string): The case ID.
|
|
296
|
+
- tenant_id (string, optional): Tenant ID. Required for partner/org callers.
|
|
297
|
+
|
|
298
|
+
Returns:
|
|
299
|
+
MITRE ATT&CK summary with tactics, techniques, and detection counts.`,
|
|
300
|
+
inputSchema: {
|
|
301
|
+
case_id: z.string().uuid().describe("Case ID to get MITRE summary for"),
|
|
302
|
+
tenant_id: z
|
|
303
|
+
.string()
|
|
304
|
+
.uuid()
|
|
305
|
+
.optional()
|
|
306
|
+
.describe("Tenant ID. Required for partner/org callers."),
|
|
307
|
+
},
|
|
308
|
+
annotations: {
|
|
309
|
+
readOnlyHint: true,
|
|
310
|
+
destructiveHint: false,
|
|
311
|
+
idempotentHint: true,
|
|
312
|
+
openWorldHint: true,
|
|
313
|
+
},
|
|
314
|
+
}, withErrorHandling(async ({ case_id, tenant_id }) => {
|
|
315
|
+
const resolvedTenantId = tenantResolver.resolveTenantId(tenant_id);
|
|
316
|
+
const data = await client.tenantRequest(resolvedTenantId, `/cases/v1/cases/${case_id}/mitre-attack-summary`);
|
|
317
|
+
return jsonResult({ case_id, mitre_attack_summary: data });
|
|
318
|
+
}));
|
|
319
|
+
}
|
|
320
|
+
function formatCase(c) {
|
|
321
|
+
return {
|
|
322
|
+
id: c.id,
|
|
323
|
+
name: c.name,
|
|
324
|
+
type: c.type,
|
|
325
|
+
severity: c.severity,
|
|
326
|
+
status: c.status,
|
|
327
|
+
assignee: c.assignee ?? null,
|
|
328
|
+
overview: c.overview ?? null,
|
|
329
|
+
managed_by: c.managedBy ?? null,
|
|
330
|
+
detection_count: c.detectionCount ?? null,
|
|
331
|
+
tenant_id: c.tenant.id,
|
|
332
|
+
created_at: c.createdAt,
|
|
333
|
+
created_by: c.createdBy ?? null,
|
|
334
|
+
updated_at: c.updatedAt ?? null,
|
|
335
|
+
initial_detection_id: c.initialDetection?.id ?? null,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cases.js","sourceRoot":"","sources":["../../src/tools/cases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7D,gCAAgC;AAChC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,MAAM,UAAU,iBAAiB,CAC/B,MAAiB,EACjB,MAAoB,EACpB,cAA8B;IAE9B,qBAAqB;IACrB,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE;;;;;;;;;;kHAU+F;QAC5G,WAAW,EAAE;YACX,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,IAAI,EAAE;iBACN,QAAQ,EAAE;iBACV,QAAQ,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E;QACtB,UAAU,EAAE,CAAC,CAAC,SAAS;QACvB,UAAU,EAAE,CAAC,CAAC,SAAS,IAAI,IAAI;QAC/B,UAAU,EAAE,CAAC,CAAC,SAAS,IAAI,IAAI;QAC/B,oBAAoB,EAAE,CAAC,CAAC,gBAAgB,EAAE,EAAE,IAAI,IAAI;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools: sophos_run_detections_query, sophos_get_detections_run, sophos_get_detections_results,
|
|
3
|
+
* sophos_run_detection_groups_query, sophos_get_detection_groups_run, sophos_get_detection_groups_results
|
|
4
|
+
* Async query API for individual detections and detection groups.
|
|
5
|
+
* Pattern: POST to start → GET to poll status → GET results when finished.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import type { SophosClient } from "../client/sophos-client.js";
|
|
9
|
+
import type { TenantResolver } from "../client/tenant-resolver.js";
|
|
10
|
+
export declare function registerDetectionTools(server: McpServer, client: SophosClient, tenantResolver: TenantResolver): void;
|
|
11
|
+
//# sourceMappingURL=detections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detections.d.ts","sourceRoot":"","sources":["../../src/tools/detections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQnE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,cAAc,GAC7B,IAAI,CAyWN"}
|