Skip to content

[PLGN-611] Duo Admin Task Handle 403 errors and allow configuration of event and log gathering #2100

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

Merged
merged 14 commits into from
Nov 7, 2023

Conversation

dlaverty-r7
Copy link
Collaborator

@dlaverty-r7 dlaverty-r7 commented Nov 6, 2023

Proposed Changes

Description

Background and Solution
Currently the Duo Admin task assume that the user has access to admin logs and trust monitor events. However this will depend on the level of licensing. If a 403 error is received from either of these endpoints, an error should be logged and then continue on to gather data which they have access to e.g. auth logs.
Also add in boolean task inputs so that the UI can be updated to allow the collection of trust monitor events and admin logs to be configurable. This has been coded so that these default to True currently so that the code will function as normal until the UI is updated.

Testing
Tested locally using Postman calls against the task with and without task inputs for the collect logs and events. Mocked the 403 failures by changing out error code looked for to a 401 and ensuring correct behaviour (unable to reproduce the 403 as we have the level of license required to get all the events and logs).

NOTE: Unit tests outside of the task ones needed to be updated as the response returned is handled based on whether it is a Response instance.

@dlaverty-r7 dlaverty-r7 added the Work in Progress 🚧 PR is in progress label Nov 6, 2023
@dlaverty-r7 dlaverty-r7 self-assigned this Nov 6, 2023
@dlaverty-r7 dlaverty-r7 force-pushed the PLGN-611-handle-403-errors branch from 22612f0 to df893f9 Compare November 7, 2023 13:08
@dlaverty-r7 dlaverty-r7 force-pushed the PLGN-611-handle-403-errors branch from 895703b to 9c3505f Compare November 7, 2023 14:30
@igorski-r7 igorski-r7 merged commit b0f0c9b into develop Nov 7, 2023
@igorski-r7 igorski-r7 deleted the PLGN-611-handle-403-errors branch November 7, 2023 15:58
igorski-r7 pushed a commit that referenced this pull request Nov 9, 2023
…f event and log gathering (#2100)

* Adding in handling for task 403 errors

* Adding in handling for task 403 errors

* Removed unnecessary debug

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Reverted unnecessary changes to help.md

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Updated linting

* Updated unit tests due to change in response handling for task 403

* Removed unnecessary pylint ignore statement

* Update task inputs and outputs in help.md file

---------

Co-authored-by: Dympna Laverty <dympna_laverty@rapid7.com>
dlaverty-r7 added a commit that referenced this pull request Nov 9, 2023
…f event and log gathering (#2100)

* Adding in handling for task 403 errors

* Adding in handling for task 403 errors

* Removed unnecessary debug

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Reverted unnecessary changes to help.md

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Updated linting

* Updated unit tests due to change in response handling for task 403

* Removed unnecessary pylint ignore statement

* Update task inputs and outputs in help.md file

---------

Co-authored-by: Dympna Laverty <dympna_laverty@rapid7.com>
igorski-r7 pushed a commit that referenced this pull request Nov 10, 2023
…f event and log gathering (#2100) (#2107)

* Adding in handling for task 403 errors

* Removed unnecessary debug

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Updated to allow optional collection of events and logs for task

* Reverted unnecessary changes to help.md

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Fixed return code check for 403 in task

* Updated linting

* Updated unit tests due to change in response handling for task 403

* Removed unnecessary pylint ignore statement

* Update task inputs and outputs in help.md file

---------

Co-authored-by: Dympna Laverty <dympna_laverty@rapid7.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants