From d32a7986a5685fd5db899c7efa2fe348ec7db5ff Mon Sep 17 00:00:00 2001 From: Pepe Fagoaga Date: Tue, 14 Jun 2022 10:43:15 +0200 Subject: [PATCH] fix(shellcheck): Main variables (#1194) --- include/default_variables | 14 +++++++++ prowler | 62 +++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/include/default_variables b/include/default_variables index f5d905531b..7290596579 100644 --- a/include/default_variables +++ b/include/default_variables @@ -13,28 +13,42 @@ # Output Colors OPTRED="" +export OPTRED OPTNORMAL="" +export OPTNORMAL # AWS Region REGION="" +export REGION FILTERREGION="" +export FILTERREGION # Max AWS CLI items MAXITEMS=100 +export MAXITEMS # Default output mode MODE="text" +export MODE # Security Hub SEND_TO_SECURITY_HUB=0 +export SEND_TO_SECURITY_HUB # Date & Time PROWLER_START_TIME=$( date -u +"%Y-%m-%dT%H:%M:%S%z" ) +export PROWLER_START_TIME OUTPUT_DATE=$(date -u +"%Y%m%d%H%M%S") +export OUTPUT_DATE # Default Prowler Options QUIET=0 +export QUIET SEP=',' +export SEP KEEPCREDREPORT=0 +export KEEPCREDREPORT EXITCODE=0 +export EXITCODE FAILED_CHECK_FAILED_SCAN=1 +export FAILED_CHECK_FAILED_SCAN diff --git a/prowler b/prowler index 69bc3eefb9..3068391630 100755 --- a/prowler +++ b/prowler @@ -28,36 +28,36 @@ PROWLER_DIR=$(dirname "$0") ############################################################ # DEPENDENCIES -. $PROWLER_DIR/include/default_variables -. $PROWLER_DIR/include/colors -. $PROWLER_DIR/include/os_detector -. $PROWLER_DIR/include/aws_profile_loader -. $PROWLER_DIR/include/awscli_detector -. $PROWLER_DIR/include/whoami -. $PROWLER_DIR/include/assume_role -. $PROWLER_DIR/include/csv_header -. $PROWLER_DIR/include/banner -. $PROWLER_DIR/include/html_report -. $PROWLER_DIR/include/tools_detector -. $PROWLER_DIR/include/outputs_bucket -. $PROWLER_DIR/include/outputs -. $PROWLER_DIR/include/credentials_report -. $PROWLER_DIR/include/scoring -. $PROWLER_DIR/include/secrets_detector -. $PROWLER_DIR/include/check_creds_last_used -. $PROWLER_DIR/include/check3x -. $PROWLER_DIR/include/connection_tests -. $PROWLER_DIR/include/securityhub_integration -. $PROWLER_DIR/include/junit_integration -. $PROWLER_DIR/include/organizations_metadata -. $PROWLER_DIR/include/custom_checks -. $PROWLER_DIR/include/allowlist -. $PROWLER_DIR/include/db_connector -. $PROWLER_DIR/include/show_titles -. $PROWLER_DIR/include/loader -. $PROWLER_DIR/include/execute_check -. $PROWLER_DIR/include/validate_options -. $PROWLER_DIR/include/traps +. "${PROWLER_DIR}"/include/default_variables +. "${PROWLER_DIR}"/include/colors +. "${PROWLER_DIR}"/include/os_detector +. "${PROWLER_DIR}"/include/aws_profile_loader +. "${PROWLER_DIR}"/include/awscli_detector +. "${PROWLER_DIR}"/include/whoami +. "${PROWLER_DIR}"/include/assume_role +. "${PROWLER_DIR}"/include/csv_header +. "${PROWLER_DIR}"/include/banner +. "${PROWLER_DIR}"/include/html_report +. "${PROWLER_DIR}"/include/tools_detector +. "${PROWLER_DIR}"/include/outputs_bucket +. "${PROWLER_DIR}"/include/outputs +. "${PROWLER_DIR}"/include/credentials_report +. "${PROWLER_DIR}"/include/scoring +. "${PROWLER_DIR}"/include/secrets_detector +. "${PROWLER_DIR}"/include/check_creds_last_used +. "${PROWLER_DIR}"/include/check3x +. "${PROWLER_DIR}"/include/connection_tests +. "${PROWLER_DIR}"/include/securityhub_integration +. "${PROWLER_DIR}"/include/junit_integration +. "${PROWLER_DIR}"/include/organizations_metadata +. "${PROWLER_DIR}"/include/custom_checks +. "${PROWLER_DIR}"/include/allowlist +. "${PROWLER_DIR}"/include/db_connector +. "${PROWLER_DIR}"/include/show_titles +. "${PROWLER_DIR}"/include/loader +. "${PROWLER_DIR}"/include/execute_check +. "${PROWLER_DIR}"/include/validate_options +. "${PROWLER_DIR}"/include/traps ############################################################ # Check external tools @@ -108,7 +108,7 @@ USAGE: -T Session duration given to that role credentials in seconds, default 1h (3600) recommended 12h, optional with -R and -A. (i.e.: 43200) -I External ID to be used when assuming roles (not mandatory), requires -A and -R. - -w Allowlist file. See allowlist_sample.txt for reference and format. S3 URI and DynamoDB table ARNs are also supported as allowlist file. + -w Allowlist file. See allowlist_sample.txt for reference and format. S3 URI and DynamoDB table ARNs are also supported as allowlist file. (i.e.: allowlist_sample.txt or s3://bucket/prefix/allowlist_sample.txt or arn:aws:dynamodb:us-east-1:111111222222:table/allowlist) -N Shodan API key used by check extra7102. -o Custom output directory, if not specified will use default prowler/output, requires -M .