Added GetDestAllowlistFromClientID
This commit is contained in:
@@ -58,7 +58,6 @@ def main():
|
||||
apivalidation()
|
||||
print(f"Running non-interactively to start monitoring OTP")
|
||||
|
||||
utils.clientfunctions.getClientsPolicy(url)
|
||||
|
||||
# Process input here
|
||||
else:
|
||||
|
||||
@@ -5,7 +5,9 @@ import pandas as pd
|
||||
import utils.pretty as ct
|
||||
|
||||
|
||||
def getClientsPolicy(url, clientid="0dcddaf3-d017-4ced-9227-ceeca3117286"):
|
||||
def getDestAllowlistFromClientID(url, clientid="0dcddaf3-d017-4ced-9227-ceeca3117286"):
|
||||
|
||||
#This is dependant on their being an allowlist in the policy with the same name as the policy
|
||||
|
||||
endpoint = url + '/v1/agent/find'
|
||||
payload = {
|
||||
@@ -22,12 +24,12 @@ def getClientsPolicy(url, clientid="0dcddaf3-d017-4ced-9227-ceeca3117286"):
|
||||
|
||||
policyname = getPolicyName(url,data.loc[0, "groupid"])
|
||||
allowlists = getPolicyAllowlists(url,data.loc[0, "groupid"])
|
||||
allowlists = allowlists['name'].tolist()
|
||||
print(policyname)
|
||||
print(allowlists)
|
||||
|
||||
app_id = allowlists.loc[allowlists['name'] == f'{policyname}', 'applicationid'].values[0]
|
||||
|
||||
return app_id
|
||||
|
||||
|
||||
|
||||
def getPolicyAllowlists(url, groupid):
|
||||
|
||||
endpoint = url + '/v1/group/policies'
|
||||
|
||||
Reference in New Issue
Block a user