Skip to content

Commit d414618

Browse files
committed
Common: Add AgentPluginManifest.remediation_suggestion
Issue #2857 PR #2871
1 parent c159349 commit d414618

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

monkey/common/agent_plugins/agent_plugin_manifest.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ class AgentPluginManifest(InfectionMonkeyBaseModel):
3030
)
3131
title: Optional[str]
3232
description: Optional[str]
33+
remediation_suggestion: Optional[str]
3334
link_to_documentation: Optional[str]
3435
safe: bool = False

monkey/tests/unit_tests/common/agent_plugins/test_agent_plugin_manifest.py

+11
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
FAKE_AGENT_MANIFEST_DICT_OUT: Dict[str, Any] = copy.deepcopy(FAKE_AGENT_MANIFEST_DICT_IN)
2626
FAKE_AGENT_MANIFEST_DICT_OUT["description"] = None
2727
FAKE_AGENT_MANIFEST_DICT_OUT["safe"] = False
28+
FAKE_AGENT_MANIFEST_DICT_OUT["remediation_suggestion"] = None
2829

2930
FAKE_AGENT_MANIFEST_DICT = {
3031
"name": FAKE_NAME,
@@ -81,3 +82,13 @@ def test_agent_plugin_manifest__invalid_name(name):
8182
title=FAKE_TITLE,
8283
link_to_documentation=FAKE_LINK,
8384
)
85+
86+
87+
def test_agent_plugin_manifest__remediation_suggestion():
88+
remediation_suggestion = "test remediation suggestion"
89+
agent_manifest_dict = FAKE_AGENT_MANIFEST_DICT.copy()
90+
agent_manifest_dict["remediation_suggestion"] = remediation_suggestion
91+
92+
agent_manifest_object = AgentPluginManifest(**agent_manifest_dict)
93+
94+
assert agent_manifest_object.remediation_suggestion == remediation_suggestion

monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_plugins.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_get_plugin(flask_client, agent_plugin_repository):
4141
"name": FAKE_NAME,
4242
"plugin_type": FAKE_TYPE,
4343
"safe": False,
44+
"remediation_suggestion": None,
4445
"supported_operating_systems": ["linux"],
4546
"title": "Remote Desktop Protocol exploiter",
4647
},

monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_plugins_manifest.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def test_get_plugin_manifest(flask_client, agent_plugin_repository):
3434
"name": "rdp_exploiter",
3535
"plugin_type": "Exploiter",
3636
"safe": False,
37+
"remediation_suggestion": None,
3738
"supported_operating_systems": ["linux"],
3839
"title": "Remote Desktop Protocol exploiter",
3940
}

vulture_allowlist.py

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
AgentPluginManifest.description
5151
AgentPluginManifest.link_to_documentation
5252
AgentPluginManifest.safe
53+
AgentPluginManifest.remediation_suggestion
5354
AgentPluginManifest.supported_operating_systems
5455

5556
# Unused, but kept for future potential

0 commit comments

Comments
 (0)