diff --git a/prowler/__main__.py b/prowler/__main__.py index 06bb700a0f..c796677624 100644 --- a/prowler/__main__.py +++ b/prowler/__main__.py @@ -71,9 +71,9 @@ from prowler.providers.aws.lib.s3.s3 import S3 from prowler.providers.aws.lib.security_hub.security_hub import SecurityHub from prowler.providers.aws.models import AWSOutputOptions from prowler.providers.azure.models import AzureOutputOptions -from prowler.providers.common.inventory import run_prowler_inventory from prowler.providers.common.provider import Provider from prowler.providers.common.quick_inventory import run_provider_quick_inventory +from prowler.providers.common.scan_inventory import run_prowler_scan_inventory from prowler.providers.gcp.models import GCPOutputOptions from prowler.providers.kubernetes.models import KubernetesOutputOptions @@ -691,7 +691,7 @@ def prowler(): # Run the quick inventory for the provider if available if hasattr(args, "scan_inventory") and args.scan_inventory: - run_prowler_inventory(checks_to_execute, args.provider) + run_prowler_scan_inventory(checks_to_execute, args.provider) sys.exit() # If there are failed findings exit code 3, except if -z is input diff --git a/prowler/providers/common/inventory.py b/prowler/providers/common/scan_inventory.py similarity index 91% rename from prowler/providers/common/inventory.py rename to prowler/providers/common/scan_inventory.py index 42df5c1e69..37413b8f67 100644 --- a/prowler/providers/common/inventory.py +++ b/prowler/providers/common/scan_inventory.py @@ -10,9 +10,8 @@ from pydantic import BaseModel from prowler.config.config import orange_color -def run_prowler_inventory(checks_to_execute, provider): +def run_prowler_scan_inventory(checks_to_execute, provider): output_folder_path = f"./output/inventory/{provider}" - meta_json_file = {} os.makedirs(output_folder_path, exist_ok=True) @@ -89,16 +88,9 @@ def run_prowler_inventory(checks_to_execute, provider): client_path = getattr(lib, f"{service_client}") - if not meta_json_file.get(f"{service}"): - meta_json_file[f"{service}"] = [] - # Convert to JSON output_file = service_client.split("_client")[0] - meta_json_file[f"{service}"].append( - f"./{service}/{output_file}_output.json" - ) - with open( f"{service_output_folder}/{output_file}_output.json", "w+" ) as fp: