Skip to content

Commit 21e7d03

Browse files
authored
[SOAR-18495] Rapid7_InsightIDR Fix Schema (advanced_query_on_log) (#2995) (#3011)
* Schema update * Removing key from schema. Keeping same naming convention (Uppercase) * Accidentally removed wrong key :/ * Major bump * Refining Schema for other query actions
1 parent d416b9e commit 21e7d03

File tree

8 files changed

+536
-42
lines changed

8 files changed

+536
-42
lines changed

plugins/rapid7_insightidr/.CHECKSUM

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"spec": "ef55d0eaab88354037eb0e7a0c1d5ca0",
3-
"manifest": "a9dc8b0c15952a931013e92670cdf86b",
4-
"setup": "8b4da6c79f36dd56dfc82e26d0009a8b",
2+
"spec": "696ad2ef53e23becbc514ade6b807b86",
3+
"manifest": "447c02c4e8eff1ffc54155a48b270af3",
4+
"setup": "00df4e2ab481d3954b493d8e94670fca",
55
"schemas": [
66
{
77
"identifier": "add_indicators_to_a_threat/schema.py",
88
"hash": "95108ef162aa99c34e0d20ba2fd3035e"
99
},
1010
{
1111
"identifier": "advanced_query_on_log/schema.py",
12-
"hash": "c25673288c3406030e64dc6f3451821d"
12+
"hash": "04f457e70ed006499969f3871fd60314"
1313
},
1414
{
1515
"identifier": "advanced_query_on_log_set/schema.py",
16-
"hash": "ff689fccb0ed297d1c5f7f45877fd138"
16+
"hash": "651d3e1a7ce2676f00851d04e596584c"
1717
},
1818
{
1919
"identifier": "assign_user_to_investigation/schema.py",
@@ -113,7 +113,7 @@
113113
},
114114
{
115115
"identifier": "query/schema.py",
116-
"hash": "ec57e897be9e044c6607e33ab15020b0"
116+
"hash": "3a8132d5735fdbb53f9f26e40cb1ada9"
117117
},
118118
{
119119
"identifier": "replace_indicators/schema.py",

plugins/rapid7_insightidr/bin/komand_rapid7_insightidr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from sys import argv
66

77
Name = "Rapid7 InsightIDR"
88
Vendor = "rapid7"
9-
Version = "10.3.4"
9+
Version = "11.0.0"
1010
Description = "This plugin allows you to add indicators to a threat and see the status of investigations"
1111

1212

plugins/rapid7_insightidr/help.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Example input:
146146
| :--- | :--- | :--- | :--- | :--- |
147147
|count|integer|True|Number of log entries found|10|
148148
|results_events|[]events|False|Query Results|[{"labels": [],"timestamp": 1601598638768,"sequence_number": 123456789123456789,"log_id": "64z0f0p9-1a99-4501-xe36-a6d03687f313","message": {"timestamp": "2020-10-02T00:29:14.649Z","destination_asset": "iagent-win7","source_asset_address": "192.168.100.50","destination_asset_address": "example-host","destination_local_account": "user","logon_type": "NETWORK","result": "SUCCESS","new_authentication": "false","service": "ntlmssp ","source_json": {"sourceName": "Microsoft-Windows-Security-Auditing","insertionStrings": ["S-1-0-0","-","-","0x0","X-X-X-XXXXXXXXXXX","user@example.com","example-host","0x204f163c","3","NtLmSsp ","NTLM","","{00000000-0000-0000-0000-000000000000}","-","NTLM V2","128","0x0","-","192.168.50.1","59090"],"eventCode": 4624,"computerName": "example-host","sid": "","isDomainController": false,"eventData": null,"timeWritten": "2020-10-02T00:29:13.670722000Z"}},"links": [{"rel": "Context","href": "https://us.api.insight.rapid7.com/log_search/query/context/xxxx"}],"sequence_number_str": "123456789123456789"}]|
149-
|results_statistical|statistics|False|Query Results|{"leql":{"during":{"from":1699579214000,"to":1699622414000},"statement":"groupby(r7_context.asset.name)"},"logs":["123456-abcd-1234-abcd-123456abc"],"search_stats":{"bytes_all":9961260,"bytes_checked":9961260,"duration_ms":19,"events_all":1640,"events_checked":1640,"events_matched":1639,"index_factor":0.0},"statistics":{"all_exact_result":true,"cardinality":0,"from":1699579214000,"granularity":4320000,"groups":[{"linux":{"count":1163.0}},{"windowsx64":{"count":476.0}}],"groups_timeseries":[{"linux":{"groups_timeseries":[],"series":[{"count":45.0},{"count":21.0},{"count":16.0},{"count":270.0},{"count":27.0},{"count":43.0},{"count":27.0},{"count":39.0},{"count":29.0},{"count":646.0}],"totals":{"count":1163.0}}},{"windowsx64":{"groups_timeseries":[],"series":[{"count":54.0},{"count":40.0},{"count":60.0},{"count":37.0},{"count":42.0},{"count":62.0},{"count":41.0},{"count":47.0},{"count":49.0},{"count":44.0}],"totals":{"count":476.0}}}],"others":{"series":[]},"stats":{},"status":200,"timeseries":{},"to":1699622414000,"type":"count"}}|
149+
|results_statistical|results_statistics|False|Query Results|{"leql":{"during":{"from":1699579214000,"to":1699622414000},"statement":"groupby(r7_context.asset.name)"},"logs":["123456-abcd-1234-abcd-123456abc"],"search_stats":{"bytes_all":9961260,"bytes_checked":9961260,"duration_ms":19,"events_all":1640,"events_checked":1640,"events_matched":1639,"index_factor":0.0},"statistics":{"all_exact_result":true,"cardinality":0,"from":1699579214000,"granularity":4320000,"groups":[{"linux":{"count":1163.0}},{"windowsx64":{"count":476.0}}],"groups_timeseries":[{"linux":{"groups_timeseries":[],"series":[{"count":45.0},{"count":21.0},{"count":16.0},{"count":270.0},{"count":27.0},{"count":43.0},{"count":27.0},{"count":39.0},{"count":29.0},{"count":646.0}],"totals":{"count":1163.0}}},{"windowsx64":{"groups_timeseries":[],"series":[{"count":54.0},{"count":40.0},{"count":60.0},{"count":37.0},{"count":42.0},{"count":62.0},{"count":41.0},{"count":47.0},{"count":49.0},{"count":44.0}],"totals":{"count":476.0}}}],"others":{"series":[]},"stats":{},"status":200,"timeseries":{},"to":1699622414000,"type":"count"}}|
150150

151151
Example output:
152152

@@ -377,7 +377,7 @@ Example input:
377377
| :--- | :--- | :--- | :--- | :--- |
378378
|count|integer|True|Number of log entries found|10|
379379
|results_events|[]events|False|Query Results|[{"labels": [],"timestamp": 1601598638768,"sequence_number": 123456789123456789,"log_id": "64z0f0p9-1a99-4501-xe36-a6d03687f313","message": {"timestamp": "2020-10-02T00:29:14.649Z","destination_asset": "iagent-win7","source_asset_address": "192.168.100.50","destination_asset_address": "example-host","destination_local_account": "user","logon_type": "NETWORK","result": "SUCCESS","new_authentication": "false","service": "ntlmssp ","source_json": {"sourceName": "Microsoft-Windows-Security-Auditing","insertionStrings": ["S-1-0-0","-","-","0x0","X-X-X-XXXXXXXXXXX","user@example.com","example-host","0x204f163c","3","NtLmSsp ","NTLM","","{00000000-0000-0000-0000-000000000000}","-","NTLM V2","128","0x0","-","192.168.50.1","59090"],"eventCode": 4624,"computerName": "example-host","sid": "","isDomainController": false,"eventData": null,"timeWritten": "2020-10-02T00:29:13.670722000Z"}},"links": [{"rel": "Context","href": "https://us.api.insight.rapid7.com/log_search/query/context/xxxx"}],"sequence_number_str": "123456789123456789"}]|
380-
|results_statistical|statistics|False|Query Results|{"leql":{"during":{"from":1699579214000,"to":1699622414000},"statement":"groupby(r7_context.asset.name)"},"logs":["123456-abcd-1234-abcd-123456abc"],"search_stats":{"bytes_all":9961260,"bytes_checked":9961260,"duration_ms":19,"events_all":1640,"events_checked":1640,"events_matched":1639,"index_factor":0.0},"statistics":{"all_exact_result":true,"cardinality":0,"from":1699579214000,"granularity":4320000,"groups":[{"linux":{"count":1163.0}},{"windowsx64":{"count":476.0}}],"groups_timeseries":[{"linux":{"groups_timeseries":[],"series":[{"count":45.0},{"count":21.0},{"count":16.0},{"count":270.0},{"count":27.0},{"count":43.0},{"count":27.0},{"count":39.0},{"count":29.0},{"count":646.0}],"totals":{"count":1163.0}}},{"windowsx64":{"groups_timeseries":[],"series":[{"count":54.0},{"count":40.0},{"count":60.0},{"count":37.0},{"count":42.0},{"count":62.0},{"count":41.0},{"count":47.0},{"count":49.0},{"count":44.0}],"totals":{"count":476.0}}}],"others":{"series":[]},"stats":{},"status":200,"timeseries":{},"to":1699622414000,"type":"count"}}|
380+
|results_statistical|results_statistics|False|Query Results|{"leql":{"during":{"from":1699579214000,"to":1699622414000},"statement":"groupby(r7_context.asset.name)"},"logs":["123456-abcd-1234-abcd-123456abc"],"search_stats":{"bytes_all":9961260,"bytes_checked":9961260,"duration_ms":19,"events_all":1640,"events_checked":1640,"events_matched":1639,"index_factor":0.0},"statistics":{"all_exact_result":true,"cardinality":0,"from":1699579214000,"granularity":4320000,"groups":[{"linux":{"count":1163.0}},{"windowsx64":{"count":476.0}}],"groups_timeseries":[{"linux":{"groups_timeseries":[],"series":[{"count":45.0},{"count":21.0},{"count":16.0},{"count":270.0},{"count":27.0},{"count":43.0},{"count":27.0},{"count":39.0},{"count":29.0},{"count":646.0}],"totals":{"count":1163.0}}},{"windowsx64":{"groups_timeseries":[],"series":[{"count":54.0},{"count":40.0},{"count":60.0},{"count":37.0},{"count":42.0},{"count":62.0},{"count":41.0},{"count":47.0},{"count":49.0},{"count":44.0}],"totals":{"count":476.0}}}],"others":{"series":[]},"stats":{},"status":200,"timeseries":{},"to":1699622414000,"type":"count"}}|
381381

382382
Example output:
383383

@@ -3068,13 +3068,16 @@ Example output:
30683068

30693069
|Name|Type|Default|Required|Description|Example|
30703070
| :--- | :--- | :--- | :--- | :--- | :--- |
3071-
|Computer Name|string|None|None|None|None|
3072-
|Event Code|integer|None|None|None|None|
3073-
|Event Data|eventData|None|None|None|None|
3074-
|Is Domain Controller|boolean|None|None|None|None|
3075-
|SID|string|None|None|None|None|
3076-
|Source Name|string|None|None|None|None|
3077-
|Time Written|string|None|None|None|None|
3071+
|Destination Asset|string|None|None|None|None|
3072+
|Destination Asset Address|string|None|None|None|None|
3073+
|Destination Local Account|string|None|None|None|None|
3074+
|Logon Type|string|None|None|None|None|
3075+
|New Authentication|string|None|None|None|None|
3076+
|Result|string|None|None|None|None|
3077+
|Service|string|None|None|None|None|
3078+
|Source Asset Address|string|None|None|None|None|
3079+
|Source JSON|source_json|None|None|None|None|
3080+
|Timestamp|string|None|None|None|None|
30783081

30793082
**events**
30803083

@@ -3085,8 +3088,18 @@ Example output:
30853088
|Log ID|string|None|None|Log ID|None|
30863089
|Message|message|None|None|Message|None|
30873090
|Sequence Number|integer|None|None|Sequence number|None|
3091+
|Sequence Number String|string|None|None|Sequence number string|None|
30883092
|Timestamp|integer|None|None|Timestamp|None|
30893093

3094+
**results_statistics**
3095+
3096+
|Name|Type|Default|Required|Description|Example|
3097+
| :--- | :--- | :--- | :--- | :--- | :--- |
3098+
|LEQL|object|None|False|The LEQL 'WHERE' clause to match against|None|
3099+
|Logs|array|None|False|Holds the Log ID of the matching log entry|None|
3100+
|Search Stats|object|None|False|Holds data regarding the query execution|None|
3101+
|statistics|statistics|None|False|Holds the overall statistical results|None|
3102+
30903103
**statistics**
30913104

30923105
|Name|Type|Default|Required|Description|Example|
@@ -3105,6 +3118,19 @@ Example output:
31053118
|To|integer|None|False|The end of the time range for the query, as a UNIX timestamp in milliseconds|None|
31063119
|Type|string|None|False|The type of function performed, for example, "count", "max", "average", "standarddeviation"|None|
31073120

3121+
**source_json**
3122+
3123+
|Name|Type|Default|Required|Description|Example|
3124+
| :--- | :--- | :--- | :--- | :--- | :--- |
3125+
|Computer Name|string|None|False|None|None|
3126+
|Event Code|integer|None|False|None|None|
3127+
|Event Data|eventData|None|False|None|None|
3128+
|Insertion Strings|[]string|None|False|Insertion Strings|None|
3129+
|Is Domain Controller|boolean|None|False|None|None|
3130+
|SID|string|None|False|None|None|
3131+
|Source Name|string|None|False|Source Name|None|
3132+
|Time Written|string|None|False|None|None|
3133+
31083134
**links**
31093135

31103136
|Name|Type|Default|Required|Description|Example|
@@ -3401,6 +3427,7 @@ Example output:
34013427

34023428
# Version History
34033429

3430+
* 11.0.0 - Updating schema for query actions (`advanced_query_on_log`, `advanced_query_on_log_set` & `query`) to account for missing keys/invalid mapping in the schema
34043431
* 10.3.4 - Bumping requirements.txt | SDK bump to 6.2.2
34053432
* 10.3.3 - Bumping requirements.txt | SDK bump to 6.2.0
34063433
* 10.3.2 - Initial updates for fedramp compliance | Updated SDK to the latest version

plugins/rapid7_insightidr/komand_rapid7_insightidr/actions/advanced_query_on_log/schema.py

Lines changed: 144 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class AdvancedQueryOnLogOutput(insightconnect_plugin_runtime.Output):
122122
"order": 1
123123
},
124124
"results_statistical": {
125-
"$ref": "#/definitions/statistics",
125+
"$ref": "#/definitions/results_statistics",
126126
"title": "Query Results (Statistical)",
127127
"description": "Query Results",
128128
"order": 2
@@ -164,7 +164,7 @@ class AdvancedQueryOnLogOutput(insightconnect_plugin_runtime.Output):
164164
"order": 4
165165
},
166166
"message": {
167-
"type": ["object", "string"],
167+
"$ref": "#/definitions/message",
168168
"title": "Message",
169169
"description": "Message",
170170
"order": 5
@@ -177,6 +177,119 @@ class AdvancedQueryOnLogOutput(insightconnect_plugin_runtime.Output):
177177
"$ref": "#/definitions/link"
178178
},
179179
"order": 6
180+
},
181+
"sequence_number_str": {
182+
"type": "string",
183+
"title": "Sequence Number String",
184+
"description": "Sequence number string",
185+
"order": 7
186+
}
187+
}
188+
},
189+
"message": {
190+
"type": "object",
191+
"title": "message",
192+
"properties": {
193+
"timestamp": {
194+
"type": "string",
195+
"title": "Timestamp",
196+
"order": 1
197+
},
198+
"destination_asset": {
199+
"type": "string",
200+
"title": "Destination Asset",
201+
"order": 2
202+
},
203+
"source_asset_address": {
204+
"type": "string",
205+
"title": "Source Asset Address",
206+
"order": 3
207+
},
208+
"destination_asset_address": {
209+
"type": "string",
210+
"title": "Destination Asset Address",
211+
"order": 4
212+
},
213+
"destination_local_account": {
214+
"type": "string",
215+
"title": "Destination Local Account",
216+
"order": 5
217+
},
218+
"logon_type": {
219+
"type": "string",
220+
"title": "Logon Type",
221+
"order": 6
222+
},
223+
"result": {
224+
"type": "string",
225+
"title": "Result",
226+
"order": 7
227+
},
228+
"new_authentication": {
229+
"type": "string",
230+
"title": "New Authentication",
231+
"order": 8
232+
},
233+
"service": {
234+
"type": "string",
235+
"title": "Service",
236+
"order": 9
237+
},
238+
"source_json": {
239+
"$ref": "#/definitions/source_json",
240+
"title": "Source JSON",
241+
"order": 10
242+
}
243+
}
244+
},
245+
"source_json": {
246+
"type": "object",
247+
"title": "source_json",
248+
"properties": {
249+
"sourceName": {
250+
"type": "string",
251+
"title": "Source Name",
252+
"description": "Source Name",
253+
"order": 1
254+
},
255+
"insertionStrings": {
256+
"type": "array",
257+
"title": "Insertion Strings",
258+
"description": "Insertion Strings",
259+
"items": {
260+
"type": "string"
261+
},
262+
"order": 2
263+
},
264+
"eventCode": {
265+
"type": "integer",
266+
"title": "Event Code",
267+
"order": 3
268+
},
269+
"computerName": {
270+
"type": "string",
271+
"title": "Computer Name",
272+
"order": 4
273+
},
274+
"sid": {
275+
"type": "string",
276+
"title": "SID",
277+
"order": 5
278+
},
279+
"isDomainController": {
280+
"type": "boolean",
281+
"title": "Is Domain Controller",
282+
"order": 6
283+
},
284+
"eventData": {
285+
"$ref": "#/definitions/eventData",
286+
"title": "Event Data",
287+
"order": 7
288+
},
289+
"timeWritten": {
290+
"type": "string",
291+
"title": "Time Written",
292+
"order": 8
180293
}
181294
}
182295
},
@@ -357,6 +470,35 @@ class AdvancedQueryOnLogOutput(insightconnect_plugin_runtime.Output):
357470
}
358471
}
359472
},
473+
"results_statistics": {
474+
"type": "object",
475+
"title": "results_statistics",
476+
"properties": {
477+
"statistics": {
478+
"$ref": "#/definitions/statistics",
479+
"title": "statistics",
480+
"description": "Holds the overall statistical results",
481+
"order": 1
482+
},
483+
"leql": {
484+
"type": "object",
485+
"title": "LEQL",
486+
"description": "The LEQL 'WHERE' clause to match against",
487+
"order": 2
488+
},
489+
"logs": {
490+
"title": "Logs",
491+
"description": "Holds the Log ID of the matching log entry",
492+
"order": 3
493+
},
494+
"search_stats": {
495+
"type": "object",
496+
"title": "Search Stats",
497+
"description": "Holds data regarding the query execution",
498+
"order": 4
499+
}
500+
}
501+
},
360502
"statistics": {
361503
"type": "object",
362504
"title": "statistics",

0 commit comments

Comments
 (0)