mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
feat(organizations): Extract Metadata from Management Account ID (-O) (#1248)
* feat(organizations): add organizations funtion to provider * feat(organizations): add organizations -O option * fix(comments): Resolve comments. * feat(test): add test * fix(pipfile): update pipfile Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
@@ -9,7 +9,7 @@ from colorama import Fore, Style
|
||||
from config.config import groups_file
|
||||
from lib.check.models import Output_From_Options, load_check_metadata
|
||||
from lib.logger import logger
|
||||
from lib.outputs.outputs import get_orgs_info, report
|
||||
from lib.outputs.outputs import report
|
||||
from lib.utils.utils import open_file, parse_json_file
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ def print_services(service_list: set):
|
||||
print(f"- {service}")
|
||||
|
||||
|
||||
|
||||
def print_checks(provider: str, check_list: set, bulk_checks_metadata: dict):
|
||||
for check in check_list:
|
||||
try:
|
||||
@@ -111,7 +110,6 @@ def print_checks(provider: str, check_list: set, bulk_checks_metadata: dict):
|
||||
)
|
||||
|
||||
|
||||
|
||||
# List available groups
|
||||
def list_groups(provider: str):
|
||||
groups = parse_groups_from_file(groups_file)
|
||||
@@ -193,10 +191,7 @@ def run_check(check, audit_info, output_options):
|
||||
logger.debug(f"Executing check: {check.checkName}")
|
||||
findings = check.execute()
|
||||
|
||||
# Call to get orgs, need to check if input option is passed in output options
|
||||
# right now it is not checked and is called straight to generate the fields to be passed to the csv
|
||||
organizations_info = get_orgs_info()
|
||||
report(findings, output_options, audit_info, organizations_info)
|
||||
report(findings, output_options, audit_info)
|
||||
|
||||
|
||||
def import_check(check_path: str) -> ModuleType:
|
||||
|
||||
@@ -192,12 +192,3 @@ class Check_Report:
|
||||
self.resource_tags = []
|
||||
self.resource_id = ""
|
||||
self.resource_arn = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class Organizations_Info:
|
||||
account_details_email: str
|
||||
account_details_name: str
|
||||
account_details_arn: str
|
||||
account_details_org: str
|
||||
account_details_tags: str
|
||||
|
||||
Reference in New Issue
Block a user