Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SentinelOneV2 #31687

Merged
merged 3 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions Packs/SentinelOne/Integrations/SentinelOne-V2/SentinelOne-V2.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,23 @@ def run_remote_script_request(self,
"requiresApproval": requires_approval
}
}
payload["data"] = self.remove_empty_fields(payload.get("data", {}))
response = self._http_request(method='POST', url_suffix=endpoint_url, json_data=payload)
return response.get('data', {})

def remove_empty_fields(self, json_payload):
"""
Removes empty fields from a JSON payload and returns a new JSON object with non-empty fields.

Parameters:
- json_payload (dict): The input JSON payload.

Returns:
- dict: A new JSON object containing only non-empty fields.
"""
# Returning updated dictionary with non-empty fields
return {key: value for key, value in json_payload.items() if str(value)}


''' COMMANDS + REQUESTS FUNCTIONS '''

Expand Down
6 changes: 6 additions & 0 deletions Packs/SentinelOne/ReleaseNotes/3_2_15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### SentinelOne v2

Fixed bug for the ***sentinelone-run-remote-script*** command, removing the empty values from the payload of an API call.
2 changes: 1 addition & 1 deletion Packs/SentinelOne/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "SentinelOne",
"description": "Endpoint protection",
"support": "partner",
"currentVersion": "3.2.14",
"currentVersion": "3.2.15",
"author": "SentinelOne",
"url": "https://www.sentinelone.com/support/",
"email": "support@sentinelone.com",
Expand Down