TheHive4py
TheHive4py copied to clipboard
[Bug] New TheHive 4 Permissions not displayed under get_current_user
[Bug] New TheHive 4 Permissions not displayed under get_current_user()
Request Type
Bug
Work Environment
Question | Answer |
---|---|
TheHive4py version | pip version 1.6.0 |
Problem Description
TheHive4 introduced more verbose RBAC. These permissions should be displayed under the current user payload's roles
key, but they still display the old information.
Steps to Reproduce
-
Create acct with new permissions, ex: Screenshot in Complimentary Info
-
Create API token
-
Configure attached PoC script with URL, token and Organi{z,s}ation
-
Observe output will contain some combination of
Permissions: ['write', 'read', 'alert']
Possible Solutions
This is probably something to fix under TheHive, I'll xpost there as well.
Complementary information
Screenshot:
PoC Script:
from thehive4py.api import TheHiveApi
url = "<url>"
token = "<token>"
organisation = "<organisation>"
api = TheHiveApi(
url,
token,
organisation=organisation,
cert=False
)
user = (api.get_current_user()).json()
if user['status'] == 'Ok':
print("Username:" + user['login'])
print("Permissions: " + str(user['roles']))