Commiting before rebase

This commit is contained in:
brotoskyj
2025-08-28 11:32:02 -04:00
+24
View File
@@ -384,6 +384,30 @@ def menu_prepare_to_enforce():
print(ct.colorText(f"Please manually approve suggested paths prior to this step","red")) print(ct.colorText(f"Please manually approve suggested paths prior to this step","red"))
approved_set = set([tuple(map(tuple, row)) for row in df_approved.values])
# Identify rows in eligible that are not in approved
not_approved_rows = df_eligible[~df_eligible.apply(lambda row: tuple(map(tuple, row)) in approved_set, axis=1)]
# Append these rows to ineligible
df_ineligible= pd.concat([df_ineligible, not_approved_rows], ignore_index=True)
df_approved.to_csv(f"preflight\\Approved_Path_Exclusions_{first_policy}_{second_policy}.csv")
ct.style_dataframe_dark(df_approved, f"preflight\\Approved_Path_Exclusions_{first_policy}_{second_policy}.html")
#Seperate out what we arent excluding by path into those that will go into the baseline, and those that will b added to the child.
df_addtobaseline = df_ineligible[df_ineligible['reputation status'] == 'KNOWN']
df_addtobaseline.to_csv(f"preflight\\Add_to_Baseline_{first_policy}_{second_policy}.csv", index=False)
ct.style_dataframe_dark(df_addtobaseline, f"preflight\\Add_to_Baseline_{first_policy}_{second_policy}.html")
df_addtochildpolicy = df_ineligible[df_ineligible['reputation status'] == 'UNKNOWN']
df_addtochildpolicy.to_csv(f"preflight\\Add_to_Child_Policy_{first_policy}_{second_policy}.csv", index=False)
ct.style_dataframe_dark(df_addtochildpolicy, f"preflight\\Add_to_Child_Policy_{first_policy}_{second_policy}.html")
else:
print(ct.colorText(f"Please manually approve suggested paths prior to this step","red"))
allowbyhash.to_csv(f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.csv", index=False) allowbyhash.to_csv(f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.csv", index=False)
ct.style_dataframe_dark(allowbyhash, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html") ct.style_dataframe_dark(allowbyhash, f"preflight\\final_hash_approvals_{first_policy}_{second_policy}.html")