@jupiterone/jupiterone-mcp 0.0.4 → 0.0.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 +2 -2
- package/dist/client/graphql/mutations.js +13 -10
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.js +17 -14
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +6 -3
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +35 -20
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/account-service.d.ts +1 -0
- package/dist/client/services/account-service.d.ts.map +1 -1
- package/dist/client/services/account-service.js +9 -4
- package/dist/client/services/account-service.js.map +1 -1
- package/dist/client/services/alert-service.js +7 -3
- package/dist/client/services/alert-service.js.map +1 -1
- package/dist/client/services/dashboard-service.d.ts +4 -0
- package/dist/client/services/dashboard-service.d.ts.map +1 -1
- package/dist/client/services/dashboard-service.js +21 -8
- package/dist/client/services/dashboard-service.js.map +1 -1
- package/dist/client/services/integration-service.js +11 -7
- package/dist/client/services/integration-service.js.map +1 -1
- package/dist/client/services/j1ql-service.js +9 -5
- package/dist/client/services/j1ql-service.js.map +1 -1
- package/dist/client/services/rule-service.d.ts +4 -0
- package/dist/client/services/rule-service.d.ts.map +1 -1
- package/dist/client/services/rule-service.js +26 -13
- package/dist/client/services/rule-service.js.map +1 -1
- package/dist/generated/description-map.d.ts +2 -0
- package/dist/generated/description-map.d.ts.map +1 -0
- package/dist/generated/description-map.js +2300 -0
- package/dist/generated/description-map.js.map +1 -0
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/server/mcp-server.d.ts +4 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +1535 -1366
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/types/jupiterone.d.ts +3 -2
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/dist/types/jupiterone.js +2 -1
- package/dist/utils/description-loader.js +8 -5
- package/dist/utils/description-loader.js.map +1 -1
- package/dist/utils/getEnv.d.ts +2 -0
- package/dist/utils/getEnv.d.ts.map +1 -0
- package/dist/utils/getEnv.js +16 -0
- package/dist/utils/getEnv.js.map +1 -0
- package/dist/utils/j1ql-validator.js +5 -1
- package/dist/utils/j1ql-validator.js.map +1 -1
- package/dist/utils/load-description.d.ts.map +1 -1
- package/dist/utils/load-description.js +7 -7
- package/dist/utils/load-description.js.map +1 -1
- package/package.json +5 -5
- package/dist/descriptions/create-dashboard-widget.md +0 -325
- package/dist/descriptions/create-dashboard.md +0 -12
- package/dist/descriptions/create-inline-question-rule.md +0 -374
- package/dist/descriptions/create-j1ql-from-natural-language.md +0 -7
- package/dist/descriptions/execute-j1ql-query.md +0 -379
- package/dist/descriptions/get-integration-definitions.md +0 -27
- package/dist/descriptions/get-integration-instances.md +0 -35
- package/dist/descriptions/list-alerts.md +0 -14
- package/dist/descriptions/list-rules.md +0 -53
- package/dist/descriptions/update-dashboard.md +0 -467
- package/dist/descriptions/update-inline-question-rule.md +0 -363
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
# JupiterOne Rule Update Tool - Complete Guide
|
|
2
|
-
|
|
3
|
-
**Purpose**: Updates existing inline question-based alert rules in JupiterOne. This tool modifies the configuration of an existing rule while preserving its identity and version history.
|
|
4
|
-
|
|
5
|
-
**Important**: Before updating a rule, use the `get-rule-details` tool to retrieve the current configuration. This ensures you have all required fields and can see what needs to be changed.
|
|
6
|
-
|
|
7
|
-
## Key Requirements for Updates
|
|
8
|
-
|
|
9
|
-
### 1. Required Fields for Updates
|
|
10
|
-
When updating a rule, you must provide **ALL** fields, not just the ones you want to change. The update operation replaces the entire rule configuration, so missing fields will result in errors.
|
|
11
|
-
|
|
12
|
-
**Critical Required Fields**:
|
|
13
|
-
- `id`: The existing rule ID (from `get-rule-details`)
|
|
14
|
-
- `version`: The current version number (from `get-rule-details`)
|
|
15
|
-
- `specVersion`: Usually 1
|
|
16
|
-
- `ignorePreviousResults`: Must be included
|
|
17
|
-
- `templates`: Must be included (use `{}` if empty)
|
|
18
|
-
- `tags`: Must be included but should always be empty `[]` (deprecated)
|
|
19
|
-
- `labels`: Use this for actual tagging functionality
|
|
20
|
-
- `resourceGroupId`: Must be included (can be null)
|
|
21
|
-
- `remediationSteps`: Must be included (can be null)
|
|
22
|
-
|
|
23
|
-
### 2. Condition Format (Critical)
|
|
24
|
-
The `condition` parameter must use JupiterOne's specific array format:
|
|
25
|
-
- **Structure**: `["LOGICAL_OPERATOR", [left_value, operator, right_value]]`
|
|
26
|
-
- **Example**: `["AND", ["queries.queryName.total", ">", 0]]`
|
|
27
|
-
- **Supported operators**: `>`, `<`, `>=`, `<=`, `=`, `!=`
|
|
28
|
-
- **Logical operators**: `"AND"`, `"OR"`
|
|
29
|
-
|
|
30
|
-
### 3. Operations Structure
|
|
31
|
-
The `when` clause should only contain:
|
|
32
|
-
- `type`: Always `"FILTER"`
|
|
33
|
-
- `condition`: The array format described above
|
|
34
|
-
- **Do NOT include**: `version`, `specVersion` (these belong at the rule level, not in the when clause)
|
|
35
|
-
|
|
36
|
-
### 4. Query Naming Convention
|
|
37
|
-
- Query names in the `queries` array must match the references in conditions
|
|
38
|
-
- Example: If query name is `"users"`, reference it as `"queries.users.total"`
|
|
39
|
-
- **IMPORTANT**: Use `"query0"` as the standard query name for compatibility with existing patterns
|
|
40
|
-
|
|
41
|
-
### 5. Version Management
|
|
42
|
-
- The `version` field will be automatically incremented by JupiterOne
|
|
43
|
-
- You must provide the current version number in your update request
|
|
44
|
-
- Get the current version using `get-rule-details` before updating
|
|
45
|
-
|
|
46
|
-
### 6. Tags vs Labels (Important)
|
|
47
|
-
- **DEPRECATED**: The `tags` array field is deprecated and should always be set to an empty array `[]`
|
|
48
|
-
- **USE INSTEAD**: For tagging functionality, use the `labels` field with key-value pairs
|
|
49
|
-
- **Format**: `labels: [{"labelName": "key", "labelValue": "value"}]`
|
|
50
|
-
- **When users ask for tagging**: Always use the `labels` field to meet their needs
|
|
51
|
-
- **Note**: The `tags` field is still required in the schema for compatibility but should remain empty
|
|
52
|
-
|
|
53
|
-
## Update Workflow
|
|
54
|
-
|
|
55
|
-
### Step 1: Get Current Rule Configuration
|
|
56
|
-
```
|
|
57
|
-
Use get-rule-details with the rule ID to get the current configuration
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Step 2: Modify Required Fields
|
|
61
|
-
Update only the fields you need to change while preserving all other required fields.
|
|
62
|
-
|
|
63
|
-
### Step 3: Submit Update
|
|
64
|
-
Use this tool with the complete configuration including your changes.
|
|
65
|
-
|
|
66
|
-
## Required Schema Fields for Updates
|
|
67
|
-
|
|
68
|
-
### Complete Required Parameters for update-inline-question-rule
|
|
69
|
-
**CRITICAL**: All of these fields must be included for successful rule updates:
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"id": "existing-rule-id",
|
|
74
|
-
"name": "Updated Rule Name",
|
|
75
|
-
"description": "Updated rule description",
|
|
76
|
-
"notifyOnFailure": true,
|
|
77
|
-
"triggerActionsOnNewEntitiesOnly": true,
|
|
78
|
-
"ignorePreviousResults": false,
|
|
79
|
-
"pollingInterval": "ONE_DAY",
|
|
80
|
-
"specVersion": 1,
|
|
81
|
-
"version": 2,
|
|
82
|
-
"templates": {},
|
|
83
|
-
"outputs": ["alertLevel"],
|
|
84
|
-
"tags": [],
|
|
85
|
-
"labels": [
|
|
86
|
-
{"labelName": "environment", "labelValue": "production"},
|
|
87
|
-
{"labelName": "team", "labelValue": "security"}
|
|
88
|
-
],
|
|
89
|
-
"resourceGroupId": null,
|
|
90
|
-
"remediationSteps": null,
|
|
91
|
-
"question": {
|
|
92
|
-
"queries": [
|
|
93
|
-
{
|
|
94
|
-
"query": "FIND Entity...",
|
|
95
|
-
"name": "query0",
|
|
96
|
-
"version": "v1",
|
|
97
|
-
"includeDeleted": false
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
"operations": [
|
|
102
|
-
{
|
|
103
|
-
"when": {
|
|
104
|
-
"type": "FILTER",
|
|
105
|
-
"condition": ["AND", ["queries.query0.total", ">", 0]]
|
|
106
|
-
},
|
|
107
|
-
"actions": [...]
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**Key Update Requirements**:
|
|
114
|
-
- `id`: Must match the existing rule ID
|
|
115
|
-
- `version`: Must be the current version number from the existing rule
|
|
116
|
-
- `ignorePreviousResults`: Must be included (typically `false`)
|
|
117
|
-
- `templates`: Must be included (use `{}` if empty)
|
|
118
|
-
- `tags`: Must be included but should always be empty `[]` (deprecated field)
|
|
119
|
-
- `labels`: Use this for actual tagging functionality with key-value pairs
|
|
120
|
-
- `resourceGroupId`: Must be included (can be null)
|
|
121
|
-
- `remediationSteps`: Must be included (can be null)
|
|
122
|
-
- Query `name`: Use `"query0"` for primary query
|
|
123
|
-
- Query `version`: Include `"v1"` for compatibility
|
|
124
|
-
- Query `includeDeleted`: Must be explicitly set to `false`
|
|
125
|
-
|
|
126
|
-
## Available Action Types
|
|
127
|
-
|
|
128
|
-
### 1. SET_PROPERTY
|
|
129
|
-
Sets a property value on the alert (commonly used for alert severity levels).
|
|
130
|
-
|
|
131
|
-
**Configuration**:
|
|
132
|
-
```json
|
|
133
|
-
{
|
|
134
|
-
"type": "SET_PROPERTY",
|
|
135
|
-
"targetProperty": "alertLevel",
|
|
136
|
-
"targetValue": "CRITICAL"
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
**Common Values for alertLevel**: `"LOW"`, `"MEDIUM"`, `"HIGH"`, `"CRITICAL"`, `"INFO"`
|
|
141
|
-
|
|
142
|
-
### 2. CREATE_ALERT
|
|
143
|
-
Creates a basic alert in JupiterOne.
|
|
144
|
-
|
|
145
|
-
**Configuration**:
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"type": "CREATE_ALERT"
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Note**: This is the most basic action and should almost always be included.
|
|
153
|
-
|
|
154
|
-
### 3. SEND_EMAIL
|
|
155
|
-
Sends email notifications to specified recipients.
|
|
156
|
-
|
|
157
|
-
**Configuration**:
|
|
158
|
-
```json
|
|
159
|
-
{
|
|
160
|
-
"type": "SEND_EMAIL",
|
|
161
|
-
"recipients": ["user1@company.com", "user2@company.com"],
|
|
162
|
-
"body": "Affected Items: <br><br>* {{queries.query0.data|mapProperty('displayName')|join('<br>* ')}}"
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### 4. TAG_ENTITIES
|
|
167
|
-
Adds or removes tags from entities that triggered the rule.
|
|
168
|
-
|
|
169
|
-
**Configuration**:
|
|
170
|
-
```json
|
|
171
|
-
{
|
|
172
|
-
"type": "TAG_ENTITIES",
|
|
173
|
-
"entities": "{{queries.query0.data}}",
|
|
174
|
-
"tags": [
|
|
175
|
-
{"name": "existing tag to remove", "value": null},
|
|
176
|
-
{"name": "new tag", "value": "tag value"}
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### 5. SEND_SLACK_MESSAGE
|
|
182
|
-
Sends messages to Slack channels (requires Slack integration).
|
|
183
|
-
|
|
184
|
-
**Configuration**:
|
|
185
|
-
```json
|
|
186
|
-
{
|
|
187
|
-
"integrationInstanceId": "d97d9127-c532-410a-bf0a-9ea93f66c3d2",
|
|
188
|
-
"type": "SEND_SLACK_MESSAGE",
|
|
189
|
-
"channels": ["#security-alerts", "#general"],
|
|
190
|
-
"body": "*Affected Items:* \n\n- {{queries.query0.data|mapProperty('displayName')|join('\n- ')}}"
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### 6. SEND_TO_S3
|
|
195
|
-
Sends alert data to an S3 bucket (requires AWS S3 integration).
|
|
196
|
-
|
|
197
|
-
**Configuration**:
|
|
198
|
-
```json
|
|
199
|
-
{
|
|
200
|
-
"integrationInstanceId": "f89568b4-2a1b-4bd8-8abd-aee21270df75",
|
|
201
|
-
"type": "SEND_TO_S3",
|
|
202
|
-
"bucket": "security-alerts-bucket",
|
|
203
|
-
"region": "us-east-1",
|
|
204
|
-
"data": {
|
|
205
|
-
"description": "{{alertWebLink}}\n\n**Affected Items:**\n\n* {{queries.query0.data|mapProperty('displayName')|join('\n* ')}}"
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 7. CREATE_JIRA_TICKET
|
|
211
|
-
Creates a Jira ticket for the alert (requires Jira integration).
|
|
212
|
-
|
|
213
|
-
**Configuration**:
|
|
214
|
-
```json
|
|
215
|
-
{
|
|
216
|
-
"integrationInstanceId": "53a99eaa-18a5-45ef-b748-2de39d642a91",
|
|
217
|
-
"type": "CREATE_JIRA_TICKET",
|
|
218
|
-
"entityClass": "Finding",
|
|
219
|
-
"summary": "Security Alert: Critical Unencrypted Data Found",
|
|
220
|
-
"issueType": "Bug",
|
|
221
|
-
"project": "SEC",
|
|
222
|
-
"updateContentOnChanges": false,
|
|
223
|
-
"additionalFields": {
|
|
224
|
-
"description": {
|
|
225
|
-
"type": "doc",
|
|
226
|
-
"version": 1,
|
|
227
|
-
"content": [
|
|
228
|
-
{
|
|
229
|
-
"type": "paragraph",
|
|
230
|
-
"content": [
|
|
231
|
-
{
|
|
232
|
-
"type": "text",
|
|
233
|
-
"text": "{{alertWebLink}}\n\n**Affected Items:**\n\n* {{queries.query0.data|mapProperty('displayName')|join('\n* ')}}"
|
|
234
|
-
}
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## Template Variables and Formatting
|
|
244
|
-
|
|
245
|
-
### Available Variables
|
|
246
|
-
- `{{alertWebLink}}` - Direct link to the alert in JupiterOne
|
|
247
|
-
- `{{queries.queryName.data}}` - Array of entities from the specified query
|
|
248
|
-
- `{{queries.queryName.total}}` - Count of entities from the query
|
|
249
|
-
|
|
250
|
-
### Data Formatting
|
|
251
|
-
- `|mapProperty('fieldName')` - Extract specific field from each entity
|
|
252
|
-
- `|join('separator')` - Join array elements with specified separator
|
|
253
|
-
- Example: `{{queries.users.data|mapProperty('displayName')|join(', ')}}` - Creates comma-separated list of user names
|
|
254
|
-
|
|
255
|
-
## Integration Dependencies
|
|
256
|
-
|
|
257
|
-
For actions requiring integrations, you may need to:
|
|
258
|
-
1. Query available integration instances using `get-integration-instances`
|
|
259
|
-
2. Ask the user which integration to use
|
|
260
|
-
3. Use the integration's `id` as the `integrationInstanceId`
|
|
261
|
-
|
|
262
|
-
**Actions requiring integrations**:
|
|
263
|
-
- `SEND_SLACK_MESSAGE` (Slack integration)
|
|
264
|
-
- `SEND_TO_S3` (AWS S3 integration)
|
|
265
|
-
- `CREATE_JIRA_TICKET` (Jira integration)
|
|
266
|
-
|
|
267
|
-
## Working Example Update
|
|
268
|
-
|
|
269
|
-
### Complete Working Rule Update Structure
|
|
270
|
-
```json
|
|
271
|
-
{
|
|
272
|
-
"id": "12345678-1234-1234-1234-123456789abc",
|
|
273
|
-
"name": "Updated Rule Name",
|
|
274
|
-
"description": "Updated rule description",
|
|
275
|
-
"notifyOnFailure": true,
|
|
276
|
-
"triggerActionsOnNewEntitiesOnly": true,
|
|
277
|
-
"ignorePreviousResults": false,
|
|
278
|
-
"pollingInterval": "ONE_DAY",
|
|
279
|
-
"specVersion": 1,
|
|
280
|
-
"version": 3,
|
|
281
|
-
"templates": {},
|
|
282
|
-
"outputs": ["alertLevel"],
|
|
283
|
-
"tags": [],
|
|
284
|
-
"labels": [
|
|
285
|
-
{"labelName": "severity", "labelValue": "high"},
|
|
286
|
-
{"labelName": "category", "labelValue": "security"}
|
|
287
|
-
],
|
|
288
|
-
"resourceGroupId": null,
|
|
289
|
-
"remediationSteps": "1. Review the affected entities\n2. Apply security patches\n3. Update configurations",
|
|
290
|
-
"question": {
|
|
291
|
-
"queries": [
|
|
292
|
-
{
|
|
293
|
-
"query": "FIND Entity WITH condition",
|
|
294
|
-
"name": "query0",
|
|
295
|
-
"version": "v1",
|
|
296
|
-
"includeDeleted": false
|
|
297
|
-
}
|
|
298
|
-
]
|
|
299
|
-
},
|
|
300
|
-
"operations": [
|
|
301
|
-
{
|
|
302
|
-
"when": {
|
|
303
|
-
"type": "FILTER",
|
|
304
|
-
"condition": ["AND", ["queries.query0.total", ">", 0]]
|
|
305
|
-
},
|
|
306
|
-
"actions": [
|
|
307
|
-
{
|
|
308
|
-
"type": "SET_PROPERTY",
|
|
309
|
-
"targetProperty": "alertLevel",
|
|
310
|
-
"targetValue": "CRITICAL"
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"type": "CREATE_ALERT"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"type": "SEND_EMAIL",
|
|
317
|
-
"recipients": ["updated-user@company.com"],
|
|
318
|
-
"body": "Updated notification: {{alertWebLink}}"
|
|
319
|
-
}
|
|
320
|
-
]
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
## Common Update Scenarios
|
|
327
|
-
|
|
328
|
-
### 1. Changing Notification Recipients
|
|
329
|
-
Update only the `recipients` array in the `SEND_EMAIL` action while preserving all other fields.
|
|
330
|
-
|
|
331
|
-
### 2. Modifying Polling Interval
|
|
332
|
-
Update the `pollingInterval` field while keeping all other configuration the same.
|
|
333
|
-
|
|
334
|
-
### 3. Adding New Actions
|
|
335
|
-
Add new actions to the `actions` array in the operations.
|
|
336
|
-
|
|
337
|
-
### 4. Updating Query Logic
|
|
338
|
-
Modify the `query` string in the queries array or adjust the `condition` in operations.
|
|
339
|
-
|
|
340
|
-
### 5. Changing Labels
|
|
341
|
-
Update the `labels` array to add, remove, or modify rule labels.
|
|
342
|
-
|
|
343
|
-
## Debugging Tips
|
|
344
|
-
- Always start by getting the current rule configuration with `get-rule-details`
|
|
345
|
-
- Ensure the `version` number matches the current rule version
|
|
346
|
-
- Include ALL required fields, even if they're not changing
|
|
347
|
-
- If you get "Invalid conjunction operator" errors, check the condition array format
|
|
348
|
-
- If you get "additional properties" errors, remove extra fields from the `when` clause
|
|
349
|
-
- If you get missing property errors, ensure all required schema fields are included
|
|
350
|
-
- **Always include**: `id`, `version`, `ignorePreviousResults`, `templates`, `tags`, `labels`, `resourceGroupId`, `remediationSteps`
|
|
351
|
-
- Use `"query0"` as the standard query name for compatibility
|
|
352
|
-
|
|
353
|
-
## Best Practices for Updates
|
|
354
|
-
- Always retrieve the current rule configuration first using `get-rule-details`
|
|
355
|
-
- Only modify the fields that actually need to change
|
|
356
|
-
- Preserve the existing `version` number (it will be auto-incremented)
|
|
357
|
-
- Use the `labels` field for rule organization and tagging (not the deprecated `tags` field)
|
|
358
|
-
- Test rule changes with simple modifications first
|
|
359
|
-
- Document changes in the `description` field if significant
|
|
360
|
-
- When users request tagging functionality, use the `labels` field with key-value pairs
|
|
361
|
-
- Always include `CREATE_ALERT` action as a baseline unless specifically removing it
|
|
362
|
-
|
|
363
|
-
This format ensures reliable rule updates and helps avoid common pitfalls encountered during rule modification.
|