@jupiterone/jupiterone-mcp 2.2.0 → 2.3.0
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 +18 -2
- package/dist/client/graphql/queries.d.ts +47 -0
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +325 -1
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +8 -0
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +13 -0
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/threat-service.d.ts +31 -0
- package/dist/client/services/threat-service.d.ts.map +1 -0
- package/dist/client/services/threat-service.js +72 -0
- package/dist/client/services/threat-service.js.map +1 -0
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +206 -0
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +29 -13
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/errors.d.ts +5 -0
- package/dist/server/tools/errors.d.ts.map +1 -1
- package/dist/server/tools/errors.js +7 -0
- package/dist/server/tools/errors.js.map +1 -1
- package/dist/server/tools/index.d.ts.map +1 -1
- package/dist/server/tools/index.js +2 -0
- package/dist/server/tools/index.js.map +1 -1
- package/dist/server/tools/telemetry.d.ts +1 -1
- package/dist/server/tools/telemetry.d.ts.map +1 -1
- package/dist/server/tools/threat.d.ts +3 -0
- package/dist/server/tools/threat.d.ts.map +1 -0
- package/dist/server/tools/threat.js +284 -0
- package/dist/server/tools/threat.js.map +1 -0
- package/dist/server/tools/types.d.ts +5 -0
- package/dist/server/tools/types.d.ts.map +1 -1
- package/dist/server/tools/types.js.map +1 -1
- package/dist/server/tools/usage.d.ts.map +1 -1
- package/dist/server/tools/usage.js +46 -3
- package/dist/server/tools/usage.js.map +1 -1
- package/dist/types/jupiterone.d.ts +132 -0
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/node_modules/dtrace-provider/build/Makefile +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.threatTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const load_description_js_1 = require("../../utils/load-description.js");
|
|
6
|
+
const result_js_1 = require("./result.js");
|
|
7
|
+
const types_js_1 = require("./types.js");
|
|
8
|
+
/**
|
|
9
|
+
* Threat tools — the MCP surface over JupiterOne's Emerging Exposures capability.
|
|
10
|
+
*
|
|
11
|
+
* - get-threat per-CVE decision-grade brief (compact by default, full with `detail`)
|
|
12
|
+
* - get-threat-trending the cached trending region
|
|
13
|
+
* - check-threat-exposure this account's own exposure per CVE (direct/scanner match)
|
|
14
|
+
*
|
|
15
|
+
* All three are READ_ONLY and account-scoped (they inherit the multi-tenant `accountId` injection
|
|
16
|
+
* through the registration chokepoint). Each backing query is gated server-side by the
|
|
17
|
+
* VulnerabilityManagement entitlement + vuln-read permission; a caller without them gets the
|
|
18
|
+
* standard access-denied envelope.
|
|
19
|
+
*
|
|
20
|
+
* The brief and environment queries return unions; the handlers flatten them to a discriminated
|
|
21
|
+
* `outcome` / `status` field so the model always sees one shape. `source_unavailable` /
|
|
22
|
+
* `unavailable` are NEVER conflated with "no such CVE" / "not affected".
|
|
23
|
+
*/
|
|
24
|
+
// The environment traversal serves the whole batch in one round trip; the schema caps it (matching
|
|
25
|
+
// the backend's own ≤25 rule) so we fail fast with a clear message rather than triggering the
|
|
26
|
+
// server's request error.
|
|
27
|
+
const MAX_EXPOSURE_SUBJECTS = 25;
|
|
28
|
+
const CVE_ID_DESCRIPTION = 'A CVE identifier, e.g. "CVE-2021-44228". Case-insensitive; validated server-side.';
|
|
29
|
+
// The backing queries are gated by an account entitlement as well as by RBAC, and the generic
|
|
30
|
+
// access-denied frame talks only about account access — a customer without Emerging Exposures would
|
|
31
|
+
// otherwise be told to check their membership.
|
|
32
|
+
const ACCESS_DENIED_HINT = 'The threat tools also require the VulnerabilityManagement entitlement on the account and ' +
|
|
33
|
+
'vulnerability read permission for the caller. If other JupiterOne tools work on this account, ' +
|
|
34
|
+
'the entitlement is the likely cause: ask an account admin about Emerging Exposures rather than ' +
|
|
35
|
+
're-authenticating.';
|
|
36
|
+
/**
|
|
37
|
+
* Join emphasis-tagged narrative runs into plain text for the model.
|
|
38
|
+
*
|
|
39
|
+
* The runs are inline spans of a single sentence and carry their own spacing — the wire sends
|
|
40
|
+
* `"…rated "`, `"critical"`, `". "`, `"It has been exploited in the wild."` — so they concatenate
|
|
41
|
+
* directly. Joining on a space put a gap before every emphasised run and before the closing
|
|
42
|
+
* punctuation ("rated critical ."), in the two fields a model quotes most. Whitespace runs are
|
|
43
|
+
* collapsed so spacing added on the other side cannot reintroduce the doubles.
|
|
44
|
+
*/
|
|
45
|
+
function joinSegments(segments) {
|
|
46
|
+
return (segments ?? [])
|
|
47
|
+
.map((segment) => segment?.text ?? '')
|
|
48
|
+
.join('')
|
|
49
|
+
.replace(/\s+/g, ' ')
|
|
50
|
+
.trim();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Flatten the fixed-order metric-tile union into a single decision-signals object. A tile can carry
|
|
54
|
+
* a null value (renders as an empty label upstream); it is kept so the model sees "no data" rather
|
|
55
|
+
* than an absent key.
|
|
56
|
+
*/
|
|
57
|
+
function flattenTiles(tiles) {
|
|
58
|
+
const signals = {};
|
|
59
|
+
for (const tile of tiles ?? []) {
|
|
60
|
+
switch (tile.__typename) {
|
|
61
|
+
case 'EmergingExposureCvssTile':
|
|
62
|
+
signals.cvss = { score: tile.score ?? null, severity: tile.severity ?? null };
|
|
63
|
+
break;
|
|
64
|
+
case 'EmergingExposureEpssTile':
|
|
65
|
+
signals.epss = { percentile: tile.percentile ?? null };
|
|
66
|
+
break;
|
|
67
|
+
case 'EmergingExposureMaturityTile':
|
|
68
|
+
signals.exploitMaturity = tile.maturity ?? null;
|
|
69
|
+
break;
|
|
70
|
+
case 'EmergingExposureKevTile':
|
|
71
|
+
signals.kevState = tile.state ?? null;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return signals;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The default get-threat payload: a decision-first projection of a resolved brief. The full brief
|
|
79
|
+
* object is returned only when `detail: true`.
|
|
80
|
+
*/
|
|
81
|
+
function projectCompactBrief(brief) {
|
|
82
|
+
const { verdict, timeline, whoIsUsingIt } = brief;
|
|
83
|
+
const nodes = timeline?.nodes ?? [];
|
|
84
|
+
return {
|
|
85
|
+
outcome: 'found',
|
|
86
|
+
subjectId: brief.subjectId,
|
|
87
|
+
assessedAt: brief.assessedAt,
|
|
88
|
+
tier: verdict?.tier,
|
|
89
|
+
stance: verdict?.stance,
|
|
90
|
+
impactLabel: verdict?.impactLabel ?? null,
|
|
91
|
+
// The join key for a product-presence search of the graph; trending rows often lack it.
|
|
92
|
+
affectedProduct: brief.fingerprint?.affectedProduct ?? null,
|
|
93
|
+
headline: joinSegments(verdict?.headline),
|
|
94
|
+
support: joinSegments(verdict?.support),
|
|
95
|
+
beats: verdict?.beats ?? [],
|
|
96
|
+
threatSignals: flattenTiles(brief.tiles),
|
|
97
|
+
ssvc: brief.ssvc ?? null,
|
|
98
|
+
remediation: brief.remediation ?? null,
|
|
99
|
+
// The nodes a decision hangs on: what has actually happened (done) and what happened recently
|
|
100
|
+
// (hot). Fixed node order is preserved.
|
|
101
|
+
timelineHighlights: nodes.filter((node) => node.state === 'done' || node.state === 'hot'),
|
|
102
|
+
kev: {
|
|
103
|
+
inCisaKev: timeline?.inCisaKev ?? null,
|
|
104
|
+
inVulncheckKev: timeline?.inVulncheckKev ?? null,
|
|
105
|
+
cisaKevDateAdded: timeline?.cisaKevDateAdded ?? null,
|
|
106
|
+
vulncheckKevDateAdded: timeline?.vulncheckKevDateAdded ?? null,
|
|
107
|
+
lead: timeline?.kevLead ?? null,
|
|
108
|
+
},
|
|
109
|
+
coverageGap: brief.coverage?.coverageGap ?? null,
|
|
110
|
+
activeExploitation: whoIsUsingIt?.exploitationActivity ?? null,
|
|
111
|
+
whoIsUsingIt: {
|
|
112
|
+
threatActors: whoIsUsingIt?.threatActors ?? null,
|
|
113
|
+
ransomware: whoIsUsingIt?.ransomware ?? null,
|
|
114
|
+
botnets: whoIsUsingIt?.botnets ?? null,
|
|
115
|
+
honeypot: whoIsUsingIt?.honeypot ?? null,
|
|
116
|
+
canaries: whoIsUsingIt?.canaries ?? null,
|
|
117
|
+
github: whoIsUsingIt?.github ?? null,
|
|
118
|
+
counts: whoIsUsingIt?.counts ?? null,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A union member this module does not know is schema drift, not an outage. Reporting it as a
|
|
124
|
+
* retry state would have every call ask for a retry that can never succeed; throwing surfaces it as
|
|
125
|
+
* an error with a class in telemetry. Typed `never` so adding a member to the union without a case
|
|
126
|
+
* here fails the build.
|
|
127
|
+
*/
|
|
128
|
+
function unexpectedMember(field, member) {
|
|
129
|
+
const typename = member.__typename;
|
|
130
|
+
return new Error(`Invalid response from JupiterOne API: ${field} returned unexpected __typename ${String(typename)}`);
|
|
131
|
+
}
|
|
132
|
+
/** Flatten the brief outcome union to a discriminated `outcome` field. */
|
|
133
|
+
function projectBriefResult(result, detail) {
|
|
134
|
+
switch (result.__typename) {
|
|
135
|
+
case 'EmergingExposureBrief':
|
|
136
|
+
return detail
|
|
137
|
+
? { outcome: 'found', subjectId: result.subjectId, brief: result }
|
|
138
|
+
: projectCompactBrief(result);
|
|
139
|
+
case 'EmergingExposureNotFound':
|
|
140
|
+
return { outcome: 'not_found', subjectId: result.subjectId };
|
|
141
|
+
case 'EmergingExposureInvalidInput':
|
|
142
|
+
return { outcome: 'invalid_input', message: result.message };
|
|
143
|
+
case 'EmergingExposureSourceUnavailable':
|
|
144
|
+
// An explicit retry state — never "no such CVE". The validated id rides along.
|
|
145
|
+
return {
|
|
146
|
+
outcome: 'source_unavailable',
|
|
147
|
+
subjectId: result.subjectId,
|
|
148
|
+
retryable: result.retryable ?? true,
|
|
149
|
+
};
|
|
150
|
+
default:
|
|
151
|
+
throw unexpectedMember('emergingExposure', result);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Flatten one environment union member to a discriminated `status` field. */
|
|
155
|
+
function projectEnvironmentResult(result) {
|
|
156
|
+
switch (result.__typename) {
|
|
157
|
+
case 'EmergingExposureEnvironment':
|
|
158
|
+
return {
|
|
159
|
+
subjectId: result.subjectId,
|
|
160
|
+
status: 'checked',
|
|
161
|
+
scannerConfirmedAssetCount: result.scannerConfirmedAssetCount,
|
|
162
|
+
unifiedVulnerabilityId: result.unifiedVulnerabilityId ?? null,
|
|
163
|
+
assetExposure: result.assetExposure ?? null,
|
|
164
|
+
};
|
|
165
|
+
case 'EmergingExposureEnvironmentInvalidSubject':
|
|
166
|
+
return { subjectId: result.subjectId, status: 'invalid_input', message: result.message };
|
|
167
|
+
case 'EmergingExposureEnvironmentUnavailable':
|
|
168
|
+
return {
|
|
169
|
+
subjectId: result.subjectId,
|
|
170
|
+
status: 'unavailable',
|
|
171
|
+
retryable: result.retryable ?? true,
|
|
172
|
+
};
|
|
173
|
+
default:
|
|
174
|
+
throw unexpectedMember('emergingExposureEnvironments', result);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Output envelopes are open (`.loose()` via the SDK wrapper): the documented keys are a contract,
|
|
178
|
+
// and the handlers deliberately forward richer nested content (the full brief under `detail`,
|
|
179
|
+
// upstream display fields) on top of them. Scalars copied straight from the API are `.nullish()`:
|
|
180
|
+
// the schema declares them non-null, but an advertised non-nullable scalar the backend ever nulls
|
|
181
|
+
// rejects the whole call on a validating client (the hasSkippedSteps failure), and the cost of
|
|
182
|
+
// admitting null here is nothing.
|
|
183
|
+
const getThreatOutput = {
|
|
184
|
+
// 'found' rather than 'resolved': a weaker model read "resolved" as "remediated" on dev, which
|
|
185
|
+
// is what the word means everywhere else in vulnerability management. Same for 'checked' below.
|
|
186
|
+
outcome: zod_1.z.enum(['found', 'not_found', 'invalid_input', 'source_unavailable']),
|
|
187
|
+
subjectId: zod_1.z.string().nullish(),
|
|
188
|
+
message: zod_1.z.string().nullish(),
|
|
189
|
+
retryable: zod_1.z.boolean().optional(),
|
|
190
|
+
tier: zod_1.z.string().nullish(),
|
|
191
|
+
stance: zod_1.z.string().nullish(),
|
|
192
|
+
headline: zod_1.z.string().optional(),
|
|
193
|
+
support: zod_1.z.string().optional(),
|
|
194
|
+
coverageGap: zod_1.z.boolean().nullish(),
|
|
195
|
+
affectedProduct: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullish(),
|
|
196
|
+
brief: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
197
|
+
};
|
|
198
|
+
const getThreatTrendingOutput = {
|
|
199
|
+
generatedAt: zod_1.z.string().nullish(),
|
|
200
|
+
items: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.any())),
|
|
201
|
+
};
|
|
202
|
+
const checkThreatExposureOutput = {
|
|
203
|
+
results: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.any())),
|
|
204
|
+
};
|
|
205
|
+
exports.threatTools = [
|
|
206
|
+
(0, types_js_1.defineTool)({
|
|
207
|
+
name: 'get-threat',
|
|
208
|
+
title: 'Get Threat Brief',
|
|
209
|
+
description: (0, load_description_js_1.loadDescription)('get-threat.md'),
|
|
210
|
+
inputSchema: {
|
|
211
|
+
cveId: zod_1.z.string().describe(CVE_ID_DESCRIPTION),
|
|
212
|
+
assetExposure: zod_1.z
|
|
213
|
+
.enum(['public', 'internal'])
|
|
214
|
+
.optional()
|
|
215
|
+
.describe('Optional BOD 26-04 asset-exposure hook. When supplied, remediation returns a single ' +
|
|
216
|
+
'resolved branch instead of the two-branch conditional. Omit to get both branches.'),
|
|
217
|
+
detail: zod_1.z
|
|
218
|
+
.boolean()
|
|
219
|
+
.optional()
|
|
220
|
+
.describe('When true, return the full brief (larger payload: CPE footprint, threat-actor ' +
|
|
221
|
+
'techniques and control mappings, detection tooling, exploit references). Default ' +
|
|
222
|
+
'false returns a compact, decision-first summary.'),
|
|
223
|
+
},
|
|
224
|
+
outputSchema: getThreatOutput,
|
|
225
|
+
annotations: types_js_1.READ_ONLY,
|
|
226
|
+
accessDeniedHint: ACCESS_DENIED_HINT,
|
|
227
|
+
errorContext: 'Error fetching threat brief',
|
|
228
|
+
handler: async ({ cveId, assetExposure, detail }, client) => {
|
|
229
|
+
const wantsDetail = detail ?? false;
|
|
230
|
+
const result = await client.getThreatBrief(cveId, { assetExposure, detail: wantsDetail });
|
|
231
|
+
return (0, result_js_1.structuredResult)(projectBriefResult(result, wantsDetail));
|
|
232
|
+
},
|
|
233
|
+
}),
|
|
234
|
+
(0, types_js_1.defineTool)({
|
|
235
|
+
name: 'get-threat-trending',
|
|
236
|
+
title: 'Get Trending Threats',
|
|
237
|
+
description: (0, load_description_js_1.loadDescription)('get-threat-trending.md'),
|
|
238
|
+
inputSchema: {
|
|
239
|
+
limit: zod_1.z
|
|
240
|
+
.number()
|
|
241
|
+
.int()
|
|
242
|
+
.min(1)
|
|
243
|
+
.max(50)
|
|
244
|
+
.optional()
|
|
245
|
+
.describe('Optional client-side cap on the number of trending items returned. The server list ' +
|
|
246
|
+
'is ranked and capped upstream (25 rows today); list order is the ranking.'),
|
|
247
|
+
},
|
|
248
|
+
outputSchema: getThreatTrendingOutput,
|
|
249
|
+
annotations: types_js_1.READ_ONLY,
|
|
250
|
+
accessDeniedHint: ACCESS_DENIED_HINT,
|
|
251
|
+
errorContext: 'Error fetching trending threats',
|
|
252
|
+
handler: async ({ limit }, client) => {
|
|
253
|
+
const { generatedAt, items } = await client.getThreatTrending();
|
|
254
|
+
return (0, result_js_1.structuredResult)({
|
|
255
|
+
generatedAt,
|
|
256
|
+
items: limit === undefined ? items : items.slice(0, limit),
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
}),
|
|
260
|
+
(0, types_js_1.defineTool)({
|
|
261
|
+
name: 'check-threat-exposure',
|
|
262
|
+
title: 'Check Threat Exposure',
|
|
263
|
+
description: (0, load_description_js_1.loadDescription)('check-threat-exposure.md'),
|
|
264
|
+
inputSchema: {
|
|
265
|
+
cveIds: zod_1.z
|
|
266
|
+
.array(zod_1.z.string())
|
|
267
|
+
.min(1)
|
|
268
|
+
.max(MAX_EXPOSURE_SUBJECTS)
|
|
269
|
+
.describe(`The CVE identifiers to check against this account's graph (1–${MAX_EXPOSURE_SUBJECTS}). ` +
|
|
270
|
+
'Each is answered independently; a malformed id fails only its own entry.'),
|
|
271
|
+
},
|
|
272
|
+
outputSchema: checkThreatExposureOutput,
|
|
273
|
+
annotations: types_js_1.READ_ONLY,
|
|
274
|
+
accessDeniedHint: ACCESS_DENIED_HINT,
|
|
275
|
+
errorContext: 'Error checking threat exposure',
|
|
276
|
+
handler: async ({ cveIds }, client) => {
|
|
277
|
+
// The brief accepts any casing but the environment lookup rejects a lowercase id as
|
|
278
|
+
// invalid_input (observed on dev), so normalise here rather than teach callers two rules.
|
|
279
|
+
const results = await client.checkThreatExposure(cveIds.map((id) => id.trim().toUpperCase()));
|
|
280
|
+
return (0, result_js_1.structuredResult)({ results: results.map(projectEnvironmentResult) });
|
|
281
|
+
},
|
|
282
|
+
}),
|
|
283
|
+
];
|
|
284
|
+
//# sourceMappingURL=threat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threat.js","sourceRoot":"","sources":["../../../src/server/tools/threat.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAQxB,yEAAkE;AAClE,2CAA+C;AAC/C,yCAAwE;AAExE;;;;;;;;;;;;;;;GAeG;AAEH,mGAAmG;AACnG,8FAA8F;AAC9F,0BAA0B;AAC1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,kB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AW,EAAE,CAAC,CAAC,CAAC;YAC9F,OAAO,IAAA,4BAAgB,EAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;CACH,CAAC"}
|
|
@@ -68,6 +68,11 @@ export interface ToolDefinition<T extends z.ZodRawShape = z.ZodRawShape> {
|
|
|
68
68
|
handler: ToolHandler<T>;
|
|
69
69
|
/** Prefix for the generic error envelope when the handler throws (e.g. "Error listing rules"). */
|
|
70
70
|
errorContext: string;
|
|
71
|
+
/**
|
|
72
|
+
* Appended to the access-denied frame when this tool's backing API gates on more than account
|
|
73
|
+
* membership (an entitlement, say), so a 403 from an unentitled account is not read as a revoked one.
|
|
74
|
+
*/
|
|
75
|
+
accessDeniedHint?: string;
|
|
71
76
|
/** Optional validator-aware error formatter (J1QL uses this for actionable suggestions). */
|
|
72
77
|
formatError?: (error: unknown, params: z.infer<z.ZodObject<T>>, validator: J1QLValidator) => ToolResult;
|
|
73
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/tools/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EA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WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC/B,SAAS,EAAE,aAAa,KACrB,UAAU,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAE1F;AAED,mGAAmG;AACnG,eAAO,MAAM,SAAS,EAAE,eAAwC,CAAC;AAGjE,eAAO,MAAM,MAAM,EAAE,eAIpB,CAAC;AACF,eAAO,MAAM,MAAM,EAAE,eAAgE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/tools/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/tools/types.ts"],"names":[],"mappings":";;;AA+FA,gCAEC;AAND;;;GAGG;AACH,SAAgB,UAAU,CAA0B,GAAsB;IACxE,OAAO,GAAgC,CAAC;AAC1C,CAAC;AAED,mGAAmG;AACtF,QAAA,SAAS,GAAoB,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AACjE,kGAAkG;AAClG,mFAAmF;AACtE,QAAA,MAAM,GAAoB;IACrC,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;CACtB,CAAC;AACW,QAAA,MAAM,GAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/server/tools/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhD;AAID,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/server/tools/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhD;AAID,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AA+ED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWvF;AA+FD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0D9F"}
|
|
@@ -27,9 +27,10 @@ const REASON_MAX = 500;
|
|
|
27
27
|
function truncateReason(reason) {
|
|
28
28
|
return reason.length > REASON_MAX ? `${reason.slice(0, REASON_MAX)}…` : reason;
|
|
29
29
|
}
|
|
30
|
-
// Allowlist of
|
|
31
|
-
// which keeps sensitive payloads out: action headers/endpoints/
|
|
32
|
-
// templates, J1QL variables/flags/scopeFilters, rule
|
|
30
|
+
// Allowlist of inputs safe to log verbatim (scalars, plus the CVE-id list). Everything not listed
|
|
31
|
+
// is dropped (default-deny), which keeps sensitive payloads out: action headers/endpoints/
|
|
32
|
+
// recipients/body, integration config, templates, J1QL variables/flags/scopeFilters, rule
|
|
33
|
+
// operations, and the raw widget input.
|
|
33
34
|
const SAFE_INPUT_KEYS = [
|
|
34
35
|
'ruleId',
|
|
35
36
|
'dashboardId',
|
|
@@ -53,6 +54,10 @@ const SAFE_INPUT_KEYS = [
|
|
|
53
54
|
// The widget being updated. Without it, an upstream 500 on update-dashboard-widget (observed
|
|
54
55
|
// twice on dev, 2026-08-21) can be tied to a board but not to the widget that drew it.
|
|
55
56
|
'widgetId',
|
|
57
|
+
// The threat tools' brief options: a boolean and a schema-validated enum. Their CVE ids are
|
|
58
|
+
// logged too, but through summarizeCveIds below, which admits only well-formed identifiers.
|
|
59
|
+
'assetExposure',
|
|
60
|
+
'detail',
|
|
56
61
|
];
|
|
57
62
|
/**
|
|
58
63
|
* Named lifts out of a widget-write payload.
|
|
@@ -79,6 +84,24 @@ function summarizeWidgetInput(input, out) {
|
|
|
79
84
|
out.widgetQueries = shapes;
|
|
80
85
|
}
|
|
81
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* CVE identifiers are public vocabulary and which CVEs customers ask about is the threat tools'
|
|
89
|
+
* primary usage signal. But the input schemas accept any string, so a "CVE id" can carry anything
|
|
90
|
+
* a caller typed. Only values shaped like a CVE id are logged (canonically cased); everything else
|
|
91
|
+
* is replaced by a marker, so the batch size and the malformed-input rate stay measurable without
|
|
92
|
+
* the text.
|
|
93
|
+
*/
|
|
94
|
+
const CVE_ID = /^CVE-\d{4}-\d{4,7}$/i;
|
|
95
|
+
const NOT_A_CVE_ID = '[NOT_A_CVE_ID]';
|
|
96
|
+
function loggableCveId(value) {
|
|
97
|
+
return typeof value === 'string' && CVE_ID.test(value) ? value.toUpperCase() : NOT_A_CVE_ID;
|
|
98
|
+
}
|
|
99
|
+
function summarizeCveIds(params, out) {
|
|
100
|
+
if (params.cveId !== undefined)
|
|
101
|
+
out.cveId = loggableCveId(params.cveId);
|
|
102
|
+
if (Array.isArray(params.cveIds))
|
|
103
|
+
out.cveIds = params.cveIds.map(loggableCveId);
|
|
104
|
+
}
|
|
82
105
|
/** Allowlisted, sanitized summary of tool inputs for usage telemetry. */
|
|
83
106
|
function summarizeInput(params) {
|
|
84
107
|
const out = {};
|
|
@@ -92,6 +115,7 @@ function summarizeInput(params) {
|
|
|
92
115
|
if (params.cursor !== undefined)
|
|
93
116
|
out.hasCursor = true;
|
|
94
117
|
summarizeWidgetInput(params.input, out);
|
|
118
|
+
summarizeCveIds(params, out);
|
|
95
119
|
return out;
|
|
96
120
|
}
|
|
97
121
|
/**
|
|
@@ -190,6 +214,8 @@ const COLLECTION_KEYS = [
|
|
|
190
214
|
'evaluations',
|
|
191
215
|
'activeAlerts',
|
|
192
216
|
'dashboards',
|
|
217
|
+
'items',
|
|
218
|
+
'results',
|
|
193
219
|
];
|
|
194
220
|
/**
|
|
195
221
|
* Result metadata (counts, pagination, status) derived from the structured payload.
|
|
@@ -205,6 +231,11 @@ function summarizeResult(result, toolName) {
|
|
|
205
231
|
const obj = sc;
|
|
206
232
|
if (typeof obj.status === 'string')
|
|
207
233
|
out.status = obj.status;
|
|
234
|
+
// The threat brief's four-way discriminator. Without it a `source_unavailable` (the intelligence
|
|
235
|
+
// source is down) and a `not_found` are the same successful row, and the one signal that says
|
|
236
|
+
// whether that source is healthy is lost.
|
|
237
|
+
if (typeof obj.outcome === 'string')
|
|
238
|
+
out.outcome = obj.outcome;
|
|
208
239
|
// The query correlation id ties an IN_PROGRESS handle issuance to its later get-query-results
|
|
209
240
|
// redemptions, making the deferred-query lifecycle joinable in telemetry.
|
|
210
241
|
if (typeof obj.correlationId === 'string')
|
|
@@ -221,6 +252,18 @@ function summarizeResult(result, toolName) {
|
|
|
221
252
|
}
|
|
222
253
|
}
|
|
223
254
|
}
|
|
255
|
+
// check-threat-exposure answers per subject, so its discriminator lives inside each `results`
|
|
256
|
+
// entry; a count alone makes a batch of real counts and a batch of `unavailable` identical.
|
|
257
|
+
if (Array.isArray(obj.results)) {
|
|
258
|
+
const counts = {};
|
|
259
|
+
for (const entry of obj.results) {
|
|
260
|
+
const status = entry?.status;
|
|
261
|
+
if (typeof status === 'string')
|
|
262
|
+
counts[status] = (counts[status] ?? 0) + 1;
|
|
263
|
+
}
|
|
264
|
+
if (Object.keys(counts).length > 0)
|
|
265
|
+
out.resultStatusCounts = counts;
|
|
266
|
+
}
|
|
224
267
|
summarizeWidgetResult(obj, out);
|
|
225
268
|
summarizeDiagnosis(obj, out);
|
|
226
269
|
// The board-creation event is the one event in a build sequence with no dashboardId: every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/server/tools/usage.ts"],"names":[],"mappings":";;AAeA,gCAKC;AAID,wCAEC;
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/server/tools/usage.ts"],"names":[],"mappings":";;AAeA,gCAKC;AAID,wCAEC;AAgFD,wCAWC;AAqGD,0CA0DC;AAlRD;;;;;;;;;;;;GAYG;AACH,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,oBAAoB,EAAE,cAAc,CAAC;SAC7C,OAAO,CAAC,oBAAoB,EAAE,cAAc,CAAC;SAC7C,OAAO,CAAC,mCAAmC,EAAE,gBAAgB,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB,SAAgB,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACjF,CAAC;AAED,kGAAkG;AAClG,2FAA2F;AAC3F,0FAA0F;AAC1F,wCAAwC;AACxC,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,aAAa;IACb,kBAAkB;IAClB,uBAAuB;IACvB,OAAO;IACP,cAAc;IACd,YAAY;IACZ,OAAO;IACP,MAAM;IACN,iBAAiB;IACjB,MAAM;IACN,QAAQ;IACR,MAAM;IACN,WAAW;IACX,gBAAgB;IAChB,cAAc;IACd,KAAK;IACL,eAAe;IACf,gBAAgB;IAChB,6FAA6F;IAC7F,uFAAuF;IACvF,UAAU;IACV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,CAAC;QACrF,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,EAAE,CAAC;IAC3B,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAiD,CAAC;IACvE,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;QAC1E,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC3C,CAAC;SAAM,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -737,4 +737,136 @@ export interface InsightsDashboard {
|
|
|
737
737
|
}>;
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
+
export type ThreatAssetExposure = 'public' | 'internal';
|
|
741
|
+
/** One emphasis-tagged narrative run of a verdict headline or support line. */
|
|
742
|
+
export interface ThreatNarrativeSegment {
|
|
743
|
+
text: string | null;
|
|
744
|
+
emphasis: string | null;
|
|
745
|
+
}
|
|
746
|
+
/** The four metric tiles, a discriminated union in fixed order (cvss, epss, maturity, kev). */
|
|
747
|
+
export type ThreatMetricTile = {
|
|
748
|
+
__typename: 'EmergingExposureCvssTile';
|
|
749
|
+
score: number | null;
|
|
750
|
+
severity: string | null;
|
|
751
|
+
emphasis: string | null;
|
|
752
|
+
} | {
|
|
753
|
+
__typename: 'EmergingExposureEpssTile';
|
|
754
|
+
percentile: number | null;
|
|
755
|
+
emphasis: string | null;
|
|
756
|
+
} | {
|
|
757
|
+
__typename: 'EmergingExposureMaturityTile';
|
|
758
|
+
maturity: string | null;
|
|
759
|
+
emphasis: string | null;
|
|
760
|
+
} | {
|
|
761
|
+
__typename: 'EmergingExposureKevTile';
|
|
762
|
+
state: string | null;
|
|
763
|
+
emphasis: string | null;
|
|
764
|
+
};
|
|
765
|
+
export interface ThreatTimelineNode {
|
|
766
|
+
id: string;
|
|
767
|
+
state: string;
|
|
768
|
+
date: string | null;
|
|
769
|
+
}
|
|
770
|
+
export interface ThreatTimeline {
|
|
771
|
+
nodes: ThreatTimelineNode[] | null;
|
|
772
|
+
kevLead: {
|
|
773
|
+
kind: string;
|
|
774
|
+
days: number;
|
|
775
|
+
} | null;
|
|
776
|
+
inCisaKev: boolean | null;
|
|
777
|
+
inVulncheckKev: boolean | null;
|
|
778
|
+
cisaKevDateAdded: string | null;
|
|
779
|
+
vulncheckKevDateAdded: string | null;
|
|
780
|
+
}
|
|
781
|
+
export interface ThreatWhoIsUsingIt {
|
|
782
|
+
threatActors: boolean | null;
|
|
783
|
+
ransomware: boolean | null;
|
|
784
|
+
botnets: boolean | null;
|
|
785
|
+
honeypot: boolean | null;
|
|
786
|
+
canaries: boolean | null;
|
|
787
|
+
github: boolean | null;
|
|
788
|
+
hasAttribution: boolean | null;
|
|
789
|
+
counts: Record<string, number | null> | null;
|
|
790
|
+
exploitationActivity: Record<string, unknown> | null;
|
|
791
|
+
/** Drill-in lists and first/last-seen dates, selected only by the full brief. */
|
|
792
|
+
[key: string]: unknown;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* A resolved brief. The compact selection set fills the named fields; `detail: true` selects the
|
|
796
|
+
* full brief, whose extra sections (whatItIs, detection, fingerprint, sources, …) ride along under
|
|
797
|
+
* the index signature and are forwarded to the caller untouched.
|
|
798
|
+
*/
|
|
799
|
+
export interface ThreatBrief {
|
|
800
|
+
__typename: 'EmergingExposureBrief';
|
|
801
|
+
subjectId: string;
|
|
802
|
+
assessedAt: string;
|
|
803
|
+
verdict: {
|
|
804
|
+
tier: string;
|
|
805
|
+
stance: string;
|
|
806
|
+
impactLabel: string | null;
|
|
807
|
+
headline: ThreatNarrativeSegment[] | null;
|
|
808
|
+
support: ThreatNarrativeSegment[] | null;
|
|
809
|
+
beats: string[] | null;
|
|
810
|
+
} | null;
|
|
811
|
+
tiles: ThreatMetricTile[] | null;
|
|
812
|
+
ssvc: Record<string, unknown> | null;
|
|
813
|
+
remediation: Record<string, unknown> | null;
|
|
814
|
+
timeline: ThreatTimeline | null;
|
|
815
|
+
coverage: {
|
|
816
|
+
coverageGap: boolean | null;
|
|
817
|
+
scanners: unknown[] | null;
|
|
818
|
+
} | null;
|
|
819
|
+
whoIsUsingIt: ThreatWhoIsUsingIt | null;
|
|
820
|
+
fingerprint: {
|
|
821
|
+
affectedProduct: (ThreatAffectedProduct & {
|
|
822
|
+
versionRanges: unknown;
|
|
823
|
+
}) | null;
|
|
824
|
+
} | null;
|
|
825
|
+
[key: string]: unknown;
|
|
826
|
+
}
|
|
827
|
+
/** The four-outcome brief union, discriminated by `__typename`. */
|
|
828
|
+
export type ThreatBriefResult = ThreatBrief | {
|
|
829
|
+
__typename: 'EmergingExposureNotFound';
|
|
830
|
+
subjectId: string;
|
|
831
|
+
} | {
|
|
832
|
+
__typename: 'EmergingExposureInvalidInput';
|
|
833
|
+
message: string;
|
|
834
|
+
} | {
|
|
835
|
+
__typename: 'EmergingExposureSourceUnavailable';
|
|
836
|
+
subjectId: string;
|
|
837
|
+
retryable: boolean;
|
|
838
|
+
};
|
|
839
|
+
export interface ThreatAffectedProduct {
|
|
840
|
+
vendor: string;
|
|
841
|
+
product: string;
|
|
842
|
+
}
|
|
843
|
+
export interface ThreatTrendingItem {
|
|
844
|
+
subjectId: string;
|
|
845
|
+
tier: string;
|
|
846
|
+
impactLabel: string | null;
|
|
847
|
+
affectedProduct: ThreatAffectedProduct | null;
|
|
848
|
+
[key: string]: unknown;
|
|
849
|
+
}
|
|
850
|
+
export interface ThreatTrendingResponse {
|
|
851
|
+
emergingExposureTrending: {
|
|
852
|
+
generatedAt: string;
|
|
853
|
+
items: ThreatTrendingItem[];
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
/** The per-subject environment union, discriminated by `__typename`. */
|
|
857
|
+
export type ThreatEnvironmentResult = {
|
|
858
|
+
__typename: 'EmergingExposureEnvironment';
|
|
859
|
+
subjectId: string;
|
|
860
|
+
scannerConfirmedAssetCount: number;
|
|
861
|
+
unifiedVulnerabilityId: string | null;
|
|
862
|
+
assetExposure: ThreatAssetExposure | null;
|
|
863
|
+
} | {
|
|
864
|
+
__typename: 'EmergingExposureEnvironmentInvalidSubject';
|
|
865
|
+
subjectId: string;
|
|
866
|
+
message: string;
|
|
867
|
+
} | {
|
|
868
|
+
__typename: 'EmergingExposureEnvironmentUnavailable';
|
|
869
|
+
subjectId: string;
|
|
870
|
+
retryable: boolean;
|
|
871
|
+
};
|
|
740
872
|
//# sourceMappingURL=jupiterone.d.ts.map
|