Think i fixed the signed package issue

This commit is contained in:
=
2025-08-22 16:19:59 -04:00
parent 786c72c5cd
commit ab6ee644c7
2 changed files with 18 additions and 6 deletions
+17 -5
View File
@@ -78,19 +78,31 @@ def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publ
def reputationtool(row):
val = row["reputation_scannermatch"]
if pd.isna(val) or val == "N/A":
return True if row["publisher_y"] == "Not Signed" else False
return row["publisher_y"] == "Not Signed"
try:
return int(val) > threat_tolerance
except (ValueError, TypeError):
return True if row["publisher_y"] == "Not Signed" else False
return row["publisher_y"] == "Not Signed"
df["reputation_flag"] = df.apply(reputationtool, axis=1)
mask_needsreview = (df["publisher_y"] == "Not Signed") & df["reputation_flag"]
mask_needsreview = (
((df["publisher_y"] == "Not Signed") & df["reputation_flag"]) |
(df["reputation_status"] == "UNKNOWN")
)
mask_approved = (
((df["publisher_y"] != "Not Signed") & ~df["publisher_y"].isin(untrusted_publishers)) |
((df["publisher_y"] == "Not Signed") & ~df["reputation_flag"] & ~df["publisher_y"].isin(untrusted_publishers))
(
(df["publisher_y"] != "Not Signed") &
~df["publisher_y"].isin(untrusted_publishers) &
~df["reputation_status"].isna()
) |
(
(df["publisher_y"] == "Not Signed") &
~df["reputation_flag"] &
~df["publisher_y"].isin(untrusted_publishers) &
~df["reputation_status"].isna()
)
)
needsreview_df = df[mask_needsreview]