-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(extra730): Handle invalid date formats checking ACM certificates #1033
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,28 +32,20 @@ bsd_how_older_from_today() { | |
# function to convert from timestamp to date | ||
# output date format %Y-%m-%d | ||
gnu_timestamp_to_date() { | ||
# if date comes from cli v2 in format like 2020-04-29T10:13:09.191000-04:00 | ||
# we have to get only '%Y-%m-%d' | ||
if [[ $1 = 20* ]];then | ||
echo $1 | cut -f1 -d"T" | ||
else | ||
Comment on lines
-37
to
-39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've deleted this date parsing because it allows something like |
||
# remove fractions of a second | ||
TIMESTAMP_TO_CONVERT=$(echo $1 | cut -f1 -d".") | ||
OUTPUT_DATE=$("$DATE_CMD" -d @$TIMESTAMP_TO_CONVERT +'%Y-%m-%d') | ||
echo $OUTPUT_DATE | ||
fi | ||
# if date comes from cli v2 in format like 2020-04-29T10:13:09.191000-04:00, which is ISO8601 | ||
|
||
# remove fractions of a second | ||
TIMESTAMP_TO_CONVERT=$(cut -f1 -d"." <<< "${1}") | ||
OUTPUT_DATE=$("${DATE_CMD}" -d @"${TIMESTAMP_TO_CONVERT}" +'%Y-%m-%d') | ||
echo "${OUTPUT_DATE}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this echo really needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's the way to return the |
||
} | ||
bsd_timestamp_to_date() { | ||
# if date comes from cli v2 in format like 2020-04-29T10:13:09.191000-04:00 | ||
# we have to get only '%Y-%m-%d' | ||
if [[ $1 = 20* ]];then | ||
echo $1 | cut -f1 -d"T" | ||
else | ||
Comment on lines
-49
to
-51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've deleted this date parsing because it allows something like |
||
# remove fractions of a second | ||
TIMESTAMP_TO_CONVERT=$(echo $1 | cut -f1 -d".") | ||
OUTPUT_DATE=$("$DATE_CMD" -r $TIMESTAMP_TO_CONVERT +'%Y-%m-%d') | ||
echo $OUTPUT_DATE | ||
fi | ||
# if date comes from cli v2 in format like 2020-04-29T10:13:09.191000-04:00, which is ISO8601 | ||
|
||
# remove fractions of a second | ||
TIMESTAMP_TO_CONVERT=$(cut -f1 -d"." <<< "${1}") | ||
OUTPUT_DATE=$("${DATE_CMD}" -jf %Y-%m-%d "${TIMESTAMP_TO_CONVERT}" +%F 2>/dev/null) | ||
echo "${OUTPUT_DATE}" | ||
} | ||
|
||
gnu_decode_report() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about imported certificates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It checks every ACM certificate whether it is Amazon Issued, Imported or comes from a Private PKI.
For that reason we have included two filters:
ACM_KEY_TYPES
: to set the algorithms that can be used to generate key pairs.ACM_CERTIFICATE_STATUSES
: to only check ACM Certificates whose status isISSUED
. The following statuses are not checked: