From f09bb5ff62831971384b74fbbeaae6f0c9cf5fe3 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 9 Sep 2025 17:06:38 -0400 Subject: [PATCH] Added GetDestAllowlistFromClientID --- AirlockTools.py | 1 - utils/clientfunctions.py | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/AirlockTools.py b/AirlockTools.py index 2615096..f1bbb3d 100644 --- a/AirlockTools.py +++ b/AirlockTools.py @@ -58,7 +58,6 @@ def main(): apivalidation() print(f"Running non-interactively to start monitoring OTP") - utils.clientfunctions.getClientsPolicy(url) # Process input here else: diff --git a/utils/clientfunctions.py b/utils/clientfunctions.py index 32c009c..69feafd 100644 --- a/utils/clientfunctions.py +++ b/utils/clientfunctions.py @@ -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'