Dropped Extraneous Columns on Augmented Dataframe, added z_ to html filenames, to drop them to the bottom of the file lists for QOL

This commit is contained in:
Driven-Element
2025-08-21 19:55:16 -04:00
parent 5d4a52c2f0
commit 45594abea5
2 changed files with 17 additions and 17 deletions
+15 -15
View File
@@ -41,23 +41,23 @@ def menu():
augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated) augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated)
print(augmented) print(augmented)
augmented.to_html("augmentedlist.html", index=False) augmented.to_html("z_augmented_list.html", index=False)
badpublisherlist = [] badpublisherlist = []
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("z_needs_review.html", index=False)
categorized[1].to_html("approved.html", index=False) categorized[1].to_html("z_approved_hashes.html", index=False)
categorized[2].to_html("remaining.html", index=False) categorized[2].to_html("z_remaining.html", index=False)
if choice == '4': if choice == '4':
html_file = "augmentedlist.html" html_file = "z_augmented_list.html"
augmented_df = pd.read_html(html_file) augmented_df = pd.read_html(html_file)
print(augmented_df) print(augmented_df)
combined_df = pd.concat(augmented_df, ignore_index=True) combined_df = pd.concat(augmented_df, ignore_index=True)
path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df) path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df)
path_eligible.to_html("EligblePaths.html", index=False) path_eligible.to_html("z_eligble_paths.html", index=False)
path_ineligible.to_html("IneligiblePaths.html",index=False) path_ineligible.to_html("z_ineligible_paths.html",index=False)
if choice == '5': if choice == '5':
@@ -70,23 +70,23 @@ def menu():
augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated) augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated)
print(augmented) print(augmented)
augmented.to_html("augmentedlist.html", index=False) augmented.to_html("z_augmented_list.html", index=False)
html_file = "augmentedlist.html" html_file = "z_augmented_list.html"
augmented_df = pd.read_html(html_file) augmented_df = pd.read_html(html_file)
combined_df = pd.concat(augmented_df, ignore_index=True) combined_df = pd.concat(augmented_df, ignore_index=True)
path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df) path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df)
path_eligible.to_html("EligblePaths.html", index=False) path_eligible.to_html("z_eligble_paths.html", index=False)
path_ineligible.to_html("IneligiblePaths.html",index=False) path_ineligible.to_html("z_ineligible_paths.html",index=False)
badpublisherlist = ["Brave Software, Inc.", "Zoom Video Communications, Inc."] 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("z_needs_review.html", index=False)
categorized[1].to_html("approved.html", index=False) categorized[1].to_html("z_approved_hashes.html", index=False)
categorized[2].to_html("remaining.html", index=False) categorized[2].to_html("z_remaining.html", index=False)
allowpaths = utils.allowfunctions.filter_and_drop(categorized[1],path_eligible,4) allowpaths = utils.allowfunctions.filter_and_drop(categorized[1],path_eligible,4)
allowpaths.to_html("AllowedPaths.html", index=False) allowpaths.to_html("z_allowed_paths.html", index=False)
+2 -2
View File
@@ -64,8 +64,8 @@ def augmentAggregatedHashes(url, agg_df: pd.DataFrame) -> pd.DataFrame:
df_api = pd.DataFrame(rows) df_api = pd.DataFrame(rows)
aug_df = agg_df.merge(df_api, on="sha256", how="left") df = agg_df.merge(df_api, on="sha256", how="left")
aug_df = df[['sha256', 'filename_x', 'description', 'productname', 'productversion', 'publisher_y', 'publisher_x', 'netdomain', 'hostname', 'username', 'pprocess', 'gprocess', 'commandline', 'reputation_lastseen', 'reputation_scannercount', 'reputation_scannermatch', 'reputation_status', 'reputation_threatlevel', 'reputation_threatname', 'reputation_timestamp']]
return aug_df return aug_df
def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publishers: list): def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publishers: list):