mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
Fix issue #7, base64 option in Linux
This commit is contained in:
17
prowler
17
prowler
@@ -111,6 +111,10 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
|||||||
OUTPUT_DATE=$(date -d @$TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
OUTPUT_DATE=$(date -d @$TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
||||||
echo $OUTPUT_DATE
|
echo $OUTPUT_DATE
|
||||||
}
|
}
|
||||||
|
decode_report()
|
||||||
|
{
|
||||||
|
base64 -d
|
||||||
|
}
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
# BSD/OSX coommands compatibility
|
# BSD/OSX coommands compatibility
|
||||||
how_older_from_today()
|
how_older_from_today()
|
||||||
@@ -128,7 +132,10 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|||||||
OUTPUT_DATE=$(date -r $TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
OUTPUT_DATE=$(date -r $TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
||||||
echo $OUTPUT_DATE
|
echo $OUTPUT_DATE
|
||||||
}
|
}
|
||||||
|
decode_report()
|
||||||
|
{
|
||||||
|
base64 -D
|
||||||
|
}
|
||||||
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||||
# POSIX compatibility layer and Linux environment emulation for Windows
|
# POSIX compatibility layer and Linux environment emulation for Windows
|
||||||
how_older_from_today()
|
how_older_from_today()
|
||||||
@@ -146,6 +153,10 @@ elif [[ "$OSTYPE" == "cygwin" ]]; then
|
|||||||
OUTPUT_DATE=$(date -d @$TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
OUTPUT_DATE=$(date -d @$TIMESTAMP_TO_CONVERT +'%Y-%m-%d')
|
||||||
echo $OUTPUT_DATE
|
echo $OUTPUT_DATE
|
||||||
}
|
}
|
||||||
|
decode_report()
|
||||||
|
{
|
||||||
|
base64 -d
|
||||||
|
}
|
||||||
else
|
else
|
||||||
echo "Unknown Operating System"
|
echo "Unknown Operating System"
|
||||||
exit
|
exit
|
||||||
@@ -208,10 +219,10 @@ genCredReport() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Save report to a file, deletion at finish, acb stands for AWS CIS Benchmark
|
# Save report to a file, decode it, deletion at finish, acb stands for AWS CIS Benchmark
|
||||||
saveReport(){
|
saveReport(){
|
||||||
TEMP_REPORT_FILE=/tmp/.acb
|
TEMP_REPORT_FILE=/tmp/.acb
|
||||||
$AWSCLI iam get-credential-report --query 'Content' --output text --profile $PROFILE --region $REGION | base64 -D > $TEMP_REPORT_FILE
|
$AWSCLI iam get-credential-report --query 'Content' --output text --profile $PROFILE --region $REGION | decode_report > $TEMP_REPORT_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get a list of all available AWS Regions
|
# Get a list of all available AWS Regions
|
||||||
|
|||||||
Reference in New Issue
Block a user