fixed breaking changes
This commit is contained in:
+6
-6
@@ -92,8 +92,8 @@ def menu_feature2():
|
|||||||
print("Invalid choice. Please try again.")
|
print("Invalid choice. Please try again.")
|
||||||
|
|
||||||
def menu_prepare_to_enforce():
|
def menu_prepare_to_enforce():
|
||||||
first_policy = ""
|
first_policy = [""]
|
||||||
second_policy = ""
|
second_policy = [""]
|
||||||
history_staged = False
|
history_staged = False
|
||||||
hashes_threat_pulled = False
|
hashes_threat_pulled = False
|
||||||
hashes_categorized = False
|
hashes_categorized = False
|
||||||
@@ -104,8 +104,8 @@ def menu_prepare_to_enforce():
|
|||||||
while True:
|
while True:
|
||||||
print("\n--- Prepare to Enforce Policy ---")
|
print("\n--- Prepare to Enforce Policy ---")
|
||||||
print("Sequentually follow steps to prepare for policy enforcement")
|
print("Sequentually follow steps to prepare for policy enforcement")
|
||||||
print("1. Choose first policy, Typically the audit version of the policy - Currently selected first policy is: " + str(first_policy))
|
print("1. Choose first policy, Typically the audit version of the policy - Currently selected first policy is: " + str([first_policy[0]]))
|
||||||
print("2. Choose second policy, If an enforcement policy of that type exists, include it here - Currently selected second policy is: " + str(second_policy))
|
print("2. Choose second policy, If an enforcement policy of that type exists, include it here - Currently selected second policy is: " + str(second_policy[0]))
|
||||||
print("3. Pull and stage event history for the selected policies - This step has been done - " + str(history_staged))
|
print("3. Pull and stage event history for the selected policies - This step has been done - " + str(history_staged))
|
||||||
print("4. Pull Hash info - This step has been done - " + str(hashes_threat_pulled))
|
print("4. Pull Hash info - This step has been done - " + str(hashes_threat_pulled))
|
||||||
print("5. Determine if path exclusions are possible: - This step has been done - " + str(path_exclusions_calculated))
|
print("5. Determine if path exclusions are possible: - This step has been done - " + str(path_exclusions_calculated))
|
||||||
@@ -121,8 +121,8 @@ def menu_prepare_to_enforce():
|
|||||||
second_policy = utils.allowlist.listPolicies(url)
|
second_policy = utils.allowlist.listPolicies(url)
|
||||||
|
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy,True)
|
executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy[0], first_policy[1],True)
|
||||||
executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy,True)
|
executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy[0], second_policy[1],True)
|
||||||
df_aggregated_policy1 = utils.hashfunctions.aggregateHashes(executionhist_policy1)
|
df_aggregated_policy1 = utils.hashfunctions.aggregateHashes(executionhist_policy1)
|
||||||
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2)
|
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2)
|
||||||
df_aggregated_combo= pd.concat([df_aggregated_policy1, df_aggregated_policy2], ignore_index=True)
|
df_aggregated_combo= pd.concat([df_aggregated_policy1, df_aggregated_policy2], ignore_index=True)
|
||||||
|
|||||||
+5
-2
@@ -4,8 +4,11 @@ import json
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def pullPolicyExechistories(url, choice, outputjson: bool):
|
def pullPolicyExechistories(url, choice, policiesnames, outputjson: bool):
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"X-APIKey": os.getenv('APIKEY')
|
||||||
|
}
|
||||||
checkpoint = '000000000000000000000000'
|
checkpoint = '000000000000000000000000'
|
||||||
json_output = {'error': 'Success', 'response': {'exechistories': []}}
|
json_output = {'error': 'Success', 'response': {'exechistories': []}}
|
||||||
while True:
|
while True:
|
||||||
@@ -93,4 +96,4 @@ def listPolicies(url):
|
|||||||
policyids.append(list['groupid'])
|
policyids.append(list['groupid'])
|
||||||
choice = input("Select Policy Group: ")
|
choice = input("Select Policy Group: ")
|
||||||
choice = int(choice) - 1
|
choice = int(choice) - 1
|
||||||
return choice
|
return choice, policiesnames
|
||||||
Reference in New Issue
Block a user