Exclusion Divide added
This commit is contained in:
@@ -22,11 +22,13 @@ from AirlockTools import tryToReadCSV
|
||||
#Standard Libary Imports:
|
||||
import ast
|
||||
import gc
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
#3rd Party Imports:
|
||||
import pandas as pd
|
||||
import requests
|
||||
|
||||
def split_filepaths_grouped(df, col="filename", group_parts=4, min_parts=4):
|
||||
def clean_split(path):
|
||||
@@ -321,3 +323,45 @@ def mergeTesting():
|
||||
merged_df.to_csv("merged_output.csv", index=False)
|
||||
|
||||
print(f"Merged DataFrame saved with {len(merged_df)} rows.")
|
||||
|
||||
|
||||
def listPaths(url, group):
|
||||
endpoint = url + '/v1/group/policies'
|
||||
print(ct.colorText("[+] Grabbing All Paths", "cyan"))
|
||||
|
||||
payload = {
|
||||
"groupid": [group],
|
||||
}
|
||||
headers = {
|
||||
"X-APIKey": os.getenv('APIKEY')
|
||||
}
|
||||
|
||||
try:
|
||||
response = requests.post(endpoint, headers=headers, data=payload, verify=False)
|
||||
response.raise_for_status()
|
||||
parse_text = response.json()
|
||||
|
||||
pathnames = []
|
||||
print(parse_text) # Optional: for debugging
|
||||
|
||||
for item in parse_text.get('response', {}).get('paths', []):
|
||||
path = item.get('name')
|
||||
if path:
|
||||
pathnames.append(path)
|
||||
|
||||
return pathnames
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(ct.colorText(f"[!] Request failed: {e}", "red"))
|
||||
return []
|
||||
except (KeyError, json.JSONDecodeError) as e:
|
||||
print(ct.colorText(f"[!] Failed to parse response: {e}", "red"))
|
||||
return []
|
||||
|
||||
def wildcardRegex(pattern):
|
||||
pattern = pattern.replace("\\", "\\\\")
|
||||
pattern = pattern.replace("**", "___RECURSIVE___")
|
||||
pattern = pattern.replace("*", "[^\\\\]*")
|
||||
pattern = pattern.replace("?", ".")
|
||||
pattern = pattern.replace("___RECURSIVE___", ".*")
|
||||
return re.compile(f"^{pattern}$", re.IGNORECASE)
|
||||
Reference in New Issue
Block a user