Continued Troubleshooting cases where HTML has empty table

This commit is contained in:
=
2025-08-22 13:18:52 -04:00
parent ae97d04097
commit e2398c687b
+17 -19
View File
@@ -92,16 +92,13 @@ def menu_feature2():
print("Invalid choice. Please try again.") print("Invalid choice. Please try again.")
def menu_prepare_to_enforce(): def menu_prepare_to_enforce():
first_policy = ["",""] history_pol1_staged = True
second_policy = ["",""] history_pol2_staged = True
policylist = first_policy[1] history_staged = True
history_pol1_staged = False hashes_threat_pulled = True
history_pol2_staged = False hashes_categorized = True
history_staged = False path_exclusions_calculated = True
hashes_threat_pulled = False allowed_paths_determined = True
hashes_categorized = False
path_exclusions_calculated = False
allowed_paths_determined = False
df_aggregated_combo = pd.DataFrame() df_aggregated_combo = pd.DataFrame()
while True: while True:
@@ -121,23 +118,24 @@ def menu_prepare_to_enforce():
choice = input("Enter your choice: ") choice = input("Enter your choice: ")
if choice == "1": if choice == "1":
first_policy = utils.allowlist.listPolicies(url) first_policy_tuple = utils.allowlist.listPolicies(url)
first_policy = first_policy_tuple[1][first_policy_tuple[0]]
elif choice == "2": elif choice == "2":
second_policy = utils.allowlist.listPolicies(url) second_policy_tuple = utils.allowlist.listPolicies(url)
second_policy = second_policy_tuple[1][second_policy_tuple[0]]
elif choice == "3": elif choice == "3":
executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy, first_policy,True) executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy_tuple[0], first_policy_tuple[1],True)
df_aggregated_policy1 = utils.hashfunctions.aggregateHashes(executionhist_policy1) df_aggregated_policy1 = utils.hashfunctions.aggregateHashes(executionhist_policy1)
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2) df_aggregated_policy1.to_html(f"df_aggregated_{first_policy}.html", index=False)
df_aggregated_combo= pd.concat([df_aggregated_policy1, df_aggregated_policy2], ignore_index=True) history_pol1_staged =True
df_aggregated_combo.to_html(f"df_aggregated_combo_{first_policy[1][first_policy[0]]}_{second_policy[1][second_policy[0]]}.html", index=False)
history_staged = True
elif choice == "4": elif choice == "4":
executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy, second_policy,True) executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy_tuple[0], second_policy_tuple[1],True)
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2) df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2)
df_aggregated_policy2.to_html(f"df_aggregated_{second_policy}.html") df_aggregated_policy2.to_html(f"df_aggregated_{second_policy}.html", index=False)
history_pol2_staged =True history_pol2_staged =True
elif choice == "5": elif choice == "5":