feat(quiet): Add -q option. (#1211)

Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-06-22 09:45:03 +02:00
committed by GitHub
parent 21f8f56c18
commit ecefda11c7
3 changed files with 36 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ import pkgutil
from abc import ABC, abstractmethod
from dataclasses import dataclass
from types import ModuleType
from colorama import Fore, Style
from config.config import groups_file
@@ -158,11 +159,22 @@ def recover_modules_from_provider(provider: str, service: str = None) -> list:
return modules
def set_output_options(quiet):
global output_options
output_options = Output_From_Options(
is_quiet=quiet
# set input options here
)
return output_options
def run_check(check):
print(f"\nCheck Name: {check.CheckName} - {Fore.MAGENTA}{check.ServiceName}{Fore.YELLOW}[{check.Severity}]{Style.RESET_ALL}")
print(
f"\nCheck Name: {check.CheckName} - {Fore.MAGENTA}{check.ServiceName}{Fore.YELLOW}[{check.Severity}]{Style.RESET_ALL}"
)
logger.debug(f"Executing check: {check.CheckName}")
findings = check.execute()
report(findings)
report(findings, output_options)
def import_check(check_path: str) -> ModuleType:
@@ -182,6 +194,11 @@ class Check_Report:
self.result_extended = ""
@dataclass
class Output_From_Options:
is_quiet: bool
class Check(ABC):
def __init__(self):
try: