mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-29 06:44:21 +00:00
Merge remote-tracking branch 'tony/master'
This commit is contained in:
commit
15a58124d7
6 files changed
+52
-5
No files matched your search
@@ -179,7 +179,7 @@ This script has been written in bash using AWS-CLI and it works in Linux and OSX
|
||||
./prowler -M mono | aws s3 cp - s3://bucket-name/prowler-report.txt
|
||||
```
|
||||
|
||||
1. To perform an assessment based on CIS Profile Definitions you can use cislevel1 or cislevel2 with `-c` flag, more information about this [here, page 8](https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf):
|
||||
1. To perform an assessment based on CIS Profile Definitions you can use cislevel1 or cislevel2 with `-g` flag, more information about this [here, page 8](https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf):
|
||||
|
||||
```sh
|
||||
./prowler -g cislevel1
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ check26(){
|
||||
|
||||
if [[ $CLOUDTRAILBUCKET ]];then
|
||||
bucket=$CLOUDTRAILBUCKET
|
||||
if [ "$CLOUDTRAIL_ACCOUNT_ID" == "$ACCOUNT_ID" ];then
|
||||
if [ "$CLOUDTRAIL_ACCOUNT_ID" == "$ACCOUNT_NUM" ];then
|
||||
CLOUDTRAILBUCKET_LOGENABLED=$($AWSCLI s3api get-bucket-logging --bucket $bucket $PROFILE_OPT --region $REGION --query 'LoggingEnabled.TargetBucket' --output text|grep -v None)
|
||||
if [[ $CLOUDTRAILBUCKET_LOGENABLED ]];then
|
||||
textPass "Bucket access logging enabled in CloudTrail S3 bucket $bucket for $trail"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/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.
|
||||
CHECK_ID_extra770="7.70"
|
||||
CHECK_TITLE_extra770="[extra770] Check for internet facing EC2 instances with Instance Profiles attached (Not Scored) (Not part of CIS benchmark)"
|
||||
CHECK_SCORED_extra770="NOT_SCORED"
|
||||
CHECK_TYPE_extra770="EXTRA"
|
||||
CHECK_ALTERNATE_check770="extra770"
|
||||
|
||||
extra770(){
|
||||
# "Check for internet facing EC2 Instances (Not Scored) (Not part of CIS benchmark)"
|
||||
textInfo "Looking for instances in all regions... "
|
||||
for regx in $REGIONS; do
|
||||
LIST_OF_PUBLIC_INSTANCES_WITH_INSTANCE_PROFILES=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[*].Instances[?((IamInstanceProfile!=`null` && PublicIpAddress!=`null`))].[InstanceId,PublicIpAddress,IamInstanceProfile.Arn]' --output text)
|
||||
if [[ $LIST_OF_PUBLIC_INSTANCES_WITH_INSTANCE_PROFILES ]];then
|
||||
while read -r instance;do
|
||||
INSTANCE_ID=$(echo $instance | awk '{ print $1; }')
|
||||
PUBLIC_IP=$(echo $instance | awk '{ print $2; }')
|
||||
INSTANCE_PROFILE=$(echo $instance | awk '{ print $3; }')
|
||||
textFail "$regx: Instance: $INSTANCE_ID at IP: $PUBLIC_IP is internet-facing with Instance Profile $INSTANCE_PROFILE" "$regx"
|
||||
done <<< "$LIST_OF_PUBLIC_INSTANCES_WITH_INSTANCE_PROFILES"
|
||||
else
|
||||
textPass "$regx: no Internet Facing EC2 Instances with Instance Profiles found" "$regx"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -15,7 +15,7 @@ GROUP_ID[7]='extras'
|
||||
GROUP_NUMBER[7]='7.0'
|
||||
GROUP_TITLE[7]='Extras - [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,extra766,extra767,extra768,extra769'
|
||||
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,extra766,extra767,extra768,extra769,extra770,extra771'
|
||||
|
||||
# Extras 759 and 760 (lambda variables and code secrets finder are not included)
|
||||
# to run detect-secrets use `./prowler -g secrets`
|
||||
@@ -3,6 +3,7 @@
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"access-analyzer:List*",
|
||||
"apigateway:get*",
|
||||
"apigatewayv2:get*",
|
||||
"aws-marketplace:viewsubscriptions",
|
||||
@@ -103,4 +104,4 @@
|
||||
"Resource": "*"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -74,12 +74,13 @@ USAGE:
|
||||
-b do not print Prowler banner
|
||||
-V show version number & exit
|
||||
-s show scoring report
|
||||
-x specify external directory with custom checks (i.e. /my/own/checks, files must start by "check")
|
||||
-h this help
|
||||
"
|
||||
exit
|
||||
}
|
||||
|
||||
while getopts ":hlLkp:r:c:g:f:m:M:E:enbVs" OPTION; do
|
||||
while getopts ":hlLkp:r:c:g:f:m:M:E:enbVsx:" OPTION; do
|
||||
case $OPTION in
|
||||
h )
|
||||
usage
|
||||
@@ -136,6 +137,9 @@ while getopts ":hlLkp:r:c:g:f:m:M:E:enbVs" OPTION; do
|
||||
s )
|
||||
SCORING=1
|
||||
;;
|
||||
x )
|
||||
EXTERNAL_CHECKS_PATH=$OPTARG
|
||||
;;
|
||||
: )
|
||||
echo ""
|
||||
echo "$OPTRED ERROR!$OPTNORMAL -$OPTARG requires an argument"
|
||||
@@ -185,6 +189,13 @@ for checks in $(ls $PROWLER_DIR/checks/check*|grep -v check_sample); do
|
||||
. "$checks"
|
||||
done
|
||||
|
||||
# include checks if external folder is specified
|
||||
if [[ $EXTERNAL_CHECKS_PATH ]]; then
|
||||
for checks in $(ls $EXTERNAL_CHECKS_PATH/check*); do
|
||||
. "$checks"
|
||||
done
|
||||
fi
|
||||
|
||||
# Function to show the title of the check
|
||||
# using this way instead of arrays to keep bash3 (osx) and bash4(linux) compatibility
|
||||
show_check_title() {
|
||||
|
||||
Reference in new issue
Block a user