mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
Added check extra730 - ACM cert expiration
This commit is contained in:
@@ -38,6 +38,14 @@ if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux-musl" ]; then
|
||||
{
|
||||
base64 -d
|
||||
}
|
||||
how_many_days_from_today()
|
||||
{
|
||||
DATE_TO_COMPARE=$1
|
||||
TODAY_IN_DAYS=$(date -d "$(date +%Y-%m-%d)" +%s)
|
||||
DATE_IN_DAYS=$(date -d $DATE_TO_COMPARE +%s)
|
||||
DAYS_TO=$((( $DATE_IN_DAYS - $TODAY_IN_DAYS )/60/60/24))
|
||||
echo $DAYS_TO
|
||||
}
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# BSD/OSX commands compatibility
|
||||
TEMP_REPORT_FILE=$(mktemp -t prowler.cred_report-XXXXXX)
|
||||
@@ -60,6 +68,14 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
{
|
||||
base64 -D
|
||||
}
|
||||
how_many_days_from_today()
|
||||
{
|
||||
DATE_TO_COMPARE=$1
|
||||
TODAY_IN_DAYS=$(date +%s)
|
||||
DATE_IN_DAYS=$(date -jf %Y-%m-%d $DATE_TO_COMPARE +%s)
|
||||
DAYS_TO=$((( $DATE_IN_DAYS - $TODAY_IN_DAYS )/60/60/24))
|
||||
echo $DAYS_TO
|
||||
}
|
||||
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
# POSIX compatibility layer and Linux environment emulation for Windows
|
||||
TEMP_REPORT_FILE=$(mktemp -t -p /tmp prowler.cred_report-XXXXXX)
|
||||
@@ -82,6 +98,14 @@ elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
{
|
||||
base64 -d
|
||||
}
|
||||
how_many_days_from_today()
|
||||
{
|
||||
DATE_TO_COMPARE=$1
|
||||
TODAY_IN_DAYS=$(date -d "$(date +%Y-%m-%d)" +%s)
|
||||
DATE_IN_DAYS=$(date -d $DATE_TO_COMPARE +%s)
|
||||
DAYS_TO=$((( $TODAY_IN_DAYS - $DATE_IN_DAYS )/60/60/24))
|
||||
echo $DAYS_TO
|
||||
}
|
||||
else
|
||||
echo "Unknown Operating System! Valid \$OSTYPE: linux-gnu, linux-musl, darwin* or cygwin"
|
||||
echo "Found: $OSTYPE"
|
||||
|
||||
Reference in New Issue
Block a user