Workflow upgrade for Move Audit/Enforcement
This commit is contained in:
@@ -283,4 +283,5 @@ def moveAgentToRelatedPolicy(
|
|||||||
logger.error(f"Unknown mode '{mode}'. Use 'audit' or 'enforcement'.")
|
logger.error(f"Unknown mode '{mode}'. Use 'audit' or 'enforcement'.")
|
||||||
return
|
return
|
||||||
|
|
||||||
api.agent_move(agent.agentid, target_policy)
|
result = api.agent_move(agent.agentid, target_policy)
|
||||||
|
return result
|
||||||
+5
-3
@@ -72,10 +72,10 @@ def menu_main(api: AirlockAPIWrapper):
|
|||||||
elif choice == "2":
|
elif choice == "2":
|
||||||
menu_otp(api)
|
menu_otp(api)
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
choices = ["audit", "enforcement", "Cancel"]
|
choices = ["audit", "enforcement", "Exit"]
|
||||||
print(colorText("Move devices to which state?:", "yellow"))
|
print(colorText("Move devices to which state?:", "yellow"))
|
||||||
direction = Selector.select_string(choices, False, False)
|
direction = Selector.select_string(choices, False, False)
|
||||||
if direction == "Cancel":
|
if direction == "Exit":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
devices = selectAgents(api)
|
devices = selectAgents(api)
|
||||||
@@ -85,7 +85,9 @@ def menu_main(api: AirlockAPIWrapper):
|
|||||||
confirm = Selector.confirm()
|
confirm = Selector.confirm()
|
||||||
if direction and devices and confirm:
|
if direction and devices and confirm:
|
||||||
for device in devices:
|
for device in devices:
|
||||||
moveAgentToRelatedPolicy(api,device, str(direction))
|
result = moveAgentToRelatedPolicy(api,device, str(direction))
|
||||||
|
logger.info(f"{device.hostname}: result: {result}")
|
||||||
|
get_sanitized_input("Press enter to continue")
|
||||||
elif choice == "4":
|
elif choice == "4":
|
||||||
findAgents(api,False)
|
findAgents(api,False)
|
||||||
elif choice == "5":
|
elif choice == "5":
|
||||||
|
|||||||
Reference in New Issue
Block a user