Skip to content

Commit

Permalink
[PLGN-651] insightidr - Fixing schema error with required fields and …
Browse files Browse the repository at this point in the history
…adding in unit tests for checking schemas (#2116)

* PLGN-615-Fixing schema error with required fields and adding in unit test coverage for schema

* PLGN-615-Updating help doc with new chnages
  • Loading branch information
rbowden-r7 authored Nov 15, 2023
1 parent d834841 commit ac6819e
Show file tree
Hide file tree
Showing 38 changed files with 452 additions and 351 deletions.
20 changes: 10 additions & 10 deletions plugins/rapid7_insightidr/.CHECKSUM
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
},
{
"identifier": "advanced_query_on_log/schema.py",
"hash": "351077a9ef290966fbfc0ba59991f33c"
"hash": "00bc1cfd11f5e82bbd42a41f7bb73aa6"
},
{
"identifier": "advanced_query_on_log_set/schema.py",
"hash": "ddb27e90df73351cdf478e1aa245bb64"
"hash": "b5b2c8b6a3b884b33241f87004815459"
},
{
"identifier": "assign_user_to_investigation/schema.py",
Expand Down Expand Up @@ -65,7 +65,7 @@
},
{
"identifier": "get_asset_information/schema.py",
"hash": "85365495f1c8163d9ea7bd57d6868912"
"hash": "64effaa9ce11a6c8a5ce9a7c549ab065"
},
{
"identifier": "get_attachment_information/schema.py",
Expand All @@ -77,7 +77,7 @@
},
{
"identifier": "get_user_information/schema.py",
"hash": "425c12ebf63cfbf4e33cc5062f6f79d6"
"hash": "97336fed8bb4500168c4e0e917207409"
},
{
"identifier": "list_alerts_for_investigation/schema.py",
Expand All @@ -93,7 +93,7 @@
},
{
"identifier": "list_investigations/schema.py",
"hash": "30638dbade4c0cfc4973ae8f337cf74d"
"hash": "efccfd5964ecf0e34d332a0be02b978f"
},
{
"identifier": "query/schema.py",
Expand All @@ -105,23 +105,23 @@
},
{
"identifier": "search_investigations/schema.py",
"hash": "ddc78a2fec8c00fdb0027eb106977bac"
"hash": "863a7464093e3172bb4c8fdfdc6ff565"
},
{
"identifier": "set_disposition_of_investigation/schema.py",
"hash": "c552a2a6b9b88ca956d0ec803820cde9"
"hash": "9a69bbb81a33f783e6031f2901ea1ae4"
},
{
"identifier": "set_priority_of_investigation/schema.py",
"hash": "3c2c3a618cb7706088bf8b3514840456"
"hash": "6a81d506bdef375ea5a0b5fd16ba8349"
},
{
"identifier": "set_status_of_investigation_action/schema.py",
"hash": "9df649243e960ecd339d2e1989b613b9"
"hash": "e9ac594003f3a4ef378aebdd14301439"
},
{
"identifier": "update_investigation/schema.py",
"hash": "899b1d2e69fb65d67c25af353e4b4249"
"hash": "59a5851e5ebf096ba9f22ed5eff1cc0b"
},
{
"identifier": "upload_attachment/schema.py",
Expand Down
2 changes: 1 addition & 1 deletion plugins/rapid7_insightidr/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ Example output:

# Version History

* 7.0.0 - Action: `Advanced Query On Log Set` - Fixed error where statistical queries would always return 0.0 | Action: `Advanced Query On Log Set` - Increase the maximum results returned from 50 to 500 | Action: `Advanced Query On Log` - Add new output type for statistical queries.
* 7.0.0 - Action: `Advanced Query On Log Set` - Fixed error where statistical queries would always return 0.0 | Action: `Advanced Query On Log Set` - Increase the maximum results returned from 50 to 500 | Action: `Advanced Query On Log` - Add new output type for statistical queries | Updated schemas to ensure all are correct and added new schema validation to unit tests
* 6.0.1 - Action: `Advanced Query On Log` - Increase the maximum results returned from 50 to 500
* 6.0.0 - Action: `Advanced Query On Log Set` - Add new output type for statistical queries.
* 5.1.2 - Action: `Advanced Query on Log Set` - Fix JSONDecoderError | Action: `Query` - Update spec and help.md to show it queries log IDs, not query IDs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class AdvancedQueryOnLogOutput(insightconnect_plugin_runtime.Output):
"description": "Number of log entries found",
"order": 3
},
"results": {
"results_events": {
"type": "array",
"title": "Query Results",
"title": "Query Results (Events)",
"description": "Query Results",
"items": {
"$ref": "#/definitions/events"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class Component:
DESCRIPTION = "Realtime query an InsightIDR log set. This will query entire log sets for results. This will query entire log sets for results. Note only 500 results will be returned from a single call, if all results are required for this query please use smaller timeranges"
DESCRIPTION = "Realtime query an InsightIDR log set. This will query entire log sets for results. Note only 500 results will be returned from a single call, if all results are required for this query please use smaller timeranges"


class Input:
Expand Down Expand Up @@ -146,6 +146,9 @@ class AdvancedQueryOnLogSetOutput(insightconnect_plugin_runtime.Output):
"order": 2
}
},
"required": [
"count"
],
"definitions": {
"events": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GetAssetInformationInput(insightconnect_plugin_runtime.Input):
"properties": {
"asset_rrn": {
"type": "string",
"title": "asset RRN",
"title": "Asset RRN",
"description": "The RRN of the asset",
"order": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GetUserInformationInput(insightconnect_plugin_runtime.Input):
"properties": {
"user_rrn": {
"type": "string",
"title": "user RRN",
"title": "User RRN",
"description": "The RRN of the user",
"order": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class ListInvestigationsInput(insightconnect_plugin_runtime.Input):
},
"end_time": {
"type": "string",
"title": "End Time",
"format": "date-time",
"displayType": "date",
"title": "End Time",
"description": "An optional-ISO formatted timestamp, where only investigations whose createTime is before this date will be returned",
"format": "date-time",
"order": 3
},
"index": {
Expand Down Expand Up @@ -99,10 +99,10 @@ class ListInvestigationsInput(insightconnect_plugin_runtime.Input):
},
"start_time": {
"type": "string",
"title": "Start Time",
"format": "date-time",
"displayType": "date",
"title": "Start Time",
"description": "An optional ISO-formatted timestamp, where only investigations whose createTime is after this date will be returned",
"format": "date-time",
"order": 2
},
"statuses": {
Expand Down Expand Up @@ -154,24 +154,6 @@ class ListInvestigationsOutput(insightconnect_plugin_runtime.Output):
"metadata"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
},
"investigation": {
"type": "object",
"title": "investigation",
Expand Down Expand Up @@ -259,25 +241,23 @@ class ListInvestigationsOutput(insightconnect_plugin_runtime.Output):
"source",
"status",
"title"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
]
},
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,6 @@ class SearchInvestigationsOutput(insightconnect_plugin_runtime.Output):
"metadata"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
},
"investigation": {
"type": "object",
"title": "investigation",
Expand Down Expand Up @@ -220,25 +202,23 @@ class SearchInvestigationsOutput(insightconnect_plugin_runtime.Output):
"source",
"status",
"title"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
]
},
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,6 @@ class SetDispositionOfInvestigationOutput(insightconnect_plugin_runtime.Output):
"investigation"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
},
"investigation": {
"type": "object",
"title": "investigation",
Expand Down Expand Up @@ -174,25 +156,23 @@ class SetDispositionOfInvestigationOutput(insightconnect_plugin_runtime.Output):
"source",
"status",
"title"
],
"definitions": {
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
]
},
"assignee": {
"type": "object",
"title": "assignee",
"properties": {
"email": {
"type": "string",
"title": "Email",
"description": "The email of the assigned user",
"order": 1
},
"name": {
"type": "string",
"title": "Name",
"description": "The name of the assigned user",
"order": 2
}
}
}
Expand Down
Loading

0 comments on commit ac6819e

Please sign in to comment.