mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(output_filename): Use custom output filename when set (#1632)
This commit is contained in:
@@ -115,7 +115,6 @@ Detailed documentation at https://docs.prowler.cloud
|
||||
"-F",
|
||||
"--output-filename",
|
||||
nargs="?",
|
||||
default=None,
|
||||
help="Custom output report name without the file extension, if not specified will use default output/prowler-output-ACCOUNT_NUM-OUTPUT_DATE.format",
|
||||
)
|
||||
common_outputs_parser.add_argument(
|
||||
|
||||
@@ -183,7 +183,7 @@ class Aws_Check_Output_CSV(Check_Output_CSV):
|
||||
Aws_Check_Output_CSV generates a finding's output in CSV format for the AWS provider.
|
||||
"""
|
||||
|
||||
profile: str
|
||||
profile: Optional[str]
|
||||
account_id: int
|
||||
account_name: Optional[str]
|
||||
account_email: Optional[str]
|
||||
|
||||
@@ -60,7 +60,10 @@ class Azure_Output_Options(Provider_Output_Options):
|
||||
super().__init__(arguments, allowlist_file, bulk_checks_metadata)
|
||||
|
||||
# Check if custom output filename was input, if not, set the default
|
||||
if not hasattr(arguments, "output_filename"):
|
||||
if (
|
||||
not hasattr(arguments, "output_filename")
|
||||
or arguments.output_filename is None
|
||||
):
|
||||
if audit_info.identity.domain:
|
||||
self.output_filename = f"prowler-output-{audit_info.identity.domain}-{output_file_timestamp}"
|
||||
else:
|
||||
@@ -85,7 +88,10 @@ class Aws_Output_Options(Provider_Output_Options):
|
||||
change_config_var("shodan_api_key", arguments.shodan)
|
||||
|
||||
# Check if custom output filename was input, if not, set the default
|
||||
if not hasattr(arguments, "output_filename"):
|
||||
if (
|
||||
not hasattr(arguments, "output_filename")
|
||||
or arguments.output_filename is None
|
||||
):
|
||||
self.output_filename = (
|
||||
f"prowler-output-{audit_info.audited_account}-{output_file_timestamp}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user