mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 04:21:52 +00:00
feat(inventory): change name and behaviour
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -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:
|
||||
Reference in New Issue
Block a user