mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-29 06:44:21 +00:00
fix(cli): prevent unrelated built-in provider failures from aborting the CLI (#11618)
This commit is contained in:
1 parent
e4d5ca11b3
commit
e690e5e86b
4 files changed
+386
-37
No files matched your search
@@ -15,6 +15,8 @@ from prowler.lib.check.models import Severity
|
||||
from prowler.lib.cli.redact import warn_sensitive_argument_values
|
||||
from prowler.lib.outputs.common import Status
|
||||
from prowler.providers.common.arguments import (
|
||||
PROVIDER_ALIASES,
|
||||
enforce_invoked_provider_loaded,
|
||||
init_providers_parser,
|
||||
validate_asff_usage,
|
||||
validate_provider_arguments,
|
||||
@@ -166,13 +168,13 @@ Detailed documentation at https://docs.prowler.com
|
||||
if sys.argv[1].startswith("-"):
|
||||
sys.argv = self.__set_default_provider__(sys.argv)
|
||||
|
||||
# Provider aliases mapping
|
||||
# Microsoft 365
|
||||
elif sys.argv[1] == "microsoft365":
|
||||
sys.argv[1] = "m365"
|
||||
# Oracle Cloud Infrastructure
|
||||
elif sys.argv[1] == "oci":
|
||||
sys.argv[1] = "oraclecloud"
|
||||
# Provider aliases mapping (single source: arguments.PROVIDER_ALIASES)
|
||||
elif sys.argv[1] in PROVIDER_ALIASES:
|
||||
sys.argv[1] = PROVIDER_ALIASES[sys.argv[1]]
|
||||
|
||||
# Selective fail-loud here (post argv-normalisation, pre parse_args)
|
||||
# so the invoked-provider check stays correct under parse(args=...).
|
||||
enforce_invoked_provider_loaded(self)
|
||||
|
||||
# Warn about sensitive flags passed with explicit values
|
||||
# Snapshot argv before parse_args() which may exit on errors
|
||||
|
||||
Reference in new issue
Block a user