Skip to content

Commit 349fec7

Browse files
authored
SentinelOne validation checks (#3031)
* Fix issue with input validation * Black formatting * Check for whitespace and change version back to 11.1.3 * Fix help.md
1 parent b60a6a9 commit 349fec7

File tree

7 files changed

+35
-18
lines changed

7 files changed

+35
-18
lines changed

plugins/sentinelone/.CHECKSUM

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"spec": "175814e9d6bf3496067ab005bc81ab74",
3-
"manifest": "bf2f37bb010ec31daf0a4aee3ae45b89",
4-
"setup": "1e8d3387ed4d46dc2171d7ee9c3c4a2c",
2+
"spec": "c6927728c4f69ccd4bfba73202f850ec",
3+
"manifest": "3c7c9830c5936c4ffed6adbaaf12722e",
4+
"setup": "98419c249e2910502c36eb5144487ce4",
55
"schemas": [
66
{
77
"identifier": "activities_list/schema.py",
@@ -129,7 +129,7 @@
129129
},
130130
{
131131
"identifier": "monitor_logs/schema.py",
132-
"hash": "6ee7bc26267a2fd719aecccb08ec7f18"
132+
"hash": "90852af2f999f070b9386c3f9cf6f953"
133133
},
134134
{
135135
"identifier": "get_threats/schema.py",

plugins/sentinelone/bin/komand_sentinelone

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from sys import argv
77
Name = "SentinelOne"
88
Vendor = "rapid7"
99
Version = "11.1.3"
10-
Description = "The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne"
10+
Description = "[SentinelOne](https://www.sentinelone.com/) is a next-gen cybersecurity company focused on protecting the enterprise through the endpoint. The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne.This plugin utilizes the SentinelOne API, the documentation is located in the SentinelOne console"
1111

1212

1313
def main():

plugins/sentinelone/help.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[SentinelOne](https://www.sentinelone.com/) is a next-gen cybersecurity company focused on protecting the enterprise through the endpoint. The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne.
44

5-
This plugin utilizes the SentinelOne API, the documentation is located in the SentinelOne console.
5+
This plugin utilizes the SentinelOne API, the documentation is located in the SentinelOne console
66

77
# Key Features
88

@@ -885,6 +885,7 @@ Example input:
885885
| :--- | :--- | :--- | :--- | :--- |
886886
|errors|[]object|False|Errors|[]|
887887
|events|[]eventData|False|Response events data|[{"accountId": "1000000000000000000", "agentDomain": "WORKGROUP", "agentGroupId": "1000000000000000000", "agentId": "1000000000000000000", "agentInfected": True, "agentIp": "198.51.100.1", "agentIsActive": True, "agentIsDecommissioned": False, "agentMachineType": "laptop", "agentName": "Example Name", "agentNetworkStatus": "connected", "agentOs": "windows", "agentTimestamp": "2023-10-23T00:00:00.000Z", "agentUuid": "9de5069c5afe602b2ea0a04b66beb2c0", "createdAt": "2023-10-23T00:00:00.000Z", "endpointMachineType": "desktop", "endpointName": "Example Name", "endpointOs": "windows", "eventTime": "2023-10-23T00:00:00.000Z", "eventType": "Task Update", "id": "1000000000000000000", "isAgentVersionFullySupportedForPg": False, "isAgentVersionFullySupportedForPgMessage": "Example message", "lastActivatedAt": "2023-10-23T00:00:00.000Z", "objectType": "scheduled_task", "parentProcessUniqueKey": "ABCD1234", "pid": "1234", "processGroupId": "ABCD1234", "processIntegrityLevel": "INTEGRITY_LEVEL_UNKNOWN", "processStartTime": "2023-10-23T00:00:00.000Z", "processUniqueKey": "ABCD1234", "relatedToThreat": "False", "siteId": "1000000000000000000", "storyline": "ABCD1234", "taskName": "Example Name", "trueContext": "ABCD1234"}, {"accountId": "1000000000000000001", "agentDomain": "WORKGROUP", "agentGroupId": "1000000000000000001", "agentId": "1000000000000000001", "agentInfected": True, "agentIp": "198.51.100.1", "agentIsActive": True, "agentIsDecommissioned": False, "agentMachineType": "laptop", "agentName": "Example Name", "agentNetworkStatus": "connected", "agentOs": "windows", "agentTimestamp": "2023-10-23T00:00:00.000Z", "agentUuid": "9de5069c5afe602b2ea0a04b66beb2c0", "createdAt": "2023-10-23T00:00:00.000Z", "endpointMachineType": "desktop", "endpointName": "Example Name", "endpointOs": "windows", "eventTime": "2023-10-23T00:00:00.000Z", "eventType": "Task Update", "id": "1000000000000000001", "isAgentVersionFullySupportedForPg": False, "isAgentVersionFullySupportedForPgMessage": "Example message", "lastActivatedAt": "2023-10-23T00:00:00.000Z", "objectType": "scheduled_task", "parentProcessUniqueKey": "ABCD1234", "pid": "1234", "processGroupId": "ABCD1234", "processIntegrityLevel": "INTEGRITY_LEVEL_UNKNOWN", "processStartTime": "2023-10-23T00:00:00.000Z", "processUniqueKey": "ABCD1234", "relatedToThreat": "False", "siteId": "1000000000000000001", "storyline": "ABCD1234", "taskName": "Example Name", "trueContext": "ABCD1234"}]|
888+
888889
Example output:
889890

890891
```
@@ -1023,7 +1024,7 @@ This action is used to gets summary of all threats
10231024
|Name|Type|Required|Description|Example|
10241025
| :--- | :--- | :--- | :--- | :--- |
10251026
|data|[]threatData|False|Data|[{"agentOsType": "windows", "automaticallyResolved": False, "cloudVerdict": "black", "id": "1000000000000000000", "engines": ["reputation"], "fileContentHash": "3395856ce81f2b7382dee72602f798b642f14140", "fromCloud": False, "mitigationMode": "protect", "mitigationReport": {"quarantine": {"status": "success"}, "kill": {"status": "success"}}, "rank": 7, "siteName": "Example Site", "whiteningOptions": ["hash"], "agentComputerName": "vagrant-pc", "collectionId": "1000000000000000000", "createdAt": "2019-02-21T16:05:49.251201Z", "mitigationStatus": "active", "classificationSource": "Static", "resolved": True, "accountName": "Example Account", "fileVerificationType": "NotSigned", "siteId": "1000000000000000000", "fileIsExecutable": False, "fromScan": False, "agentNetworkStatus": "disconnecting", "createdDate": "2019-02-21T16:05:49.175000Z", "accountId": "1000000000000000000", "initiatedBy": "agentPolicy", "initiatedByDescription": "Agent Policy", "threatAgentVersion": "3.0.1.3", "username": "vagrant-pc\\vagrant", "agentVersion": "3.0.1.3", "classifierName": "STATIC", "fileExtensionType": "Executable", "agentDomain": "WORKGROUP", "fileIsSystem": False, "agentInfected": False, "isCertValid": False, "isInteractiveSession": False, "isPartialStory": False, "updatedAt": "2020-05-28T21:53:36.064425Z", "agentId": "1000000000000000000", "agentMachineType": "desktop", "classification": "Malware", "markedAsBenign": False, "threatName": "EICAR.com", "agentIsDecommissioned": True, "description": "malware detected - not mitigated yet (static engin...", "fileDisplayName": "EICAR.com", "agentIp": "198.51.100.1", "agentIsActive": False, "fileObjectId": "1234567890", "filePath": "\\Device\\HarddiskVolume2\\Users\\vagrant\\Desktop\\EICA...", "maliciousGroupId": "1234567890"}]|
1026-
|errors|[]object|False|Errors|[]|', '|data|[]threatData|False|Data|[{"agentOsType": "windows", "automaticallyResolved": False, "cloudVerdict": "black", "id": "1000000000000000000", "engines": ["reputation"], "fileContentHash": "3395856ce81f2b7382dee72602f798b642f14140", "fromCloud": False, "mitigationMode": "protect", "mitigationReport": {"quarantine": {"status": "success"}, "kill": {"status": "success"}}, "rank": 7, "siteName": "Example Site", "whiteningOptions": ["hash"], "agentComputerName": "vagrant-pc", "collectionId": "1000000000000000000", "createdAt": "2019-02-21T16:05:49.251201Z", "mitigationStatus": "active", "classificationSource": "Static", "resolved": True, "accountName": "Example Account", "fileVerificationType": "NotSigned", "siteId": "1000000000000000000", "fileIsExecutable": False, "fromScan": False, "agentNetworkStatus": "disconnecting", "createdDate": "2019-02-21T16:05:49.175000Z", "accountId": "1000000000000000000", "initiatedBy": "agentPolicy", "initiatedByDescription": "Agent Policy", "threatAgentVersion": "3.0.1.3", "username": "vagrant-pc\\\\vagrant", "agentVersion": "3.0.1.3", "classifierName": "STATIC", "fileExtensionType": "Executable", "agentDomain": "WORKGROUP", "fileIsSystem": False, "agentInfected": False, "isCertValid": False, "isInteractiveSession": False, "isPartialStory": False, "updatedAt": "2020-05-28T21:53:36.064425Z", "agentId": "1000000000000000000", "agentMachineType": "desktop", "classification": "Malware", "markedAsBenign": False, "threatName": "EICAR.com", "agentIsDecommissioned": True, "description": "malware detected - not mitigated yet (static engin...", "fileDisplayName": "EICAR.com", "agentIp": "198.51.100.1", "agentIsActive": False, "fileObjectId": "1234567890", "filePath": "\\\\Device\\\\HarddiskVolume2\\\\Users\\\\vagrant\\\\Desktop\\\\EICA...", "maliciousGroupId": "1234567890"}]|
1027+
|errors|[]object|False|Errors|[]|
10271028
|pagination|pagination|False|Pagination|{'totalItems': 1}|
10281029

10291030
Example output:
@@ -2351,7 +2352,7 @@ Example output:
23512352

23522353
# Version History
23532354

2354-
* 11.1.3 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities
2355+
* 11.1.3 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities | Fix issue with URL input validation
23552356
* 11.1.2 - Resolve issue where unexpected timestamps returned from SentinelOne were not parsed in task `Monitor Logs` | Update plugin to be FedRAMP compliant
23562357
* 11.1.1 - Updated Plugin connection to improve `instance` input usability
23572358
* 11.1.0 - Added connection test for task `Monitor Logs` | Update SDK

plugins/sentinelone/komand_sentinelone/tasks/monitor_logs/schema.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class MonitorLogsOutput(insightconnect_plugin_runtime.Output):
4343
"type": "array",
4444
"title": "Logs",
4545
"description": "List of activity, device control event, and threat logs within the specified time range",
46-
"items": {
47-
"type": "object"
48-
},
46+
"items": {},
4947
"definitions": {}
5048
}
5149
""")

plugins/sentinelone/komand_sentinelone/util/helper.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,24 @@ def _wrapper(self, *args, **kwargs):
8383

8484
def format_subdomain(instance: str) -> str:
8585
"""
86-
If an input subdomain contains a scheme or the Sentinelone secondlevel domain, strip these values
86+
If an input subdomain contains a scheme or the SentinelOne second-level domain, strip these values
8787
"""
88-
instance = instance.replace(".sentinelone.net", "")
89-
return instance.replace("https://", "").replace("http://", "")
88+
89+
# Remove leading and trailing whitespace
90+
instance = instance.strip()
91+
92+
# Remove the scheme if it exists
93+
if instance.startswith("http://"):
94+
instance = instance[7:]
95+
elif instance.startswith("https://"):
96+
instance = instance[8:]
97+
98+
# Remove the SentinelOne domain suffix
99+
if ".sentinelone.net" in instance:
100+
instance = instance.replace(".sentinelone.net", "")
101+
102+
# Remove any trailing slashes
103+
return instance.rstrip("/")
90104

91105

92106
class Helper:

plugins/sentinelone/plugin.spec.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extension: plugin
33
products: [insightconnect]
44
name: sentinelone
55
title: SentinelOne
6+
description: "[SentinelOne](https://www.sentinelone.com/) is a next-gen cybersecurity company focused on protecting the enterprise through the endpoint. The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne.\n\nThis plugin utilizes the SentinelOne API, the documentation is located in the SentinelOne console"
67
version: 11.1.3
78
connection_version: 10
89
cloud_ready: true
@@ -12,7 +13,6 @@ sdk:
1213
version: 6.2.2
1314
user: nobody
1415
supported_versions: ["2.1.0"]
15-
description: The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne
1616
vendor: rapid7
1717
support: rapid7
1818
status: []
@@ -43,7 +43,11 @@ references:
4343
- "[SentinelOne Product Page](https://www.sentinelone.com/)"
4444
requirements:
4545
- "SentinelOne API key"
46-
troubleshooting: "* To generate an API key, create a new Service User or select an existing one with adequate permissions from the SentinelOne console\n* To convert `threat` into an array use Type Converter Plugin\n* For the Trigger settings, only set the Resolved field to False if solely resolved threats should be retrieved (i.e. setting to False will not include unresolved threats)\n* The Run Remote Script action may require starting a protected actions session to function properly. To do this, in the `code` input field, enter the passcode from a third-party app, such as Duo Mobile or Google Authenticator, set up in two-factor authentication. Entering the code is not required each time you run the action, because the session is valid for 30 minutes"
46+
troubleshooting:
47+
- "To generate an API key, create a new Service User or select an existing one with adequate permissions from the SentinelOne console"
48+
- "To convert `threat` into an array use Type Converter Plugin"
49+
- "For the Trigger settings, only set the Resolved field to False if solely resolved threats should be retrieved (i.e. setting to False will not include unresolved threats)"
50+
- "The Run Remote Script action may require starting a protected actions session to function properly. To do this, in the `code` input field, enter the passcode from a third-party app, such as Duo Mobile or Google Authenticator, set up in two-factor authentication. Entering the code is not required each time you run the action, because the session is valid for 30 minutes"
4751
resources:
4852
source_url: https://github.com/rapid7/insightconnect-plugins/tree/master/plugins/sentinelone
4953
license_url: https://github.com/rapid7/insightconnect-plugins/blob/master/LICENSE
@@ -58,7 +62,7 @@ hub_tags:
5862
keywords: [sentinelone, endpoint, detection, cloud_enabled]
5963
features: []
6064
version_history:
61-
- "11.1.3 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities"
65+
- "11.1.3 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities | Fix issue with URL input validation"
6266
- "11.1.2 - Resolve issue where unexpected timestamps returned from SentinelOne were not parsed in task `Monitor Logs` | Update plugin to be FedRAMP compliant"
6367
- "11.1.1 - Updated Plugin connection to improve `instance` input usability"
6468
- "11.1.0 - Added connection test for task `Monitor Logs` | Update SDK"

plugins/sentinelone/setup.py

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

55
setup(name="sentinelone-rapid7-plugin",
66
version="11.1.3",
7-
description="The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne",
7+
description="[SentinelOne](https://www.sentinelone.com/) is a next-gen cybersecurity company focused on protecting the enterprise through the endpoint. The SentinelOne plugin allows you to manage and mitigate all your security operations through SentinelOne.This plugin utilizes the SentinelOne API, the documentation is located in the SentinelOne console.",
88
author="rapid7",
99
author_email="",
1010
url="",

0 commit comments

Comments
 (0)