@jupiterone/jupiterone-mcp 2.7.0 → 2.9.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 +26 -10
- package/dist/client/graphql/mutations.d.ts +6 -0
- package/dist/client/graphql/mutations.d.ts.map +1 -1
- package/dist/client/graphql/mutations.js +37 -1
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.d.ts +16 -1
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +62 -1
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +7 -0
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +19 -0
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/criticality-service.d.ts +16 -0
- package/dist/client/services/criticality-service.d.ts.map +1 -0
- package/dist/client/services/criticality-service.js +72 -0
- package/dist/client/services/criticality-service.js.map +1 -0
- package/dist/client/services/rule-service.d.ts +11 -1
- package/dist/client/services/rule-service.d.ts.map +1 -1
- package/dist/client/services/rule-service.js +17 -0
- package/dist/client/services/rule-service.js.map +1 -1
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +428 -39
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts +10 -0
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +64 -1
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/compliance/attestations.d.ts.map +1 -1
- package/dist/server/tools/compliance/attestations.js +11 -10
- package/dist/server/tools/compliance/attestations.js.map +1 -1
- package/dist/server/tools/compliance/authoring.d.ts.map +1 -1
- package/dist/server/tools/compliance/authoring.js +36 -35
- package/dist/server/tools/compliance/authoring.js.map +1 -1
- package/dist/server/tools/compliance/controls.d.ts.map +1 -1
- package/dist/server/tools/compliance/controls.js +12 -11
- package/dist/server/tools/compliance/controls.js.map +1 -1
- package/dist/server/tools/compliance/exemptions.d.ts.map +1 -1
- package/dist/server/tools/compliance/exemptions.js +16 -15
- package/dist/server/tools/compliance/exemptions.js.map +1 -1
- package/dist/server/tools/compliance/framework.d.ts.map +1 -1
- package/dist/server/tools/compliance/framework.js +24 -23
- package/dist/server/tools/compliance/framework.js.map +1 -1
- package/dist/server/tools/compliance/graph.js +1 -1
- package/dist/server/tools/compliance/graph.js.map +1 -1
- package/dist/server/tools/compliance/requirements.d.ts.map +1 -1
- package/dist/server/tools/compliance/requirements.js +11 -10
- package/dist/server/tools/compliance/requirements.js.map +1 -1
- package/dist/server/tools/compliance/shared.d.ts +4 -32
- package/dist/server/tools/compliance/shared.d.ts.map +1 -1
- package/dist/server/tools/compliance/shared.js +11 -76
- package/dist/server/tools/compliance/shared.js.map +1 -1
- package/dist/server/tools/compliance/summary.d.ts.map +1 -1
- package/dist/server/tools/compliance/summary.js +16 -15
- package/dist/server/tools/compliance/summary.js.map +1 -1
- package/dist/server/tools/compliance/tests.d.ts.map +1 -1
- package/dist/server/tools/compliance/tests.js +26 -25
- package/dist/server/tools/compliance/tests.js.map +1 -1
- package/dist/server/tools/compliance/transitions.d.ts.map +1 -1
- package/dist/server/tools/compliance/transitions.js +15 -14
- package/dist/server/tools/compliance/transitions.js.map +1 -1
- package/dist/server/tools/criticality/context.d.ts +48 -0
- package/dist/server/tools/criticality/context.d.ts.map +1 -0
- package/dist/server/tools/criticality/context.js +90 -0
- package/dist/server/tools/criticality/context.js.map +1 -0
- package/dist/server/tools/criticality/index.d.ts +11 -0
- package/dist/server/tools/criticality/index.d.ts.map +1 -0
- package/dist/server/tools/criticality/index.js +15 -0
- package/dist/server/tools/criticality/index.js.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts +86 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.js +475 -0
- package/dist/server/tools/criticality/ladder-delta.js.map +1 -0
- package/dist/server/tools/criticality/levels-read.d.ts +43 -0
- package/dist/server/tools/criticality/levels-read.d.ts.map +1 -0
- package/dist/server/tools/criticality/levels-read.js +101 -0
- package/dist/server/tools/criticality/levels-read.js.map +1 -0
- package/dist/server/tools/criticality/read.d.ts +13 -0
- package/dist/server/tools/criticality/read.d.ts.map +1 -0
- package/dist/server/tools/criticality/read.js +214 -0
- package/dist/server/tools/criticality/read.js.map +1 -0
- package/dist/server/tools/criticality/resource.d.ts +35 -0
- package/dist/server/tools/criticality/resource.d.ts.map +1 -0
- package/dist/server/tools/criticality/resource.js +84 -0
- package/dist/server/tools/criticality/resource.js.map +1 -0
- package/dist/server/tools/criticality/schemas.d.ts +114 -0
- package/dist/server/tools/criticality/schemas.d.ts.map +1 -0
- package/dist/server/tools/criticality/schemas.js +99 -0
- package/dist/server/tools/criticality/schemas.js.map +1 -0
- package/dist/server/tools/criticality/update.d.ts +5 -0
- package/dist/server/tools/criticality/update.d.ts.map +1 -0
- package/dist/server/tools/criticality/update.js +243 -0
- package/dist/server/tools/criticality/update.js.map +1 -0
- 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/j1ql.d.ts.map +1 -1
- package/dist/server/tools/j1ql.js +69 -18
- package/dist/server/tools/j1ql.js.map +1 -1
- package/dist/server/tools/reference.d.ts +1 -1
- package/dist/server/tools/reference.d.ts.map +1 -1
- package/dist/server/tools/reference.js +2 -0
- package/dist/server/tools/reference.js.map +1 -1
- package/dist/server/tools/rule-preview-checks.d.ts +95 -0
- package/dist/server/tools/rule-preview-checks.d.ts.map +1 -0
- package/dist/server/tools/rule-preview-checks.js +380 -0
- package/dist/server/tools/rule-preview-checks.js.map +1 -0
- package/dist/server/tools/rule-preview.d.ts +98 -0
- package/dist/server/tools/rule-preview.d.ts.map +1 -0
- package/dist/server/tools/rule-preview.js +490 -0
- package/dist/server/tools/rule-preview.js.map +1 -0
- package/dist/server/tools/rules.d.ts +1 -1
- package/dist/server/tools/rules.d.ts.map +1 -1
- package/dist/server/tools/rules.js +245 -30
- package/dist/server/tools/rules.js.map +1 -1
- package/dist/server/tools/shared.d.ts +44 -0
- package/dist/server/tools/shared.d.ts.map +1 -0
- package/dist/server/tools/shared.js +95 -0
- package/dist/server/tools/shared.js.map +1 -0
- package/dist/server/tools/usage.d.ts +8 -1
- package/dist/server/tools/usage.d.ts.map +1 -1
- package/dist/server/tools/usage.js +170 -2
- package/dist/server/tools/usage.js.map +1 -1
- package/dist/server/tools/value-probe.d.ts +12 -1
- package/dist/server/tools/value-probe.d.ts.map +1 -1
- package/dist/server/tools/value-probe.js +39 -13
- package/dist/server/tools/value-probe.js.map +1 -1
- package/dist/types/jupiterone.d.ts +123 -5
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/dist/utils/criticality-query.d.ts +97 -0
- package/dist/utils/criticality-query.d.ts.map +1 -0
- package/dist/utils/criticality-query.js +319 -0
- package/dist/utils/criticality-query.js.map +1 -0
- package/dist/utils/j1ql-filters.d.ts +3 -1
- package/dist/utils/j1ql-filters.d.ts.map +1 -1
- package/dist/utils/j1ql-filters.js +19 -7
- package/dist/utils/j1ql-filters.js.map +1 -1
- package/dist/utils/j1ql-validator.d.ts +2 -0
- package/dist/utils/j1ql-validator.d.ts.map +1 -1
- package/dist/utils/j1ql-validator.js +9 -2
- package/dist/utils/j1ql-validator.js.map +1 -1
- package/node_modules/dtrace-provider/build/Makefile +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RULE_TRANSFORMS = exports.SLACK_BODY_MAX = void 0;
|
|
4
|
+
exports.templateExpressions = templateExpressions;
|
|
5
|
+
exports.undefinedReads = undefinedReads;
|
|
6
|
+
exports.slackEnvelope = slackEnvelope;
|
|
7
|
+
exports.loopTemplateWarning = loopTemplateWarning;
|
|
8
|
+
exports.renderedActionWarnings = renderedActionWarnings;
|
|
9
|
+
/**
|
|
10
|
+
* rule-service `sendSlackMessageAction/schema.ts` `MAX_SLACK_BODY_LENGTH`. The save rejects a
|
|
11
|
+
* longer body template, and the send cuts a longer rendered body to this length with `...`
|
|
12
|
+
* (`truncateString`). A field test's 3,400-character template previewed clean and failed to
|
|
13
|
+
* save (2026-10-30). No other action schema caps a field's length.
|
|
14
|
+
*/
|
|
15
|
+
exports.SLACK_BODY_MAX = 1500;
|
|
16
|
+
const CONTINUATION = '...';
|
|
17
|
+
/**
|
|
18
|
+
* The transforms rule-service registers for rule templates: `createJexl` and the rule transforms
|
|
19
|
+
* in `src/jexl/index.ts`, the same set the preview renderer and a live run use.
|
|
20
|
+
*/
|
|
21
|
+
exports.RULE_TRANSFORMS = [
|
|
22
|
+
'mapProperty',
|
|
23
|
+
'join',
|
|
24
|
+
'length',
|
|
25
|
+
'capitalize',
|
|
26
|
+
'dateAdd',
|
|
27
|
+
'formatDate',
|
|
28
|
+
'mapTemplate',
|
|
29
|
+
'merge',
|
|
30
|
+
'uniquePropertyValues',
|
|
31
|
+
'queryDataDifference',
|
|
32
|
+
];
|
|
33
|
+
/** rule-service `sendSlackMessageAction` `alertLevelToColor`; no level is `#000000`. */
|
|
34
|
+
const SLACK_LEVEL_COLORS = {
|
|
35
|
+
CRITICAL: '#AF2418',
|
|
36
|
+
HIGH: '#AF2418',
|
|
37
|
+
MEDIUM: '#EF9436',
|
|
38
|
+
LOW: '#DFBF40',
|
|
39
|
+
INFO: '#6699ff',
|
|
40
|
+
};
|
|
41
|
+
const SLACK_DEFAULT_COLOR = '#000000';
|
|
42
|
+
/** At most this many undefined reads per action, so one broken template cannot flood the result. */
|
|
43
|
+
const MAX_UNDEFINED_READS = 25;
|
|
44
|
+
/** The variables `mapTemplate` gives a named template besides `queries` and the rule's fields. */
|
|
45
|
+
const TEMPLATE_SCOPE = new Set(['item', 'itemIndex', 'itemCount']);
|
|
46
|
+
/** Every string field of an action, by its dotted path. */
|
|
47
|
+
function stringFields(value, path = '') {
|
|
48
|
+
if (typeof value === 'string')
|
|
49
|
+
return [[path, value]];
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
return value.flatMap((entry, i) => stringFields(entry, `${path}[${i}]`));
|
|
52
|
+
}
|
|
53
|
+
if (value !== null && typeof value === 'object') {
|
|
54
|
+
return Object.entries(value).flatMap(([key, entry]) => stringFields(entry, path ? `${path}.${key}` : key));
|
|
55
|
+
}
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The `{{...}}` expressions in a template string. An expression can hold an object literal
|
|
60
|
+
* (`{{[{sys: 'GitHub'}]|mapTemplate('row')}}`), so it ends at the first `}}` outside a string,
|
|
61
|
+
* not at the first brace.
|
|
62
|
+
*/
|
|
63
|
+
function templateExpressions(template) {
|
|
64
|
+
const found = [];
|
|
65
|
+
let at = template.indexOf('{{');
|
|
66
|
+
while (at !== -1) {
|
|
67
|
+
let i = at + 2;
|
|
68
|
+
let quote = null;
|
|
69
|
+
for (; i < template.length; i++) {
|
|
70
|
+
const ch = template[i];
|
|
71
|
+
if (quote) {
|
|
72
|
+
if (ch === '\\')
|
|
73
|
+
i++;
|
|
74
|
+
else if (ch === quote)
|
|
75
|
+
quote = null;
|
|
76
|
+
}
|
|
77
|
+
else if (ch === "'" || ch === '"') {
|
|
78
|
+
quote = ch;
|
|
79
|
+
}
|
|
80
|
+
else if (ch === '}' && template[i + 1] === '}') {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (i >= template.length)
|
|
85
|
+
break;
|
|
86
|
+
found.push(template.slice(at + 2, i).trim());
|
|
87
|
+
at = template.indexOf('{{', i + 2);
|
|
88
|
+
}
|
|
89
|
+
return found;
|
|
90
|
+
}
|
|
91
|
+
const STRING_LITERAL = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g;
|
|
92
|
+
/** A quoted member key, `['mfa']` or `["Total Users"]`: part of a path, not a string to drop. */
|
|
93
|
+
const QUOTED_KEY = /\[\s*('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")\s*\]/g;
|
|
94
|
+
const MEMBER_PATH = /(?<![\w$.\]])([A-Za-z_$][\w$]*)((?:\.[A-Za-z_$][\w$]*|\[\d+\]|\[#\d+\])+)/g;
|
|
95
|
+
const SEGMENT = /\.([A-Za-z_$][\w$]*)|\[(\d+)\]|\[#(\d+)\]/g;
|
|
96
|
+
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
97
|
+
/** A `mapTemplate` call once string literals are numbered placeholders (`mapTemplate(#0)`). */
|
|
98
|
+
const TEMPLATE_CALL = /mapTemplate\(\s*#(\d+)\s*\)/g;
|
|
99
|
+
function resolve(root, keys) {
|
|
100
|
+
let value = root;
|
|
101
|
+
for (const key of keys) {
|
|
102
|
+
if (value === null || value === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
value = value[key];
|
|
105
|
+
}
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
/** A read of `queries.<q>.data[n]` past the rows the sample kept, which a live run may still have. */
|
|
109
|
+
function pastSample(keys, context) {
|
|
110
|
+
const [name, field, index] = keys;
|
|
111
|
+
if (field !== 'data' || typeof index !== 'number')
|
|
112
|
+
return false;
|
|
113
|
+
const sample = context.samples.get(String(name));
|
|
114
|
+
return sample !== undefined && index >= sample.sampledRows && (sample.total ?? 0) > index;
|
|
115
|
+
}
|
|
116
|
+
function unquote(literal) {
|
|
117
|
+
return literal.slice(1, -1).replace(/\\(.)/g, '$1');
|
|
118
|
+
}
|
|
119
|
+
function pathText(root, keys) {
|
|
120
|
+
return (root +
|
|
121
|
+
keys
|
|
122
|
+
.map((key) => {
|
|
123
|
+
if (typeof key === 'number')
|
|
124
|
+
return `[${key}]`;
|
|
125
|
+
return IDENTIFIER.test(key) ? `.${key}` : `['${key.replace(/'/g, "\\'")}']`;
|
|
126
|
+
})
|
|
127
|
+
.join(''));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The member paths an expression reads, each as its root and keys. Quoted keys
|
|
131
|
+
* (`data[0]['mfa']`, `queries['q']`) are set aside before string literals are dropped, so they stay
|
|
132
|
+
* part of the path while `'queries.q.x'` as a literal reads nothing.
|
|
133
|
+
*/
|
|
134
|
+
function memberPaths(expression) {
|
|
135
|
+
const quoted = [];
|
|
136
|
+
const code = expression
|
|
137
|
+
.replace(QUOTED_KEY, (_match, literal) => `[#${quoted.push(unquote(literal)) - 1}]`)
|
|
138
|
+
.replace(STRING_LITERAL, "''");
|
|
139
|
+
return [...code.matchAll(MEMBER_PATH)].map(([, root, tail]) => ({
|
|
140
|
+
root,
|
|
141
|
+
keys: [...tail.matchAll(SEGMENT)].map(([, name, index, quotedAt]) => {
|
|
142
|
+
if (name !== undefined)
|
|
143
|
+
return name;
|
|
144
|
+
return index !== undefined ? Number(index) : quoted[Number(quotedAt)];
|
|
145
|
+
}),
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
function readsIn(expression, field, context, scope) {
|
|
149
|
+
const reads = [];
|
|
150
|
+
const { loop, hiddenLoopRef } = scope;
|
|
151
|
+
for (const { root, keys } of memberPaths(expression)) {
|
|
152
|
+
const text = pathText(root, keys);
|
|
153
|
+
if (root === 'queries') {
|
|
154
|
+
if (context.runtimeQueries?.has(String(keys[0])))
|
|
155
|
+
continue;
|
|
156
|
+
if (pastSample(keys, context) || resolve(context.queryData.queries, keys) !== undefined) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const sample = context.samples.get(String(keys[0]));
|
|
160
|
+
reads.push({
|
|
161
|
+
field,
|
|
162
|
+
expression,
|
|
163
|
+
path: text,
|
|
164
|
+
query: String(keys[0]),
|
|
165
|
+
...(sample?.total === 0 ? { emptyQuery: true } : {}),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else if (loop && root === loop.itemRef) {
|
|
169
|
+
if (resolve(loop.item, keys) === undefined)
|
|
170
|
+
reads.push({ field, expression, path: text });
|
|
171
|
+
}
|
|
172
|
+
else if (hiddenLoopRef !== undefined && root === hiddenLoopRef) {
|
|
173
|
+
reads.push({ field, expression, path: text });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return reads;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The templates an expression calls with `mapTemplate`. Literals are numbered first, so a call
|
|
180
|
+
* written inside a string (`{{"mapTemplate('card')"}}`, which renders as text) is not one.
|
|
181
|
+
*/
|
|
182
|
+
function templateCalls(expression) {
|
|
183
|
+
const literals = [];
|
|
184
|
+
const code = expression.replace(STRING_LITERAL, (literal) => `#${literals.push(unquote(literal)) - 1}`);
|
|
185
|
+
return [...code.matchAll(TEMPLATE_CALL)].map(([, at]) => literals[Number(at)]);
|
|
186
|
+
}
|
|
187
|
+
/** The named templates an expression maps, and the ones they map in turn. */
|
|
188
|
+
function referencedTemplates(expressions, templates) {
|
|
189
|
+
const seen = new Set();
|
|
190
|
+
const queue = expressions.flatMap(templateCalls);
|
|
191
|
+
while (queue.length > 0) {
|
|
192
|
+
const name = queue.shift();
|
|
193
|
+
if (seen.has(name) || !Object.hasOwn(templates, name))
|
|
194
|
+
continue;
|
|
195
|
+
seen.add(name);
|
|
196
|
+
queue.push(...templateExpressions(templates[name]).flatMap(templateCalls));
|
|
197
|
+
}
|
|
198
|
+
return [...seen];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Reads that found nothing in the data the render saw. The renderer prints `undefined` when such a
|
|
202
|
+
* read is output, which `unresolvedPaths` catches, but a read used as a test steers the branch
|
|
203
|
+
* silently: `{{queries.j1.data[0].mfa ? 'MFA on' : 'MFA off'}}` rendered "MFA off" for someone
|
|
204
|
+
* absent from j1 in a field test (2026-10-30). The paths are resolved here against the exact
|
|
205
|
+
* query data sent to the renderer. Inside a named template only `queries` reads are resolved:
|
|
206
|
+
* `mapTemplate` binds its own `item`, which shadows a loop's default `item`, and the template's
|
|
207
|
+
* view of the loop variable is not the action's.
|
|
208
|
+
*/
|
|
209
|
+
function undefinedReads(action, context) {
|
|
210
|
+
const fields = stringFields(action);
|
|
211
|
+
const expressions = fields.flatMap(([, text]) => templateExpressions(text));
|
|
212
|
+
const templateScope = context.loopRef !== undefined && !TEMPLATE_SCOPE.has(context.loopRef)
|
|
213
|
+
? { hiddenLoopRef: context.loopRef }
|
|
214
|
+
: {};
|
|
215
|
+
const sources = [
|
|
216
|
+
...fields.map(([field, text]) => [
|
|
217
|
+
field,
|
|
218
|
+
text,
|
|
219
|
+
{ loop: context.loop },
|
|
220
|
+
]),
|
|
221
|
+
...referencedTemplates(expressions, context.templates).map((name) => [
|
|
222
|
+
`templates.${name}`,
|
|
223
|
+
context.templates[name],
|
|
224
|
+
templateScope,
|
|
225
|
+
]),
|
|
226
|
+
];
|
|
227
|
+
const seen = new Set();
|
|
228
|
+
const reads = [];
|
|
229
|
+
for (const [field, text, scope] of sources) {
|
|
230
|
+
for (const expression of templateExpressions(text)) {
|
|
231
|
+
for (const read of readsIn(expression, field, context, scope)) {
|
|
232
|
+
const key = `${read.field}\u0000${read.path}`;
|
|
233
|
+
if (seen.has(key))
|
|
234
|
+
continue;
|
|
235
|
+
seen.add(key);
|
|
236
|
+
reads.push(read);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return reads.slice(0, MAX_UNDEFINED_READS);
|
|
241
|
+
}
|
|
242
|
+
function slackBodyWarnings(action, rendered) {
|
|
243
|
+
const warnings = [];
|
|
244
|
+
if (typeof action.body === 'string' && action.body.length > exports.SLACK_BODY_MAX) {
|
|
245
|
+
warnings.push({
|
|
246
|
+
code: 'slack-body-over-limit',
|
|
247
|
+
field: 'body',
|
|
248
|
+
message: `The body template is ${action.body.length} characters; Slack bodies are capped at ` +
|
|
249
|
+
`${exports.SLACK_BODY_MAX}, so saving the rule will fail. Move repeated markup into a named ` +
|
|
250
|
+
'template and call it with mapTemplate.',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (typeof rendered.body === 'string' && rendered.body.length > exports.SLACK_BODY_MAX) {
|
|
254
|
+
warnings.push({
|
|
255
|
+
code: 'slack-body-truncated',
|
|
256
|
+
field: 'body',
|
|
257
|
+
message: `The rendered body is ${rendered.body.length} characters; Slack posts the first ` +
|
|
258
|
+
`${exports.SLACK_BODY_MAX - CONTINUATION.length} and "${CONTINUATION}". A live run renders every ` +
|
|
259
|
+
'row, not the sample, so it may run longer still.',
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
return warnings;
|
|
263
|
+
}
|
|
264
|
+
const ADDRESS = /^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;
|
|
265
|
+
function recipientWarnings(rendered) {
|
|
266
|
+
const recipients = rendered.recipients;
|
|
267
|
+
const list = Array.isArray(recipients) ? recipients : [recipients];
|
|
268
|
+
const malformed = list.filter((r) => typeof r !== 'string' || !ADDRESS.test(r.trim()));
|
|
269
|
+
if (malformed.length === 0)
|
|
270
|
+
return [];
|
|
271
|
+
return [
|
|
272
|
+
{
|
|
273
|
+
code: 'recipient-malformed',
|
|
274
|
+
field: 'recipients',
|
|
275
|
+
message: `${malformed.length} recipient(s) are not email addresses as rendered: ` +
|
|
276
|
+
`${malformed.map((r) => JSON.stringify(r)).join(', ')}.`,
|
|
277
|
+
},
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
const UNKNOWN_TRANSFORM = /Transform (\w+) is not defined/;
|
|
281
|
+
function transformWarnings(messages) {
|
|
282
|
+
return messages.flatMap((message) => {
|
|
283
|
+
const name = UNKNOWN_TRANSFORM.exec(message)?.[1];
|
|
284
|
+
if (!name)
|
|
285
|
+
return [];
|
|
286
|
+
return [
|
|
287
|
+
{
|
|
288
|
+
code: 'unknown-transform',
|
|
289
|
+
message: `\`${name}\` is not a template transform. The transforms are ` +
|
|
290
|
+
`${exports.RULE_TRANSFORMS.join(', ')}; get-reference topic rule-templates has their ` +
|
|
291
|
+
'arguments.',
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/** `MMMM D YYYY, h:mm:ss a` in UTC: rule-service `friendlyDate` on the evaluation start. */
|
|
297
|
+
function friendlyDate(at) {
|
|
298
|
+
const month = at.toLocaleString('en-US', { month: 'long', timeZone: 'UTC' });
|
|
299
|
+
const hours = at.getUTCHours();
|
|
300
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
301
|
+
return (`${month} ${at.getUTCDate()} ${at.getUTCFullYear()}, ${hours % 12 || 12}:` +
|
|
302
|
+
`${pad(at.getUTCMinutes())}:${pad(at.getUTCSeconds())} ${hours < 12 ? 'am' : 'pm'}`);
|
|
303
|
+
}
|
|
304
|
+
function truncateBody(body) {
|
|
305
|
+
return body.length <= exports.SLACK_BODY_MAX
|
|
306
|
+
? body
|
|
307
|
+
: body.slice(0, exports.SLACK_BODY_MAX - CONTINUATION.length) + CONTINUATION;
|
|
308
|
+
}
|
|
309
|
+
/** The Severity block's level: the action's own `severity`, else the alert the run raises. */
|
|
310
|
+
function slackSeverity(rendered, rule) {
|
|
311
|
+
if (typeof rendered.severity === 'string')
|
|
312
|
+
return rendered.severity;
|
|
313
|
+
if (!rule.raisesAlert)
|
|
314
|
+
return null;
|
|
315
|
+
return rule.alertLevel ?? '<alert level>';
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* The Slack post around the body, as rule-service `sendSlackMessageAction` builds it: `text`
|
|
319
|
+
* names the rule, and one attachment holds the rule name (linked to the alert when the run raises
|
|
320
|
+
* one), the description, the severity when there is one, the evaluation time and the body.
|
|
321
|
+
* Angle-bracketed values are ones only a live run knows.
|
|
322
|
+
*/
|
|
323
|
+
function slackEnvelope(rendered, rule) {
|
|
324
|
+
const name = rule.name ?? '<rule name>';
|
|
325
|
+
const description = rule.description === undefined ? '<description>' : String(rule.description);
|
|
326
|
+
const severity = slackSeverity(rendered, rule);
|
|
327
|
+
const blocks = [
|
|
328
|
+
rule.raisesAlert ? `<alert link|*${name}*>` : `*${name}*`,
|
|
329
|
+
`*Description*: ${description}`,
|
|
330
|
+
...(severity ? [`*Severity*: ${severity}`] : []),
|
|
331
|
+
`*Timestamp*: ${friendlyDate(new Date())}`,
|
|
332
|
+
...(typeof rendered.body === 'string' && rendered.body ? [truncateBody(rendered.body)] : []),
|
|
333
|
+
];
|
|
334
|
+
const warnings = [];
|
|
335
|
+
if (rule.description === null || rule.description?.trim() === '') {
|
|
336
|
+
warnings.push({
|
|
337
|
+
code: 'description-missing',
|
|
338
|
+
message: `The rule has no description, so every post reads "*Description*: ${description}". ` +
|
|
339
|
+
"Set the rule's description.",
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
envelope: {
|
|
344
|
+
text: `*JupiterOne Alert - ${name}*`,
|
|
345
|
+
color: (severity && SLACK_LEVEL_COLORS[severity]) || SLACK_DEFAULT_COLOR,
|
|
346
|
+
blocks,
|
|
347
|
+
},
|
|
348
|
+
warnings,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* A warning for an action inside a loop that maps a named template. When the rule runs the
|
|
353
|
+
* template sees only its own `item`, `itemIndex` and `itemCount`; the preview renderer instead
|
|
354
|
+
* lays the loop's row over them, so with the default `itemRef` the mapped rows show the loop's
|
|
355
|
+
* row (rule-service render puts query data after the template's own variables).
|
|
356
|
+
*/
|
|
357
|
+
function loopTemplateWarning(action, itemRef) {
|
|
358
|
+
const calls = stringFields(action).flatMap(([, text]) => templateExpressions(text).flatMap(templateCalls));
|
|
359
|
+
if (calls.length === 0)
|
|
360
|
+
return null;
|
|
361
|
+
const clobbered = itemRef === 'item'
|
|
362
|
+
? " Here the loop row replaces the template's `item`, so the mapped rows may show the " +
|
|
363
|
+
"loop's row; preview the same body outside the loop to see the template's own rows."
|
|
364
|
+
: '';
|
|
365
|
+
return {
|
|
366
|
+
code: 'loop-template-preview',
|
|
367
|
+
message: `This action is inside a loop and maps ${calls.map((n) => `\`${n}\``).join(', ')}. ` +
|
|
368
|
+
`When the rule runs a named template sees only its own \`item\`, \`itemIndex\` and ` +
|
|
369
|
+
`\`itemCount\`, not the loop's \`${itemRef}\`.${clobbered}`,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
/** The checks on one rendered action that need no further API call. */
|
|
373
|
+
function renderedActionWarnings(action, rendered, messages) {
|
|
374
|
+
return [
|
|
375
|
+
...(action.type === 'SEND_SLACK_MESSAGE' ? slackBodyWarnings(action, rendered) : []),
|
|
376
|
+
...(action.type === 'SEND_EMAIL' ? recipientWarnings(rendered) : []),
|
|
377
|
+
...transformWarnings(messages),
|
|
378
|
+
];
|
|
379
|
+
}
|
|
380
|
+
//# sourceMappingURL=rule-preview-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-preview-checks.js","sourceRoot":"","sources":["../../../src/server/tools/rule-preview-checks.ts"],"names":[],"mappings":";;;AA6GA,kDAsBC;AA4ID,wCAkCC;AA6FD,sCA+BC;AAQD,kDAiBC;AAGD,wDAUC;AAjdD;;;;;GAKG;AACU,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC7B,aAAa;IACb,MAAM;IACN,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,aAAa;IACb,OAAO;IACP,sBAAsB;IACtB,qBAAqB;CACb,CAAC;AAEX,wFAAwF;AACxF,MAAM,kBAAkB,GAA2B;IACjD,QAAQ,EAAE,SAAS;IACnB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;CAChB,CAAC;AACF,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAEtC,oGAAoG;AACpG,MAAM,mBAAmB,GAAG,EAAE,CAAC;AA+C/B,kGAAkG;AAClG,MAAM,cAAc,GAAG,IAAI,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C,MAAM,SAAS,GACb,OAAO,KAAK,MAAM;QAChB,CAAC,CAAC,qFAAqF;YACrF,oFAAoF;QACtF,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EACL,yCAAyC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACpF,oFAAoF;YACpF,mCAAmC,OAAO,MAAM,SAAS,EAAE;KAC9D,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,SAAgB,sBAAsB,CACpC,MAAc,EACd,QAAgB,EAChB,QAAkB;IAElB,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpF,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,GAAG,iBAAiB,CAAC,QAAQ,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { JupiterOneClient } from '../../client/jupiterone-client.js';
|
|
2
|
+
import type { Action, RuleActionQueryData } from '../../types/jupiterone.js';
|
|
3
|
+
import { type PreviewWarning, type SlackEnvelope, type UndefinedRead } from './rule-preview-checks.js';
|
|
4
|
+
import type { ToolResult } from './types.js';
|
|
5
|
+
/** Rows kept per query: the rules editor's sample size (web-app `MAX_SAMPLE_RESULTS`). */
|
|
6
|
+
export declare const PREVIEW_SAMPLE_ROWS = 10;
|
|
7
|
+
/**
|
|
8
|
+
* How long the rule's queries may run, measured from request start. The remote aborts at 55 s; a
|
|
9
|
+
* render took under half a second on j1dev (2026-10-30), so the renders get what is left. The poll
|
|
10
|
+
* count alone does not bound the wait (each poll's fetch adds to its 1 s sleep), so the sample is
|
|
11
|
+
* also raced against this deadline.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PREVIEW_SAMPLE_BUDGET_MS = 35000;
|
|
14
|
+
/** How long reading a saved rule may take, from request start, before nothing is previewed. */
|
|
15
|
+
export declare const PREVIEW_LOOKUP_BUDGET_MS = 20000;
|
|
16
|
+
/**
|
|
17
|
+
* When the renders must be done, from request start: before the remote's 55 s abort, which would
|
|
18
|
+
* discard every action that did render. A render still running then is reported as failed.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PREVIEW_RENDER_BUDGET_MS = 50000;
|
|
21
|
+
/**
|
|
22
|
+
* The action types rule-service defines (`ActionType`, src/services/actions/types.ts). Telemetry
|
|
23
|
+
* counts a draft's other `type` strings as `other`: a draft may carry any text there.
|
|
24
|
+
*/
|
|
25
|
+
export declare const KNOWN_ACTION_TYPES: ReadonlySet<string>;
|
|
26
|
+
/** A rule query. rule-service does not require a name, and reads a nameless one back as null. */
|
|
27
|
+
export interface PreviewQuery {
|
|
28
|
+
name: string | null;
|
|
29
|
+
query: string;
|
|
30
|
+
includeDeleted?: boolean | null;
|
|
31
|
+
}
|
|
32
|
+
export interface PreviewRule {
|
|
33
|
+
ruleId?: string;
|
|
34
|
+
/** For the Slack envelope; undefined when a draft does not give it. */
|
|
35
|
+
name?: string;
|
|
36
|
+
description?: string | null;
|
|
37
|
+
queries: PreviewQuery[];
|
|
38
|
+
operations: {
|
|
39
|
+
actions?: Action[] | null;
|
|
40
|
+
}[];
|
|
41
|
+
templates: Record<string, string>;
|
|
42
|
+
/** Rows to render against in place of a query's results, by query name; the query is not run. */
|
|
43
|
+
fixtures?: Record<string, unknown[]>;
|
|
44
|
+
/** How many sampled rows each FOR_EACH_ITEM's nested actions render for. */
|
|
45
|
+
loopRows?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface QuerySample {
|
|
48
|
+
name: string | null;
|
|
49
|
+
status: 'ok' | 'empty' | 'failed' | 'timed_out';
|
|
50
|
+
total: number | null;
|
|
51
|
+
sampledRows: number;
|
|
52
|
+
/** `total` is the query engine's estimate: 30000 for `FIND User`'s 42110 rows on j1dev. */
|
|
53
|
+
estimate?: boolean;
|
|
54
|
+
/** The rows came from the caller's `fixtures`, not the query. */
|
|
55
|
+
fixture?: boolean;
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ActionPreview {
|
|
59
|
+
path: string;
|
|
60
|
+
type: string | null;
|
|
61
|
+
status: 'rendered' | 'render_failed' | 'loop' | 'not_run' | 'skipped' | 'not_previewable';
|
|
62
|
+
rendered?: Action;
|
|
63
|
+
messages?: string[];
|
|
64
|
+
unresolvedPaths?: string[];
|
|
65
|
+
undefinedReads?: UndefinedRead[];
|
|
66
|
+
warnings?: PreviewWarning[];
|
|
67
|
+
envelope?: SlackEnvelope;
|
|
68
|
+
error?: string;
|
|
69
|
+
iterations?: number | null;
|
|
70
|
+
estimate?: boolean;
|
|
71
|
+
itemRef?: string;
|
|
72
|
+
itemBound?: boolean;
|
|
73
|
+
/** Which sampled row a nested loop action rendered for. */
|
|
74
|
+
row?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Sample every query in parallel and build the `queries` render context from the results. A query
|
|
78
|
+
* with fixture rows is not run: a field test pulled other employees' records into the transcript
|
|
79
|
+
* to reach a branch, and an account where no entity reaches one cannot test it at all.
|
|
80
|
+
*/
|
|
81
|
+
export declare function sampleRuleQueries(client: JupiterOneClient, queries: PreviewQuery[], deadlineAt: number, fixtures?: Record<string, unknown[]>): Promise<{
|
|
82
|
+
samples: QuerySample[];
|
|
83
|
+
queryData: RuleActionQueryData;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* The fields of `source` whose template rendered to nothing. rule-service reports expression
|
|
87
|
+
* errors in `messages`, but a reference to a missing path renders the text `undefined` (or drops
|
|
88
|
+
* a whole-field value) and says nothing (j1dev, 2026-10-30).
|
|
89
|
+
*/
|
|
90
|
+
export declare function unresolvedPaths(source: unknown, rendered: unknown, path?: string, skip?: (template: string) => boolean): string[];
|
|
91
|
+
/** Render every action of every operation, in rule order. */
|
|
92
|
+
export declare function renderRuleActions(client: JupiterOneClient, rule: PreviewRule, queryData: RuleActionQueryData, samples: QuerySample[], renderDeadlineAt: number): Promise<ActionPreview[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Preview a rule's actions: sample its queries, then render each action against the sample.
|
|
95
|
+
* Both steps are bounded from `startedAt`, the request's start.
|
|
96
|
+
*/
|
|
97
|
+
export declare function previewRule(client: JupiterOneClient, rule: PreviewRule, startedAt: number): Promise<ToolResult>;
|
|
98
|
+
//# sourceMappingURL=rule-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-preview.d.ts","sourceRoot":"","sources":["../../../src/server/tools/rule-preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAG7E,OAAO,EAKL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAwB/C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAqBjD,CAAC;AAEH,iGAAiG;AACjG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB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