Added GetDestAllowlistFromClientID

This commit is contained in:
=
2025-09-09 17:06:38 -04:00
parent 11b2d255b6
commit f09bb5ff62
2 changed files with 7 additions and 6 deletions
+7 -5
View File
@@ -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'