From 67bf78a8a9d075783a953142549051cbd13cce29 Mon Sep 17 00:00:00 2001 From: MSAdministrator Date: Sat, 23 Dec 2023 23:55:30 -0600 Subject: [PATCH] fix: Adding pretty run output --- atomic_operator/atomic_operator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/atomic_operator/atomic_operator.py b/atomic_operator/atomic_operator.py index 8f54ccf..83e154a 100644 --- a/atomic_operator/atomic_operator.py +++ b/atomic_operator/atomic_operator.py @@ -1,5 +1,6 @@ import inspect import os +from pprint import pprint from typing import AnyStr from atomic_operator_runner import Runner @@ -294,6 +295,7 @@ def run( verify_ssl=False, ssh_port=22, ssh_timeout=5, + pretty=False, **kwargs, ) -> None: """The main method in which we run Atomic Red Team tests. @@ -322,6 +324,7 @@ def run( verify_ssl (bool, optional): Whether or not to verify ssl when connecting over RDP (windows). Defaults to False. ssh_port (int, optional): SSH port for authentication of remote connections. Defaults to 22. ssh_timeout (int, optional): SSH timeout for authentication of remote connections. Defaults to 5. + pretty (bool, optional): Whether or not to output results in a pretty format. Defaults to False. kwargs (dict, optional): If provided, keys matching inputs for a test will be replaced. Default is None. Raises: @@ -389,5 +392,5 @@ def run( else: self.__run_technique(item) if return_atomics and __return_atomics: - return __return_atomics - return self.__test_responses + return pprint(__return_atomics) if pretty else __return_atomics + return pprint(self.__test_responses) if pretty else self.__test_responses