Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ./checks/check_extra715: line 41: ${SEARCH_SLOWLOG_ENABLED,,}: bad substitution #1058

Closed
yadox666 opened this issue Mar 6, 2022 · 10 comments
Labels
bug severity/medium Results in some unexpected or undesired behavior.

Comments

@yadox666
Copy link

yadox666 commented Mar 6, 2022

Error message after running:

./prowler -M html,csv,json,json-asff,mono

Prowler 2.7.0-24January2022

@yadox666 yadox666 added bug status/needs-triage Issue pending triage labels Mar 6, 2022
@lazize
Copy link
Contributor

lazize commented Mar 6, 2022

Would you give more details about your bash version and environment?

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 7, 2022

Hi @yadox666 could you please provide more information? Exact error, bash version, environment ...
Also, please, to make our work easier is preferable to use the issue template.

@n4ch04 n4ch04 added severity/medium Results in some unexpected or undesired behavior. status/awaiting-reponse Waiting response from Issue owner and removed status/needs-triage Issue pending triage labels Mar 7, 2022
@yadox666
Copy link
Author

yadox666 commented Mar 7, 2022

Darwin XXXXXXXXXXXX 20.6.0 Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 x86_64

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 7, 2022

We need also information about the error, it is easier if you fill the default template

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 7, 2022

Basically to reproduce it and test it

@lazize
Copy link
Contributor

lazize commented Mar 7, 2022

I have two versions of bash on my machine. As you can see below.

$ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-apple-darwin19.6.0)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

The version 3.2.57(1)-release (x86_64-apple-darwin19) shows me the same error reported by OP.

$ /bin/bash prowler -p default -f sa-east-1 -c extra715
                          _
  _ __  _ __ _____      _| | ___ _ __
 | '_ \| '__/ _ \ \ /\ / / |/ _ \ '__|
 | |_) | | | (_) \ V  V /| |  __/ |
 | .__/|_|  \___/ \_/\_/ |_|\___|_|v2.7.0-24January2022
 |_| the handy cloud security tool

 Date: Mon Mar  7 11:57:51 -03 2022

 Color code for results:
 -  INFO (Information)
 -  PASS (Recommended value)
 -  WARNING (Ignored by whitelist)
 -  FAIL (Fix required)

 This report is being generated using credentials below:

 AWS-CLI Profile: [default] AWS API Region: [sa-east-1] AWS Filter Region: [sa-east-1]
 AWS Account: [****5262] UserId: [AROA****:****]
 Caller Identity ARN: [arn:aws:sts::****5262:assumed-role/****/****]

7.15 [extra715] Check if Amazon Elasticsearch Service (ES) domains have logging enabled - es [Medium]
./checks/check_extra715: line 41: ${SEARCH_SLOWLOG_ENABLED,,}: bad substitution

The version 5.1.8(1)-release (x86_64-apple-darwin19.6.0) it works fine.

$ ./prowler -p default -f sa-east-1 -c extra715
                          _
  _ __  _ __ _____      _| | ___ _ __
 | '_ \| '__/ _ \ \ /\ / / |/ _ \ '__|
 | |_) | | | (_) \ V  V /| |  __/ |
 | .__/|_|  \___/ \_/\_/ |_|\___|_|v2.7.0-24January2022
 |_| the handy cloud security tool

 Date: Mon Mar  7 11:45:13 -03 2022

 Color code for results:
 -  INFO (Information)
 -  PASS (Recommended value)
 -  WARNING (Ignored by whitelist)
 -  FAIL (Fix required)

 This report is being generated using credentials below:

 AWS-CLI Profile: [default] AWS API Region: [sa-east-1] AWS Filter Region: [sa-east-1]
 AWS Account: [****5262] UserId: [AROA****:****]
 Caller Identity ARN: [arn:aws:sts::****5262:assumed-role/****/****]

7.15 [extra715] Check if Amazon Elasticsearch Service (ES) domains have logging enabled - es [Medium]
       FAIL! sa-east-1: Amazon ES domain test SEARCH_SLOW_LOGS disabled!
       FAIL! sa-east-1: Amazon ES domain test INDEX_SLOW_LOGS disabled!

So I believe macOS original bash version is too old to support modern bash variable expansion features.


I see two options here.

  1. Set a minimum version for bash
  2. Change from variable expansion to tr '[:upper:]' '[:lower:]'

Just let me know what is the best option and If necessary I can fix the code.

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 7, 2022

Thanks @lazize !!!
We are going to track it to be resolved in the next few days

@n4ch04 n4ch04 added status/waiting-for-revision Waiting for maintainer's revision and removed status/awaiting-reponse Waiting response from Issue owner labels Mar 7, 2022
@ShadySQL
Copy link

ShadySQL commented Mar 8, 2022

Just ran into the same issue today. Any ideas on when this will be resolved?

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 14, 2022

Hi @ShadySQL we are going to review it and get this done asap !

@n4ch04
Copy link
Contributor

n4ch04 commented Mar 15, 2022

Fixed in #1064 closing it

@n4ch04 n4ch04 closed this as completed Mar 15, 2022
@n4ch04 n4ch04 removed the status/waiting-for-revision Waiting for maintainer's revision label Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug severity/medium Results in some unexpected or undesired behavior.
Projects
None yet
Development

No branches or pull requests

4 participants