Files
AirlockTools/AirlockTools.py
T
2025-08-20 15:04:57 -04:00

40 lines
1009 B
Python

import dotenv
import os
import utils.getdeviceevents
import utils.allowlist
import utils.hashfunctions
import urllib3
import pandas as pd
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
dotenv.load_dotenv()
url = "https://172.17.22.240:3129"
def apivalidation():
print("=== Welcome to the Airlock API Tool ===")
match os.getenv('APIKEY'):
case '':
print("Please add your API Key to the .env file")
case _:
menu()
def menu():
print("\n--- Main Menu ---")
print("1. Get All Events for Single Device")
print("2. Get Execution Histories for Allow List")
while True:
choice = input("Enter Menu Item: ")
if choice == '1':
utils.getdeviceevents.devicehistory(url,False)
if choice == '2':
utils.allowlist.allowlistexechistories(url,False)
if choice == '3':
executionhist = utils.allowlist.allowlistexechistories(url,True)
aggregated = utils.hashfunctions.aggregateHashes(executionhist)
print(aggregated)
if __name__ == "__main__":
apivalidation()