Fixed typo, pulled what appeared to be unused modules

This commit is contained in:
Driven-Element
2025-08-24 14:20:12 -04:00
parent bdf3d4b9ec
commit 6577d5f0e9
+8 -10
View File
@@ -20,11 +20,9 @@ import utils.allowlist
import utils.hashfunctions import utils.hashfunctions
import utils.pathfunctions import utils.pathfunctions
import utils.allowfunctions import utils.allowfunctions
import utils.colortext as ct
import urllib3 import urllib3
import pandas as pd import pandas as pd
import sqlite3
import pathlib
import utils.colortext as ct
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
dotenv.load_dotenv() dotenv.load_dotenv()
@@ -32,7 +30,7 @@ dotenv.load_dotenv()
url = "https://172.17.22.240:3129" url = "https://172.17.22.240:3129"
badpublisherlist = ["Brave Software, Inc.", "Zoom Video Communications, Inc."] badpublisherlist = ["Brave Software, Inc.", "Zoom Video Communications, Inc."]
path_exclusion_constant = 3 path_exclusion_constant = 3
treat_tolerance_constant = 4 threat_tolerance_constant = 4
@@ -56,16 +54,16 @@ def apivalidation():
def menu_main(): def menu_main():
while True: while True:
print(ct.colorText("\n-----------------------------------", "yellow")) print(ct.colorText("\n-----------------------------------", "white"))
print(ct.colorText("------------ Main Menu ------------", "yellow")) print(ct.colorText("------------ Main Menu ------------", "white"))
print(ct.colorText("-----------------------------------", "yellow")) print(ct.colorText("-----------------------------------", "white"))
print(ct.colorText("1. Get All Events for Single Device", "yellow")) print(ct.colorText("1. Get All Events for Single Device", "yellow"))
print(ct.colorText("2. Placeholder for Local Approval", "yellow")) print(ct.colorText("2. Placeholder for Local Approval", "yellow"))
print(ct.colorText("3. Placeholder for Another Tool", "yellow")) print(ct.colorText("3. Placeholder for Another Tool", "yellow"))
print(ct.colorText("4. Prepare Policy For Enforcement", "yellow")) print(ct.colorText("4. Prepare Policy For Enforcement", "yellow"))
print(ct.colorText("11. Exit", "yellow")) print(ct.colorText("11. Exit", "yellow"))
choice = input(ct.colorText("Enter Menu Item: ", "white")) choice = input(ct.colorText("\nEnter Menu Item: ", "white"))
if choice == '1': if choice == '1':
utils.getdeviceevents.devicehistory(url,False) utils.getdeviceevents.devicehistory(url,False)
elif choice == "2": elif choice == "2":
@@ -189,7 +187,7 @@ def menu_prepare_to_enforce():
print(ct.colorText("11. Exit", "cyan")) print(ct.colorText("11. Exit", "cyan"))
choice = input(ct.colorText("Enter your choice: ", "yellow")) choice = input(ct.colorText("\nEnter your choice: ", "white"))
if choice == "1": if choice == "1":
first_policy_tuple = utils.allowlist.listPolicies(url) first_policy_tuple = utils.allowlist.listPolicies(url)
first_policy = first_policy_tuple[1][first_policy_tuple[0]] first_policy = first_policy_tuple[1][first_policy_tuple[0]]
@@ -256,7 +254,7 @@ def menu_prepare_to_enforce():
elif choice == "6": elif choice == "6":
if os.path.exists(f"dataframe_csv\\df_path_ineligible_{first_policy}_{second_policy}.csv") == True and os.path.exists(f"dataframe_csv\\df_path_eligible_{first_policy}_{second_policy}.csv") == True: if os.path.exists(f"dataframe_csv\\df_path_ineligible_{first_policy}_{second_policy}.csv") == True and os.path.exists(f"dataframe_csv\\df_path_eligible_{first_policy}_{second_policy}.csv") == True:
categorized = utils.hashfunctions.categorizeHashes(pd.read_csv(f"dataframe_csv\\df_augmented_combo_{first_policy}_{second_policy}.csv"), treat_tolerance_constant, badpublisherlist) categorized = utils.hashfunctions.categorizeHashes(pd.read_csv(f"dataframe_csv\\df_augmented_combo_{first_policy}_{second_policy}.csv"), threat_tolerance_constant, badpublisherlist)
categorized[0].to_html(f"dataframe_html\\df_hashes_needing_approval_{first_policy}_{second_policy}.html", index=False) categorized[0].to_html(f"dataframe_html\\df_hashes_needing_approval_{first_policy}_{second_policy}.html", index=False)
categorized[0].to_csv(f"dataframe_csv\\df_hashes_needing_approval_{first_policy}_{second_policy}.csv", index=False) categorized[0].to_csv(f"dataframe_csv\\df_hashes_needing_approval_{first_policy}_{second_policy}.csv", index=False)
categorized[1].to_html(f"dataframe_html\\df_automatically_approved_hashes_{first_policy}_{second_policy}.html", index=False) categorized[1].to_html(f"dataframe_html\\df_automatically_approved_hashes_{first_policy}_{second_policy}.html", index=False)