Skip to content

awslogs: Update aws-sdk-go to support IMDSv2#40474

Merged
AkihiroSuda merged 1 commit intomoby:masterfrom
samuelkarp:aws-sdk-go
Feb 8, 2020
Merged

awslogs: Update aws-sdk-go to support IMDSv2#40474
AkihiroSuda merged 1 commit intomoby:masterfrom
samuelkarp:aws-sdk-go

Conversation

@samuelkarp
Copy link
Copy Markdown
Member

- What I did
AWS recently launched a new version of the EC2 Instance Metadata Service, which is used to provide credentials to the awslogs driver when running on Amazon EC2. This new version of the IMDS adds defense-in-depth mechanisms against open firewalls, reverse proxies, and SSRF vulnerabilities and is generally an improvement over the previous version. An updated version of the AWS SDK is able to handle the both the previous version and the new version of the IMDS and functions when either is enabled.

More information about IMDSv2 is available at the following links:

Closes #40422

- How I did it

  • Updated the dependency on github.com/aws/aws-sdk/go
  • Updated the transitive dependency on github.com/jmespath/go-jmespath
  • Removed unused dependency github.com/go-ini/ini

- How to verify it

  1. Run an EC2 instance with IMDSv1 disabled. This can be set at launch time via a parameter to the RunInstances API, or can be set after an instance has already launched via the ModifyInstanceMetadataOptions API.
  2. Ensure that the instance has an IAM profile allowing it to write to CloudWatch Logs.
  3. Install this updated version of Docker
  4. Run a container with the awslogs driver and ensure that it writes to CloudWatch Logs successfully

- Description for the changelog

awslogs: Update aws-sdk-go to support IMDSv2

AWS recently launched a new version of the EC2 Instance Metadata
Service, which is used to provide credentials to the awslogs driver when
running on Amazon EC2.  This new version of the IMDS adds
defense-in-depth mechanisms against open firewalls, reverse proxies, and
SSRF vulnerabilities and is generally an improvement over the previous
version.  An updated version of the AWS SDK is able to handle the both
the previous version and the new version of the IMDS and functions when
either is enabled.

More information about IMDSv2 is available at the following links:

* https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html

Closes moby#40422

Signed-off-by: Samuel Karp <skarp@amazon.com>
Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

@samuelkarp Does this introduce user-facing changes? (new log-driver options to be documented in https://github.com/docker/docker.github.io/blob/629a147a65494cee7172072889dfffebc46071d2/config/containers/logging/awslogs.md)?

@samuelkarp
Copy link
Copy Markdown
Member Author

@thaJeztah There are no new log-driver options. This change makes automatic credential retrieval on EC2 work in more situations, without requiring the user to do anything. The existing Credentials section of that doc is not very detailed; unless we want to rewrite it entirely I don't believe it needs to be updated.

@thaJeztah
Copy link
Copy Markdown
Member

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable support for AWS imdsv2 by upgrading aws-sdk version

4 participants