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

[SOAR-18367] Updating Get Agent Details action (SI) #2984

Merged
merged 2 commits into from
Dec 6, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/rapid7_insight_agent/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"spec": "f59d87215ea0009e75b43538d52e2546",
"manifest": "681189443bca37d2d249637d7a37d0a0",
"setup": "f3957c38946f523d42c3e0f39d443645",
"spec": "84beb2a66c2d69fe169e28ef52286a6b",
"manifest": "7128ea302016efb7c4e1b205f30ddc63",
"setup": "9342d20648410079f107ce3d1bcd8d17",
"schemas": [
{
"identifier": "check_agent_status/schema.py",
Expand Down
2 changes: 1 addition & 1 deletion plugins/rapid7_insight_agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.1.0
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.2.2

LABEL organization=rapid7
LABEL sdk=python
Expand Down
2 changes: 1 addition & 1 deletion plugins/rapid7_insight_agent/bin/icon_rapid7_insight_agent
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from sys import argv

Name = "Rapid7 Insight Agent"
Vendor = "rapid7"
Version = "3.0.0"
Version = "3.0.1"
Description = "Using the Insight Agent plugin from InsightConnect, you can quarantine, unquarantine and monitor potentially malicious IPs, addresses, hostnames, and devices across your organization"


Expand Down
1 change: 1 addition & 0 deletions plugins/rapid7_insight_agent/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ If the actions `Get Agent Details` and `Get All Agents by IP` return a `next cur

# Version History

* 3.0.1 - Update 'Get Agent Details' to allow no assets to be returned | SDK bump to latest version
* 3.0.0 - Update `Get Agent Details` and `Get All Agents by IP` to return the next page token if more pages are available to search | Update `Get Agent Details` to return agent location details | Initial updates for fedramp compliance | Updated SDK to the latest version
* 2.1.2 - Improve logging | Update SDK
* 2.1.1 - `Get All Agents by IP Address`: Fixed issue where action failed when agent did not have a primary address, and extended output to include agent location details | `Get Agent Details`: Extended output to include agent's public IP address and location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,8 @@ def _get_agent(self, agent_input: str, agent_type: str, next_cursor: str = None)
if agent:
return agent, None
else:
raise PluginException(
cause=f"Could not find agent matching {agent_input} of type {agent_type}. No more pages of data.",
assistance="Check the agent input value and try again.",
)
self.logger.info("No assets were found")
return None, None

def _get_agents(self, agents_input: List[str]) -> [Tuple[str, dict]]:
"""
Expand Down
5 changes: 3 additions & 2 deletions plugins/rapid7_insight_agent/plugin.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products: [insightconnect]
name: rapid7_insight_agent
title: Rapid7 Insight Agent
description: Using the Insight Agent plugin from InsightConnect, you can quarantine, unquarantine and monitor potentially malicious IPs, addresses, hostnames, and devices across your organization
version: 3.0.0
version: 3.0.1
connection_version: 2
supported_versions: ["Rapid7 Insight Agent 2024-08-23"]
vendor: rapid7
Expand All @@ -14,7 +14,7 @@ cloud_ready: true
fedramp_ready: true
sdk:
type: slim
version: 6.1.0
version: 6.2.2
user: nobody
key_features:
- "The agent is used by [Rapid7 InsightIDR](https://www.rapid7.com/products/insightidr/) and [InsightVM](https://www.rapid7.com/products/insightvm/) customers to monitor endpoints."
Expand All @@ -27,6 +27,7 @@ links:
references:
- "[Manage Platform API Keys](https://docs.rapid7.com/insight/managing-platform-api-keys/)"
version_history:
- "3.0.1 - Update 'Get Agent Details' to allow no assets to be returned | SDK bump to latest version"
- "3.0.0 - Update `Get Agent Details` and `Get All Agents by IP` to return the next page token if more pages are available to search | Update `Get Agent Details` to return agent location details | Initial updates for fedramp compliance | Updated SDK to the latest version"
- "2.1.2 - Improve logging | Update SDK"
- "2.1.1 - `Get All Agents by IP Address`: Fixed issue where action failed when agent did not have a primary address, and extended output to include agent location details | `Get Agent Details`: Extended output to include agent's public IP address and location"
Expand Down
2 changes: 1 addition & 1 deletion plugins/rapid7_insight_agent/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


setup(name="rapid7_insight_agent-rapid7-plugin",
version="3.0.0",
version="3.0.1",
description="Using the Insight Agent plugin from InsightConnect, you can quarantine, unquarantine and monitor potentially malicious IPs, addresses, hostnames, and devices across your organization",
author="rapid7",
author_email="",
Expand Down
14 changes: 4 additions & 10 deletions plugins/rapid7_insight_agent/unit_test/test_get_agent_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ def test_get_agent_details(self, mock_request: MagicMock, name: str, agent: str,
self.assertEqual(expect, actual)

def test_get_agent_by_hostname_bad(self, mock_request: MagicMock) -> None:
with self.assertRaises(PluginException) as exception:
action = Util.default_connector(GetAgentDetails())
action.run({Input.AGENT: "badID"})
self.assertEqual(
exception.exception.cause, "Could not find agent matching badID of type Host Name. No more pages of data."
)
self.assertEqual(
exception.exception.assistance,
"Check the agent input value and try again.",
)
action = Util.default_connector(GetAgentDetails())
actual = action.run({Input.AGENT: "badID"})
expected = {}
self.assertEqual(actual, expected)
Loading