Pretty HTML and beginnings of Destination Policy
This commit is contained in:
@@ -125,3 +125,19 @@ def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publ
|
||||
unapproved_df = df[~(mask_needsreview | mask_approved)]
|
||||
|
||||
return needsreview_df, approved_df, unapproved_df
|
||||
|
||||
def destinationbuilder(df, df2):
|
||||
# Step 1: Explode the 'sha256' list in df2 to create one row per sha256 value
|
||||
df_expanded = df.explode('sha256')
|
||||
|
||||
# Step 2: Create a new dataframe for the result
|
||||
df_hashdestination = df_expanded.copy()
|
||||
|
||||
# Step 3: Populate the 'Destination Allowlist' column based on comparison with df3
|
||||
df_hashdestination['Destination Allowlist'] = df_hashdestination['sha256'].apply(
|
||||
lambda x: 'Parent Policy Baseline' if x in df2['sha256'].values else "Destination Policy Allowlist"
|
||||
)
|
||||
|
||||
# Step 4: Return the new dataframe
|
||||
return df_hashdestination
|
||||
|
||||
|
||||
Reference in New Issue
Block a user