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