Skip to content

Conversation

lavignes
Copy link
Member

@lavignes lavignes commented Jan 8, 2019

grpc: Add AWS IAM grpc credentials extension

Description: As part of leveraging Envoy in AWS App Mesh, we implemented a gRPC credentials extension that uses AWS IAM auth. Our original implementation added a dependency on the AWS SDK and libcurl to Envoy. This implementation leverages components within Envoy to fetch credentials from various sources and sign xDS requests for communicating with our App Mesh envoy management server. There are a few more details in #5215.
The request signer and credential providers themselves are reusable components that could be used to implement other extensions that need to authenticate with AWS services.
Risk Level: Medium
Testing: Added unit tests, + manual testing. Planning to add an integration test on the extension.
Docs Changes: Added in new protos.
Release Notes: Added line about added extension.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Scott LaVigne <lavignes@amazon.com>
@htuch htuch self-assigned this Jan 9, 2019
@htuch
Copy link
Member

htuch commented Jan 9, 2019

@lavignes thanks for this contribution. I have two high level structural comments before diving into the detail:

  1. Does source/common/aws belong in extensions instead, given this is a gRPC credential extension?
  2. The PR is a great WiP and reference, but for review I'd like this to be broken down into separate PRs. Small PRs are great for all the usual reasons, we'll be able to merge your code faster, review faster and be happier as maintainers if we can do that. Can you propose a patch series to make this happen?

@htuch
Copy link
Member

htuch commented Jan 9, 2019

Also, quick aside; we're about to gain libcurl as a transitive dependency necessary for OpenCensus, see #5387.

@ggreenway
Copy link
Member

Does source/common/aws belong in extensions instead, given this is a gRPC credential extension?

+1 to this. This should definitely live in extentions, with appropriate interfaces for common code to use it.

@lavignes
Copy link
Member Author

@htuch

Does source/common/aws belong in extensions instead, given this is a gRPC credential extension?

This is a result of the earlier version of this code. We had to make changes to Main to initialize the AWS SDK. Easy enough to move to source/extensions. I think there is potential to use some of these classes outside of just this extension. So that was also part of the reasoning.

I'd like this to be broken down into separate PRs... Can you propose a patch series to make this happen?

Yeah. I honestly didn't realize how big this got until I was preparing the PR. I totally agree. How about:

  1. PR for adding the AWS signer impl and the interfaces of its dependencies.
  2. PR for the AWS IAM credential provider impls and the interface for the HTTP client.
  3. PR for the HTTP client impl. Im definitely interested in using curl if possible.
  4. PR for the actual AWS IAM grpc creds extension

?

@htuch
Copy link
Member

htuch commented Jan 11, 2019

@htuch

Does source/common/aws belong in extensions instead, given this is a gRPC credential extension?

This is a result of the earlier version of this code. We had to make changes to Main to initialize the AWS SDK. Easy enough to move to source/extensions. I think there is potential to use some of these classes outside of just this extension. So that was also part of the reasoning.

There are common directories under source/extensions that might suit this if you want to reuse across extensions, e.g. you could have source/extensions/filters/http/common/aws for cross-extension common code.

I'd like this to be broken down into separate PRs... Can you propose a patch series to make this happen?

Yeah. I honestly didn't realize how big this got until I was preparing the PR. I totally agree. How about:

  1. PR for adding the AWS signer impl and the interfaces of its dependencies.
  2. PR for the AWS IAM credential provider impls and the interface for the HTTP client.
  3. PR for the HTTP client impl. Im definitely interested in using curl if possible.
  4. PR for the actual AWS IAM grpc creds extension

?

This seems a reasonable breakdown, thanks.

As an aside, I'm curious if you folks through about making the Envoy independent parts a standalone library that other projects could consume (who don't need the full AWS SDK). The upside if you do that is you don't need us to review that code and get more reuse ;) OTOH, it seems reasonably scoped for an extension if it's not going to grow a ton, so happy to review as is.

@lavignes lavignes closed this Jan 14, 2019
htuch pushed a commit that referenced this pull request Jan 23, 2019
As part of leveraging Envoy in AWS App Mesh, we implemented a gRPC credentials extension that uses AWS IAM auth. To be able to use authenticate gRPC requests with AWS IAM credentials, we needed to add a code to Envoy to sign HTTP requests. More high-level details in #5215.

I opened up a prior PR: #5546 which was admittedly too large and unwieldy. This is part 1 of a series of smaller patches needed to add our gRPC authentication extension to Envoy.

Risk Level: Low
Testing: Unit tests for this API. This has also been verified to work when communicating with App Mesh.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Jan 24, 2019
As part of leveraging Envoy in AWS App Mesh, we implemented a gRPC credentials extension that uses AWS IAM auth. To be able to use authenticate gRPC requests with AWS IAM credentials, we needed to add a code to Envoy to sign HTTP requests. More high-level details in envoyproxy#5215.

I opened up a prior PR: envoyproxy#5546 which was admittedly too large and unwieldy. This is part 1 of a series of smaller patches needed to add our gRPC authentication extension to Envoy.

Risk Level: Low
Testing: Unit tests for this API. This has also been verified to work when communicating with App Mesh.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>

Signed-off-by: Dan Zhang <danzh@google.com>
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Jan 31, 2019
As part of leveraging Envoy in AWS App Mesh, we implemented a gRPC credentials extension that uses AWS IAM auth. To be able to use authenticate gRPC requests with AWS IAM credentials, we needed to add a code to Envoy to sign HTTP requests. More high-level details in envoyproxy#5215.

I opened up a prior PR: envoyproxy#5546 which was admittedly too large and unwieldy. This is part 1 of a series of smaller patches needed to add our gRPC authentication extension to Envoy.

Risk Level: Low
Testing: Unit tests for this API. This has also been verified to work when communicating with App Mesh.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>

Signed-off-by: Scott LaVigne <1406859+lavignes@users.noreply.github.com>
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
As part of leveraging Envoy in AWS App Mesh, we implemented a gRPC credentials extension that uses AWS IAM auth. To be able to use authenticate gRPC requests with AWS IAM credentials, we needed to add a code to Envoy to sign HTTP requests. More high-level details in envoyproxy#5215.

I opened up a prior PR: envoyproxy#5546 which was admittedly too large and unwieldy. This is part 1 of a series of smaller patches needed to add our gRPC authentication extension to Envoy.

Risk Level: Low
Testing: Unit tests for this API. This has also been verified to work when communicating with App Mesh.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
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.

3 participants