Skip to content
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

Inspector Report requires aws configure tweak to run on cli v2 #6

Open
gdelisle opened this issue Jul 12, 2024 · 0 comments
Open

Inspector Report requires aws configure tweak to run on cli v2 #6

gdelisle opened this issue Jul 12, 2024 · 0 comments

Comments

@gdelisle
Copy link
Contributor

I just ran into this migrating the ct-patching-scanning Jenkins jobs from a host where awscli v1 was installed to a host where awscli v2 is installed. Running the Inspector Report gave me this console error:
date: invalid date ‘@2024-07-08T12:08:26.315000-04:00’

This isn't a problem with the date command, but a breaking change in date format output between aws cli v1 and v2:
https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html#cliv2-migration-timestamp
By default, all dates returned to the cli are reformatted into ISO 8601 format. The fix is to configure your aws cli tool with cli_timestamp_format = wire and there is no environment variable or command line option to do this. I can confirm that this config file option fixed the script for me without the need to change any code.

If a fix is desired, it could be along the lines of conditionally removing the prefixed @ from the date input; while this gives an error:
date --date='@2024-07-08T11:00:02.414000-04:00'
this works fine:
date --date='2024-07-08T11:00:02.414000-04:00'
That might be desired for the long term, since the "wire" option only refrains from reformatting the date stamp that's delivered from the inspector service. If a future update to the inspector service outputs the date in ISO 8601 format, the config file option won't fix the format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant