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

fix(core): windows cloudwatch agent install script #296

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

horsmand
Copy link
Contributor

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

@jusiskin jusiskin added the contribution/core This is a PR that came from AWS. label Jan 22, 2021
# 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
Copy link
Contributor

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)

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@horsmand horsmand force-pushed the cloudwatch-install-fix branch 2 times, most recently from 0853f7b to 0d64add Compare January 22, 2021 18:02
ddneilson
ddneilson previously approved these changes Jan 22, 2021
Copy link
Contributor

@ddneilson ddneilson left a 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!

Copy link
Contributor

@jericht jericht left a 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!

jericht
jericht previously approved these changes Jan 22, 2021
Copy link
Contributor

@jericht jericht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

ddneilson
ddneilson previously approved these changes Jan 22, 2021
@ddneilson ddneilson self-requested a review January 22, 2021 21:48
Fixes #295

This fixes a bug that is preventing the deployment of any worker
instance that is using an AMI with a Windows OS.
Copy link
Contributor

@ddneilson ddneilson left a 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.

@ddneilson ddneilson merged commit 478afce into aws:mainline Jan 22, 2021
@horsmand horsmand deleted the cloudwatch-install-fix branch January 25, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows worker fleets failing to start
4 participants