mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
Merge remote-tracking branch 'tony/master'
# Conflicts: # checks/check_extra791 # checks/check_extra792
This commit is contained in:
@@ -7,7 +7,6 @@ verify_ssl = true
|
||||
|
||||
[packages]
|
||||
boto3 = ">=1.9.188"
|
||||
ansi2html = ">=1.5.2"
|
||||
detect-secrets = ">=0.12.4"
|
||||
|
||||
[requires]
|
||||
|
||||
@@ -61,10 +61,10 @@ This script has been written in bash using AWS-CLI and it works in Linux and OSX
|
||||
- Make sure the latest version of AWS-CLI is installed on your workstation, and other components needed, with Python pip already installed:
|
||||
|
||||
```sh
|
||||
pip install awscli ansi2html detect-secrets
|
||||
pip install awscli detect-secrets
|
||||
```
|
||||
|
||||
AWS-CLI can be also installed it using "brew", "apt", "yum" or manually from <https://aws.amazon.com/cli/>, but `ansi2html` and `detect-secrets` has to be installed using `pip`. You will need to install `jq` to get more accuracy in some checks.
|
||||
AWS-CLI can be also installed it using "brew", "apt", "yum" or manually from <https://aws.amazon.com/cli/>, but `detect-secrets` has to be installed using `pip`. You will need to install `jq` to get more accuracy in some checks.
|
||||
|
||||
- Make sure jq is installed (example below with "apt" but use a valid package manager for your OS):
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ CHECK_ID_extra791="7.91"
|
||||
CHECK_TITLE_extra791="[extra791] Check if CloudFront distributions are using deprecated SSL protocols"
|
||||
CHECK_SCORED_extra791="NOT_SCORED"
|
||||
CHECK_TYPE_extra791="EXTRA"
|
||||
CHECK_ASFF_RESOURCE_TYPE_extra791="AwsCloudFrontDistribution"
|
||||
CHECK_ALTERNATE_check791="extra791"
|
||||
|
||||
extra791(){
|
||||
|
||||
@@ -14,6 +14,7 @@ CHECK_ID_extra792="7.87"
|
||||
CHECK_TITLE_extra792="[extra792] Check if Elastic Load Balancers have insecure SSL ciphers (Not Scored) (Not part of CIS benchmark)"
|
||||
CHECK_SCORED_extra792="NOT_SCORED"
|
||||
CHECK_TYPE_extra792="EXTRA"
|
||||
CHECK_ASFF_RESOURCE_TYPE_extra792="AwsElbLoadBalancer"
|
||||
CHECK_ALTERNATE_check792="extra792"
|
||||
|
||||
extra792(){
|
||||
|
||||
@@ -15,7 +15,11 @@ GROUP_ID[7]='extras'
|
||||
GROUP_NUMBER[7]='7.0'
|
||||
GROUP_TITLE[7]='Extras - all non CIS specific checks - [extras] ****************'
|
||||
GROUP_RUN_BY_DEFAULT[7]='Y' # run it when execute_all is called
|
||||
GROUP_CHECKS[7]='extra71,extra72,extra73,extra74,extra75,extra76,extra77,extra78,extra79,extra710,extra711,extra712,extra713,extra714,extra715,extra716,extra717,extra718,extra719,extra720,extra721,extra722,extra723,extra724,extra725,extra726,extra727,extra728,extra729,extra730,extra731,extra732,extra733,extra734,extra735,extra736,extra737,extra738,extra739,extra740,extra741,extra742,extra743,extra744,extra745,extra746,extra747,extra748,extra749,extra750,extra751,extra752,extra753,extra754,extra755,extra756,extra757,extra758,extra761,extra762,extra763,extra764,extra765,extra767,extra768,extra769,extra770,extra771,extra772,extra773,extra774,extra775,extra776,extra777,extra778,extra779,extra780,extra781,extra782,extra783,extra784,extra785,extra786,extra787,extra788'
|
||||
GROUP_CHECKS[7]='extra71,extra72,extra73,extra74,extra75,extra76,extra77,extra78,extra79,extra710,extra711,extra712,extra713,extra714,extra715,extra716,extra717,extra718,extra719,extra720,extra721,extra722,extra723,extra724,extra725,extra726,extra727,extra728,extra729,extra730,extra731,extra732,extra733,extra734,extra735,extra736,extra737,extra738,extra739,extra740,extra741,extra742,extra743,extra744,extra745,extra746,extra747,extra748,extra749,extra750,extra751,extra752,extra753,extra754,extra755,extra756,extra757,extra758,extra761,extra762,extra763,extra764,extra765,extra767,extra768,extra769,extra770,extra771,extra772,extra773,extra774,extra775,extra776,extra777,extra778,extra779,extra780,extra781,extra782,extra783,extra784,extra785,extra786,extra787,extra788,extra791,extra792'
|
||||
|
||||
# Extras 759 and 760 (lambda variables and code secrets finder are not included)
|
||||
# to run detect-secrets use `./prowler -g secrets`
|
||||
|
||||
# Extras 789 and 790 VPC trust boundaries are not included by default in Extras
|
||||
# to run trust-boundaries use `./prowler -g trustboundaries`
|
||||
# read more in https://github.com/toniblyx/prowler/#trust-boundaries-checks
|
||||
|
||||
@@ -31,7 +31,10 @@ elif [[ -n $AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ]] && [[ -z $INSTANCE_PROFILE
|
||||
AWS_ACCESS_KEY_ID=$(curl -s 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g')
|
||||
AWS_SECRET_ACCESS_KEY_ID=$(curl -s 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g')
|
||||
AWS_SESSION_TOKEN=$(curl -s 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI grep Token| cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g')
|
||||
elif [[ $INSTANCE_PROFILE ]];then
|
||||
elif [[ $AWS_WEB_IDENTITY_TOKEN_FILE ]]; then
|
||||
PROFILE=""
|
||||
PROFILE_OPT=""
|
||||
elif [[ $INSTANCE_PROFILE ]]; then
|
||||
PROFILE="INSTANCE-PROFILE"
|
||||
AWS_ACCESS_KEY_ID=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${INSTANCE_PROFILE} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g')
|
||||
AWS_SECRET_ACCESS_KEY_ID=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${INSTANCE_PROFILE} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g')
|
||||
|
||||
+3
-3
@@ -111,19 +111,19 @@ textFail(){
|
||||
## ignore whitelists for current check
|
||||
level="FAIL"
|
||||
colorcode="$BAD"
|
||||
for i in $IGNORES; do
|
||||
while read -r i; do
|
||||
ignore_check_name="${i%:*}"
|
||||
ignore_value="${i#*${CHECK_NAME}:}"
|
||||
if [[ ${ignore_check_name} != "${CHECK_NAME}" ]]; then
|
||||
# not for this check
|
||||
continue
|
||||
fi
|
||||
if [[ $1 =~ ${ignore_value} ]]; then
|
||||
if [[ $1 =~ .*"${ignore_value}".* ]]; then
|
||||
level="WARNING"
|
||||
colorcode="$WARNING"
|
||||
break
|
||||
fi
|
||||
done
|
||||
done <<< "$IGNORES"
|
||||
|
||||
# only set non-0 exit code on FAIL mode, WARN is ok
|
||||
if [[ "$level" == "FAIL" ]]; then
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ RUN addgroup -g ${USERID} ${USERNAME} && \
|
||||
adduser -s /bin/sh -G ${USERNAME} -D -u ${USERID} ${USERNAME} && \
|
||||
apk --update --no-cache add python3 bash curl jq file && \
|
||||
pip3 install --upgrade pip && \
|
||||
pip install awscli ansi2html boto3 detect-secrets
|
||||
pip install awscli boto3 detect-secrets
|
||||
|
||||
WORKDIR /prowler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user