From 0ab1e953c7fdcce08589976eea7a4b8b782b9cc1 Mon Sep 17 00:00:00 2001 From: Johnny O'Neill <139136675+joneill-r7@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:11:43 +0000 Subject: [PATCH] PLGN-633: add exception logging and bump SDK. (#2184) (#2188) --- plugins/duo_admin/.CHECKSUM | 8 ++++---- plugins/duo_admin/Dockerfile | 4 ++-- plugins/duo_admin/bin/komand_duo_admin | 2 +- plugins/duo_admin/help.md | 1 + .../duo_admin/komand_duo_admin/tasks/monitor_logs/task.py | 2 ++ plugins/duo_admin/plugin.spec.yaml | 2 +- plugins/duo_admin/setup.py | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/duo_admin/.CHECKSUM b/plugins/duo_admin/.CHECKSUM index c4808929c9..65d68a5ed5 100644 --- a/plugins/duo_admin/.CHECKSUM +++ b/plugins/duo_admin/.CHECKSUM @@ -1,7 +1,7 @@ { - "spec": "af7f5046784c4bd506fbbc797d403782", - "manifest": "9aa65831ac901c7273abd96248e1a709", - "setup": "f61170938f3b53095c861c44ae7ee7e7", + "spec": "0e194226a0a67c2991b7ebe933c04179", + "manifest": "12bfb11fd6e00d799e9313f4ecb798d8", + "setup": "1a27dce355f442c87d53c0de3639fd11", "schemas": [ { "identifier": "add_user/schema.py", @@ -49,7 +49,7 @@ }, { "identifier": "monitor_logs/schema.py", - "hash": "ff4f7adf6cbae20cd793af79e763a06d" + "hash": "dfdca5153b3d9ee8fe8a20fdb5ad4e59" } ] } \ No newline at end of file diff --git a/plugins/duo_admin/Dockerfile b/plugins/duo_admin/Dockerfile index 9dde58a40f..ff09a6a633 100644 --- a/plugins/duo_admin/Dockerfile +++ b/plugins/duo_admin/Dockerfile @@ -1,4 +1,4 @@ -FROM rapid7/insightconnect-python-3-38-plugin:5 +FROM --platform=linux/amd64 rapid7/insightconnect-python-3-plugin:5 LABEL organization=rapid7 LABEL sdk=python @@ -12,7 +12,7 @@ RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi ADD . /python/src -RUN python setup.py build && python setup.py install +RUN python setup.py build && python setup.py install # User to run plugin code. The two supported users are: root, nobody USER nobody diff --git a/plugins/duo_admin/bin/komand_duo_admin b/plugins/duo_admin/bin/komand_duo_admin index e902f3b7dd..99cb928a0b 100755 --- a/plugins/duo_admin/bin/komand_duo_admin +++ b/plugins/duo_admin/bin/komand_duo_admin @@ -6,7 +6,7 @@ from sys import argv Name = "Duo Admin API" Vendor = "rapid7" -Version = "4.3.0" +Version = "4.3.1" Description = "Duo is a trusted access solution for organizations. The Duo Admin plugin for Rapid7 InsightConnect allows users to manage and administrate their Duo organization" diff --git a/plugins/duo_admin/help.md b/plugins/duo_admin/help.md index 420e003d27..01e508b3f1 100644 --- a/plugins/duo_admin/help.md +++ b/plugins/duo_admin/help.md @@ -1033,6 +1033,7 @@ A User ID can be obtained by passing a username to the Get User Status action. # Version History +* 4.3.1 - Monitor Logs task: Added exception logging and use latest plugin SDK (`5.3.1`). * 4.3.0 - Monitor Logs task: Added inputs for collecting events and logs. Updated 403 error handling * 4.2.2 - Monitor Logs task: updated unit tests * 4.2.1 - Monitor Logs task: updated timestamp handling diff --git a/plugins/duo_admin/komand_duo_admin/tasks/monitor_logs/task.py b/plugins/duo_admin/komand_duo_admin/tasks/monitor_logs/task.py index 131d4db1c4..527738844b 100755 --- a/plugins/duo_admin/komand_duo_admin/tasks/monitor_logs/task.py +++ b/plugins/duo_admin/komand_duo_admin/tasks/monitor_logs/task.py @@ -241,11 +241,13 @@ def run(self, params={}, state={}): # noqa: C901 return new_logs, state, has_more_pages, 200, None except ApiException as error: + self.logger.info(f"An API Exception has been raised. Status code: {error.status_code}. Error: {error}") state[self.PREVIOUS_TRUST_MONITOR_EVENT_HASHES] = [] state[self.PREVIOUS_ADMIN_LOG_HASHES] = [] state[self.PREVIOUS_AUTH_LOG_HASHES] = [] return [], state, False, error.status_code, error except Exception as error: + self.logger.info(f"An Exception has been raised. Error: {error}") state[self.PREVIOUS_TRUST_MONITOR_EVENT_HASHES] = [] state[self.PREVIOUS_ADMIN_LOG_HASHES] = [] state[self.PREVIOUS_AUTH_LOG_HASHES] = [] diff --git a/plugins/duo_admin/plugin.spec.yaml b/plugins/duo_admin/plugin.spec.yaml index 3583309a13..c0a347e57f 100644 --- a/plugins/duo_admin/plugin.spec.yaml +++ b/plugins/duo_admin/plugin.spec.yaml @@ -13,7 +13,7 @@ sdk: version: 5 user: nobody description: Duo is a trusted access solution for organizations. The Duo Admin plugin for Rapid7 InsightConnect allows users to manage and administrate their Duo organization -version: 4.3.0 +version: 4.3.1 connection_version: 4 resources: source_url: https://github.com/rapid7/insightconnect-plugins/tree/master/plugins/duo_admin diff --git a/plugins/duo_admin/setup.py b/plugins/duo_admin/setup.py index 0b531faaa5..8436f0407d 100644 --- a/plugins/duo_admin/setup.py +++ b/plugins/duo_admin/setup.py @@ -3,7 +3,7 @@ setup(name="duo_admin-rapid7-plugin", - version="4.3.0", + version="4.3.1", description="Duo is a trusted access solution for organizations. The Duo Admin plugin for Rapid7 InsightConnect allows users to manage and administrate their Duo organization", author="rapid7", author_email="",