Skip to content

Release v1.2.1 #271

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

Merged
merged 11 commits into from
Sep 25, 2020
Merged

Release v1.2.1 #271

merged 11 commits into from
Sep 25, 2020

Conversation

dljvette
Copy link
Contributor

Issue #, if available:
#228

Description of changes:
Changed: Upgraded AWS Ruby SDK dependency from v2 to v3.
Added: Support for IMDSv2. Includes a silent fallback to IMDSv1 if IMDSv2 http requests fail.
Changed: Updated Rake and Rubyzip dependencies for security patches.
Fixed: Ensure that an empty PID file will return a status of No CodeDeploy Agent Running and clean up the PID file on agent start.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

saketu-aws and others added 11 commits September 23, 2020 14:02
Prior to this change, the Agent was using aws sdk ruby v2. That version had a method called Seahorse::Util.underscore(), which was used in the Agent. We are in the process of upgrading the agent to use v3 of the SDK, in which that method does not exist.

This change replaces that Seahorse::Util.underscore() method call with a newly created method that does the same thing. I also added validation to make sure the commands being passed in to the underscore method call were in the PascalForm, as that is what the Agent commands are always in. We need this update so that when we upgrade to v3, the code will be compatible.

 * Unit Tests : [Y]
 * Integration Tests : [N]

Seahorse::Util.underscore method: https://www.rubydoc.info/gems/aws-sdk-core/2.9.44/Seahorse%2FUtil.underscore
…de to v3

Prior to this change, the ruby sdk v3 did not include the Aws.add_service method, which we used inside the agent. The ruby sdk v3 also split up the aws service clients into separate gems.

This change replaces the Aws.add_service method with the implementation found in the AwsSdkRubyCodeGenWrapper
It also includes the aws-sdk-s3 gem to replace all of the dependencies on 'aws-sdk-core/s3' with 'aws-sdk-s3'.

 * Unit Tests : [Y]
 * Integration Tests : [N]
Prior to this change, agent could not run on an instance due to the conflict of version 2.9 in gemspec

This change fixes the said issue by changing the version of AWS SDK in the gemspec.

 * Unit Tests : N
 * Integration Tests : N
 This was tested by installing the agent on an instance and ensuring it was able to run smoothly.
Prior to this change, when retrieving instance metadata, the agent used IMDSv1. There is an escalation to remove all our dependencies on IMDSv1 and update them to use IMDSv2. This is a large ask because of the security vulnerabilities associated with IMDSv1.

This change updates our agent code to use IMDSv2, which uses a session authentication method for retrieving instance metadata.

 * Unit Tests : [Y]
 * Integration Tests : [N]
 * Successfully tested install script and agent by spinning up an ec2 instance, building the rpm file for the agent using RBHAInstaller, and deploying a sample application via CodeDeploy console to that instance.
version due to security issues.

Prior to this change, Rake and Rubyzip were at older versions that had
issues that alerted the Dependabot on GitHub.

This change upgrades those said packages to the newer versions.

 * Unit Tests : Y
 * Integration Tests : Y
 Unit and Integration tests passed with the upgraded versions.`
Prior to this change, an empty PID file would cause the status method to return that the agent was running at PID 0.

This change ensures that an empty PID file will return a status of No
CodeDeploy Agent Running and clean up the PID file.

 * Unit Tests : Y
 * Integration Tests : N
Prior to this change, there was no logic for falling back to IMDSv1 if IMDSv2 calls failed.

This change adds fallbacks to IMDSv1 if calls fail.

 * Unit Tests : [Y]
 * Integration Tests : Successfully had a CodeDeploy deployment using this agent.
…ide IMDSv2 class

Prior to this change, the logging statements inside the IMDSv2 class were being nil for some reason, which caused the install and update scripts to fall back to pulling the agent from the us-east-1 default region, which is not the expected behavior.

This change removes those log statements so we don't hit that error.

 * Unit Tests : [Y]
 * Integration Tests : Manually spun up an instance, caused the IMDSv2 call to fail by changing the endpoint for the token, and the install script worked as expected.
Prior to this change, there was a bug in the aws-sdk-code-generator ruby gem that caused it to not work on Windows. The fix for that issue was put up and then a new version of the gem was released that included that.

This change updates our dependency on aws-sdk-code-generator to use the now fixed aws-sdk-code-generator gem.

 * Unit Tests : [Y]
 * Integration Tests : [N/A]
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.794% when pulling 886e895 on dljvette:v1.2.1 into a0e45b6 on aws:master.

@brndnblck brndnblck changed the title Release V1.2.1 Release v1.2.1 Sep 25, 2020
@brndnblck brndnblck merged commit 030bc3a into aws:master Sep 25, 2020
@ottocho ottocho mentioned this pull request Oct 22, 2020
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

Successfully merging this pull request may close these issues.

6 participants