-
Notifications
You must be signed in to change notification settings - Fork 42
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(core): windows cloudwatch agent install script #296
Conversation
packages/aws-rfdk/lib/core/scripts/powershell/configureCloudWatchAgent.ps1
Outdated
Show resolved
Hide resolved
# Download Amazon's public key and import it to GPG's keyring | ||
$cloudwatch_pub_key = "$env:temp\amazon-cloudwatch-agent.gpg" | ||
Read-S3Object -BucketName amazoncloudwatch-agent -Key assets/amazon-cloudwatch-agent.gpg -File $cloudwatch_pub_key -Region us-east-1 | ||
gpg --import $cloudwatch_pub_key |
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.
Mind modifying this to use a temporary keyring instead of mutating the default keyring?
See the --no-default-keyring
option usage in:
GPG_IMPORT_OUT=$(gpg --no-default-keyring --keyring ./keyring.gpg --import amazon-cloudwatch-agent.gpg 2>&1) |
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.
Updated.
Exit 1 | ||
} | ||
# Checksum information found at https://gnupg.org/download/integrity_check.html | ||
$sha1 = Get-FileHash $gpg_installer -Algorithm SHA1 |
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.
sha1 is considered to be insecure due to vulnerability to collision attacks; sha256 is more secure.
Mind manually calculating the sha256 of an installer that you've verified, and putting a sha256 check in here instead?
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.
Updated.
0853f7b
to
0d64add
Compare
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.
Great work. Thanks David!
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.
Just a couple of nitpicks, otherwise looks good. Thanks for fixing this!
packages/aws-rfdk/lib/core/scripts/powershell/configureCloudWatchAgent.ps1
Outdated
Show resolved
Hide resolved
packages/aws-rfdk/lib/core/scripts/powershell/configureCloudWatchAgent.ps1
Outdated
Show resolved
Hide resolved
0d64add
to
c1136e8
Compare
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.
Looks good, thanks!
Fixes #295 This fixes a bug that is preventing the deployment of any worker instance that is using an AMI with a Windows OS.
c1136e8
to
b808303
Compare
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.
Thanks David. Let's do a fast-follow to update the Linux script to add the "already installed" check to it.
Fixes #295
This fixes a bug that is preventing the deployment of any worker
instance that is using an AMI with a Windows OS.
To test this fix, I modified the All-In-AWS-Infrastructure-Basic example app to deploy a Windows worker fleet and made sure it could properly deploy.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license