Skip to content

Commit

Permalink
PLGN-633: add exception logging and bump SDK. (#2184) (#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
joneill-r7 authored Dec 15, 2023
1 parent 85b4fd4 commit 0ab1e95
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions plugins/duo_admin/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"spec": "af7f5046784c4bd506fbbc797d403782",
"manifest": "9aa65831ac901c7273abd96248e1a709",
"setup": "f61170938f3b53095c861c44ae7ee7e7",
"spec": "0e194226a0a67c2991b7ebe933c04179",
"manifest": "12bfb11fd6e00d799e9313f4ecb798d8",
"setup": "1a27dce355f442c87d53c0de3639fd11",
"schemas": [
{
"identifier": "add_user/schema.py",
Expand Down Expand Up @@ -49,7 +49,7 @@
},
{
"identifier": "monitor_logs/schema.py",
"hash": "ff4f7adf6cbae20cd793af79e763a06d"
"hash": "dfdca5153b3d9ee8fe8a20fdb5ad4e59"
}
]
}
4 changes: 2 additions & 2 deletions plugins/duo_admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/duo_admin/bin/komand_duo_admin
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
1 change: 1 addition & 0 deletions plugins/duo_admin/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions plugins/duo_admin/komand_duo_admin/tasks/monitor_logs/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = []
Expand Down
2 changes: 1 addition & 1 deletion plugins/duo_admin/plugin.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/duo_admin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="",
Expand Down

0 comments on commit 0ab1e95

Please sign in to comment.