Skip to content

Commit aac087c

Browse files
[SOAR-19385] insightIDR added security test disposition for alerts (#3408) (#3410)
* Added security test disposition for alerts * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Reverting resource helper * Preset update * Skipping static code check * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py * Update resource_helper.py
1 parent 032a070 commit aac087c

File tree

10 files changed

+40
-16
lines changed

10 files changed

+40
-16
lines changed

plugins/rapid7_insightidr/.CHECKSUM

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"spec": "35390e12c9a9d68087549cf36658a6f0",
3-
"manifest": "a0cf72014580730896e5a28b0f59422b",
4-
"setup": "bdbb3b2cfa44c9d352098a861a20e065",
2+
"spec": "d6ce5b02ac6ab11cd4aa9380908a6d58",
3+
"manifest": "d2efd7366f383bf6e5ab40ffc9514347",
4+
"setup": "63fb00e8d7801ea60db7f292c46581f5",
55
"schemas": [
66
{
77
"identifier": "add_indicators_to_a_threat/schema.py",
@@ -69,7 +69,7 @@
6969
},
7070
{
7171
"identifier": "get_alert_information/schema.py",
72-
"hash": "5f31d60e24cf93bacd6eebdd18966f98"
72+
"hash": "48461d148def77b3d963ff81bb14866a"
7373
},
7474
{
7575
"identifier": "get_all_logs/schema.py",
@@ -125,7 +125,7 @@
125125
},
126126
{
127127
"identifier": "search_alerts/schema.py",
128-
"hash": "4f2479395d303d9c8d91358f86353405"
128+
"hash": "e557bb0c7ca5ffc74bb4c18155e7a20e"
129129
},
130130
{
131131
"identifier": "search_investigations/schema.py",
@@ -145,7 +145,7 @@
145145
},
146146
{
147147
"identifier": "update_alert/schema.py",
148-
"hash": "61fa055d9ef7fe9bfc4bac196d6ace22"
148+
"hash": "71cbe6b5ef3a9901f4cf821da9343575"
149149
},
150150
{
151151
"identifier": "update_investigation/schema.py",
@@ -161,7 +161,7 @@
161161
},
162162
{
163163
"identifier": "get_new_alerts/schema.py",
164-
"hash": "b7310f06a168de278ef266d769d3881a"
164+
"hash": "2efa90f87eb6b301a972f56f1a554375"
165165
},
166166
{
167167
"identifier": "get_new_investigations/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 = "11.0.4"
9+
Version = "11.0.5"
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,6 +3428,7 @@ Example output:
34283428

34293429
# Version History
34303430

3431+
* 11.0.5 - Added new disposition of the alert
34313432
* 11.0.4 - Added support for parsing improperly formatted JSON-like strings | SDK bump to 6.3.3
34323433
* 11.0.3 - Added log entry validation using regular expressions | SDK bump to 6.2.6
34333434
* 11.0.2 - Updating descriptions for 'set_priority_of_investigation' & 'set_disposition_of_investigation'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class GetAlertInformationOutput(insightconnect_plugin_runtime.Output):
228228
"MALICIOUS",
229229
"BENIGN",
230230
"UNKNOWN",
231-
"NOT_APPLICABLE"
231+
"NOT_APPLICABLE",
232+
"SECURITY_TEST"
232233
],
233234
"order": 21
234235
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ class SearchAlertsOutput(insightconnect_plugin_runtime.Output):
486486
"MALICIOUS",
487487
"BENIGN",
488488
"UNKNOWN",
489-
"NOT_APPLICABLE"
489+
"NOT_APPLICABLE",
490+
"SECURITY_TEST"
490491
],
491492
"order": 21
492493
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ class UpdateAlertOutput(insightconnect_plugin_runtime.Output):
284284
"MALICIOUS",
285285
"BENIGN",
286286
"UNKNOWN",
287-
"NOT_APPLICABLE"
287+
"NOT_APPLICABLE",
288+
"SECURITY_TEST"
288289
],
289290
"order": 21
290291
},

plugins/rapid7_insightidr/komand_rapid7_insightidr/triggers/get_new_alerts/schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ class GetNewAlertsOutput(insightconnect_plugin_runtime.Output):
371371
"MALICIOUS",
372372
"BENIGN",
373373
"UNKNOWN",
374-
"NOT_APPLICABLE"
374+
"NOT_APPLICABLE",
375+
"SECURITY_TEST"
375376
],
376377
"order": 21
377378
},

plugins/rapid7_insightidr/komand_rapid7_insightidr/util/resource_helper.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,26 @@ def resource_request(self, endpoint: str, method: str = "get", params: dict = No
129129
)
130130
raise PluginException(f"InsightIDR returned a status code of {response.status_code}: {status_code_message}")
131131

132-
def make_request( # noqa: C901
132+
def _handle_response_status(self, response: requests.Response) -> None:
133+
"""
134+
Handles the response status code and raises appropriate exceptions
135+
:param response: Response object from the request
136+
:return: None
137+
"""
138+
if response.status_code == 400:
139+
raise PluginException(preset=PluginException.Preset.BAD_REQUEST, data=response.text)
140+
if response.status_code in [401, 403]:
141+
raise PluginException(preset=PluginException.Preset.API_KEY, data=response.text)
142+
if response.status_code == 404:
143+
raise PluginException(preset=PluginException.Preset.NOT_FOUND, data=response.text)
144+
if 400 < response.status_code < 500:
145+
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=response.text)
146+
if response.status_code >= 500:
147+
raise PluginException(preset=PluginException.Preset.SERVER_ERROR, data=response.text)
148+
149+
def make_request(
133150
self, path: str, method: str = "GET", params: dict = None, json_data: dict = None, files: dict = None
134-
):
151+
): # noqa: MC0001
135152
try:
136153
response = self.session.request(
137154
method=method.upper(),

plugins/rapid7_insightidr/plugin.spec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ products: [insightconnect]
44
name: rapid7_insightidr
55
title: "Rapid7 InsightIDR"
66
description: "This plugin allows you to add indicators to a threat and see the status of investigations"
7-
version: 11.0.4
7+
version: 11.0.5
88
connection_version: 5
99
supported_versions: ["Latest release successfully tested on 2024-09-10."]
1010
vendor: rapid7
@@ -35,6 +35,7 @@ sdk:
3535
version: 6.3.3
3636
user: nobody
3737
version_history:
38+
- "11.0.5 - Added new disposition of the alert"
3839
- "11.0.4 - Added support for parsing improperly formatted JSON-like strings | SDK bump to 6.3.3"
3940
- "11.0.3 - Added log entry validation using regular expressions | SDK bump to 6.2.6"
4041
- "11.0.2 - Updating descriptions for 'set_priority_of_investigation' & 'set_disposition_of_investigation'"
@@ -959,6 +960,7 @@ types:
959960
- BENIGN
960961
- UNKNOWN
961962
- NOT_APPLICABLE
963+
- SECURITY_TEST
962964
investigation_rrn:
963965
title: Investigation RRN
964966
description: The RRN of the investigation that the alert is part of.

plugins/rapid7_insightidr/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name="rapid7_insightidr-rapid7-plugin",
7-
version="11.0.4",
7+
version="11.0.5",
88
description="This plugin allows you to add indicators to a threat and see the status of investigations",
99
author="rapid7",
1010
author_email="",

0 commit comments

Comments
 (0)