Added bad publishers round 1

This commit is contained in:
=
2025-08-21 17:59:47 -04:00
parent 225e5e406e
commit 55e1f3f91e
3 changed files with 9 additions and 360 deletions
+2 -2
View File
@@ -79,13 +79,13 @@ def menu():
path_eligible.to_html("EligblePaths.html", index=False) path_eligible.to_html("EligblePaths.html", index=False)
path_ineligible.to_html("IneligiblePaths.html",index=False) path_ineligible.to_html("IneligiblePaths.html",index=False)
badpublisherlist = [] badpublisherlist = ["Brave Software, Inc.", "Zoom Video Communications, Inc."]
categorized = utils.hashfunctions.categorizeHashes(augmented, 5, badpublisherlist) categorized = utils.hashfunctions.categorizeHashes(augmented, 5, badpublisherlist)
categorized[0].to_html("needsreview.html", index=False) categorized[0].to_html("needsreview.html", index=False)
categorized[1].to_html("approved.html", index=False) categorized[1].to_html("approved.html", index=False)
categorized[2].to_html("remaining.html", index=False) categorized[2].to_html("remaining.html", index=False)
allowpaths = utils.allowfunctions.filter_and_drop(categorized[1],path_eligible,2) allowpaths = utils.allowfunctions.filter_and_drop(categorized[1],path_eligible,4)
allowpaths.to_html("AllowedPaths.html", index=False) allowpaths.to_html("AllowedPaths.html", index=False)
-356
View File
File diff suppressed because one or more lines are too long
+7 -2
View File
@@ -87,10 +87,15 @@ def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publ
mask_needsreview = (df["publisher_y"] == "Not Signed") & df.apply(lambda row: reputationtool(row, threat_tolerance), axis=1) mask_needsreview = (df["publisher_y"] == "Not Signed") & df.apply(lambda row: reputationtool(row, threat_tolerance), axis=1)
mask_approved = ( mask_approved = (
((df["publisher_y"] != "Not Signed") & (~df["publisher_y"].isin(untrusted_publishers))) | ((df["publisher_y"] != "Not Signed") & (~df["publisher_y"].isin(untrusted_publishers))) &
((df["publisher_y"] == "Not Signed") & (~df.apply(lambda row: reputationtool(row, threat_tolerance), axis=1))) (df["publisher_y"] != "Not Signed") # explicitly signed
) | (
(df["publisher_y"] == "Not Signed") &
(~df.apply(lambda row: reputationtool(row, threat_tolerance), axis=1)) &
(~df["publisher_y"].isin(untrusted_publishers)) # exclude untrusted even if unsigned
) )
needsreview_df = df[mask_needsreview] needsreview_df = df[mask_needsreview]
approved_df = df[mask_approved] approved_df = df[mask_approved]
remaining_df = df[~(mask_needsreview | mask_approved)] remaining_df = df[~(mask_needsreview | mask_approved)]