diff --git a/checks/check_extra741 b/checks/check_extra741 index fc48a852..f689bc18 100644 --- a/checks/check_extra741 +++ b/checks/check_extra741 @@ -31,7 +31,7 @@ extra741(){ # This finds ftp or http URLs with credentials and common keywords FINDINGS=$(egrep -i '[[:alpha:]]*://[[:alnum:]]*:[[:alnum:]]*@.*/|key|secret|token|pass' $USERDATA_FILE |wc -l|tr -d '\ ') if [[ $FILE_FORMAT_ASCII ]]; then - if [[ $FINDINGS -eq 0 ]]; then + if [[ $FINDINGS -eq "0" ]]; then textPass "$regx: No keys found in $instance" "$regx" # delete file if nothing interesting is there rm -f $USERDATA_FILE diff --git a/checks/check_extra742 b/checks/check_extra742 index b0ba818b..43420f08 100644 --- a/checks/check_extra742 +++ b/checks/check_extra742 @@ -29,7 +29,7 @@ extra742(){ #FINDINGS=$(grep -i -e key -e secret -e token -e pass $USERDATA_FILE |wc -l|tr -d '\ ') # This finds ftp or http URLs with credentials and common keywords FINDINGS=$(egrep -i '[[:alpha:]]*://[[:alnum:]]*:[[:alnum:]]*@.*/|key|secret|token|pass' $OUTPUTS_FILE |wc -l|tr -d '\ ') - if [[ $FINDINGS -eq 0 ]]; then + if [[ $FINDINGS -eq "0" ]]; then textPass "$regx: No keys found in Stack $stack" "$regx" # delete file if nothing interesting is there rm -f $OUTPUTS_FILE diff --git a/groups/group11_keys b/groups/group11_keys new file mode 100644 index 00000000..af1b348a --- /dev/null +++ b/groups/group11_keys @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +GROUP_ID[11]='keys' +GROUP_NUMBER[11]='11.0' +GROUP_TITLE[11]='Look for keys secrets or passwords around resources - [keys] ****************' +GROUP_RUN_BY_DEFAULT[11]='N' # run it when execute_all is called +GROUP_CHECKS[11]='extra741,extra742' + +# Initially: +# - EC2 UserData +# - CloudFormation Outputs