duosecurity / duo_client_python

Python library for interacting with the Duo Auth, Admin, and Accounts APIs
https://duo.com/docs/
Other
136 stars 136 forks source link

add get auth summary endpoint to the admin object #268

Open ClovisIRex opened 5 months ago

ClovisIRex commented 5 months ago

Detailed Description

there is an auth summary page in the app that provides general summary of all denied/granted requests across a time range. the API endpoint is /reports/auth-summary. it seems it does not exist in the client nor in the documentation.

Use Case

We need that data in order to produce automated reports with a in-house tool. instead of gathering 100's of thousands or even millions of data from other endpoints and summating it we would rather use that endpoint

Workarounds

Im trying to extend the Admin class with a method but getting 301 moved permanently error code:

from duo_client import Admin

class Extended_duo_client(Admin):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def get_auth_summary(self):
        params = {}
        response = self.json_api_call(
            'GET',
            '/reports/auth-summary',
            params
        ) 

        return response
MarkTripod-Duo commented 3 months ago

@ClovisIRex The/reports URL accessible via the Duo Admin Panel does not exist as an API endpoint. Making the /reports/auth-summary information available via the API would be new/expanded functionality.