Skip to content

Handle PrivateKeyProvider configuration#37681

Merged
istio-testing merged 13 commits intoistio:masterfrom
rveerama1:private-key-provider
Mar 31, 2022
Merged

Handle PrivateKeyProvider configuration#37681
istio-testing merged 13 commits intoistio:masterfrom
rveerama1:private-key-provider

Conversation

@rveerama1
Copy link
Copy Markdown
Member

@rveerama1 rveerama1 commented Mar 3, 2022

Please provide a description of this PR:

When the PrivateKeyProvider configuration information is provided through Istio operator yaml file, parse and pass it to gateway or sidecars. Envoy will act based on the information provided by the configuration.

To set the mesh wide defaults, configure the defaultConfig section of meshConfig.
For example:

meshConfig:
  defaultConfig:
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

This can also be configured on a per-workload basis by configuring the proxy.istio.io/config
annotation on the pod.
For example:

annotations:
  proxy.istio.io/config: |
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

This requires istio/api#2261

@istio-policy-bot
Copy link
Copy Markdown

😊 Welcome @rveerama1! This is either your first contribution to the Istio istio repo, or it's been
awhile since you've been here.

You can learn more about the Istio working groups, code of conduct, and contributing guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test labels Mar 3, 2022
@istio-testing
Copy link
Copy Markdown
Collaborator

Hi @rveerama1. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Copy Markdown
Member

@Arhell Arhell left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Mar 4, 2022
@rveerama1 rveerama1 requested review from a team as code owners March 4, 2022 10:47
@rveerama1
Copy link
Copy Markdown
Member Author

As it depends upon api changes, build fails. I will move to WIP.

@rveerama1 rveerama1 changed the title Handle PrivateKeyProvider configuration [WIP] Handle PrivateKeyProvider configuration Mar 4, 2022
@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Mar 4, 2022
@rveerama1 rveerama1 force-pushed the private-key-provider branch 2 times, most recently from 3ad09e4 to 5adfa5d Compare March 16, 2022 06:45
@rveerama1 rveerama1 changed the title [WIP] Handle PrivateKeyProvider configuration Handle PrivateKeyProvider configuration Mar 16, 2022
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Mar 16, 2022
@rveerama1
Copy link
Copy Markdown
Member Author

rveerama1 commented Mar 16, 2022

@howardjohn @jacob-delgado @ericvn PTAL about implementation of istio/api#2261 private key provider addition.

@rveerama1
Copy link
Copy Markdown
Member Author

/retest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this has quite some duplicate code as the other toEnvoyKeyCertSecretWithPrivateKeyProvider(), could we refactor and try to share the common logic

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It has some, but not completely. Anyway I am working on QAT private key provider extension support. I will fine tune in that PR.

Copy link
Copy Markdown
Contributor

@yangminzhu yangminzhu Mar 17, 2022

Choose a reason for hiding this comment

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

Just some general questions

  1. Regarding the PrivateKeyProvider extension, is it actually providing any private key? The name is a bit confused to me because based on the PR and my understanding, it does not provide any private key but is just a new type (cryptomb) to wrap the TLS config that tells Envoy to process it with some hardware assisted acceleration?

  2. How are you going to e2e test the feature if it requires some special hardware support?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. Regarding the PrivateKeyProvider extension, is it actually providing any private key? The name is a bit confused to me because based on the PR and my understanding, it does not provide any private key but is just a new type (cryptomb) to wrap the TLS config that tells Envoy to process it with some hardware assisted acceleration?

Name is bit confusing, but I tried to sync with Envoy naming pattern https://github.com/envoyproxy/envoy/tree/main/api/contrib/envoy/extensions/private_key_providers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think there are two things which can be e2e tested. One is the functionality of setting a private key provider configuration to Envoy, and the other is a specific private key provider such as CryptoMB.

The first case is probably not too bad -- for example Envoy uses a software-only private key provider for testing the interfaces (https://github.com/envoyproxy/envoy/blob/main/test/extensions/transport_sockets/tls/test_private_key_method_provider.cc) and we could do something similar. The test private key provider isn't exposed by Envoy though, but that code could probably be used or reimplemented by istio/proxy test/envoye2e directory.

The second case (CryptoMB) is tricky because that will indeed require a very modern Xeon processor. An e2e test could be written but it should be behind a switch, and we need to understand if it's possible to make the CI tests run in an environment which supports AVX-512. @yangminzhu do you have any suggestions how this could be accomplished?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the detail explanation, the naming part is a bit confusing but I think it is fine if you could document it clearly in the code and documentation so that other users does not confuse it with things like Plug in certificate that is really providing its own private/public key to Istio.

Regarding the e2e tests, it would be nice if you can somehow mock the CryptoMB functionality in Envoy then run it like a real e2e test but I have no idea how to do it easily so you probably will end up with tests verifying the Envoy TLS configs generated correctly (but not executing them). Also I have no idea how to require a very modern Xeon processor in the CI environment (it gives you some flexibility in machine type but probably not to the level for custom CPU), @howardjohn might know about about the CI configuration.

@rveerama1 rveerama1 force-pushed the private-key-provider branch from 65390da to 858ea4f Compare March 18, 2022 10:12
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

LGTM once we fix the gateway part, should be small fix

@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Mar 30, 2022
@rveerama1 rveerama1 force-pushed the private-key-provider branch from 776ffcb to 0d7e4ac Compare March 30, 2022 21:25
@howardjohn
Copy link
Copy Markdown
Member

/retest

@jacob-delgado
Copy link
Copy Markdown
Contributor

cc @rveerama1 Looks like you need to re-base, but have the appropriate approvals.

When the PrivateKeyProvider configuration information is provided
through Istio operator yaml file, parse and pass it to gateway or
sidecars. Envoy will act based on the information provided by the
configuration.

To set the mesh wide defaults, configure the `defaultConfig` section of `meshConfig`.
For example:

meshConfig:
  defaultConfig:
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

This can also be configured on a per-workload basis by configuring the `proxy.istio.io/config`
annotation on the pod.
For example:

annotations:
  proxy.istio.io/config: |
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s
@rveerama1 rveerama1 force-pushed the private-key-provider branch from 0d7e4ac to 8a1e306 Compare March 31, 2022 19:48
@rveerama1
Copy link
Copy Markdown
Member Author

thank you, @jacob-delgado @howardjohn fixed the conflicts. can you remove the do-not-merge/hold label

Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Thanks for the great work here!

@howardjohn howardjohn removed the do-not-merge/hold Block automatic merging of a PR. label Mar 31, 2022
@istio-testing istio-testing merged commit 1647479 into istio:master Mar 31, 2022
aryan16 pushed a commit to aryan16/istio that referenced this pull request Apr 8, 2022
* Handle PrivateKeyProvider configuration

When the PrivateKeyProvider configuration information is provided
through Istio operator yaml file, parse and pass it to gateway or
sidecars. Envoy will act based on the information provided by the
configuration.

To set the mesh wide defaults, configure the `defaultConfig` section of `meshConfig`.
For example:

meshConfig:
  defaultConfig:
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

This can also be configured on a per-workload basis by configuring the `proxy.istio.io/config`
annotation on the pod.
For example:

annotations:
  proxy.istio.io/config: |
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

* add release notes

* add validation and tests

* modify according to api change

* address comments

* Fix lint issues

* address comments

* address jacob-delgado and howardjohn comments

* add tests

* use default config

* fix rebase conflicts

* fix config for gateway cert

* fix rebase conflicts
aryan16 pushed a commit to aryan16/istio that referenced this pull request Apr 11, 2022
* Handle PrivateKeyProvider configuration

When the PrivateKeyProvider configuration information is provided
through Istio operator yaml file, parse and pass it to gateway or
sidecars. Envoy will act based on the information provided by the
configuration.

To set the mesh wide defaults, configure the `defaultConfig` section of `meshConfig`.
For example:

meshConfig:
  defaultConfig:
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

This can also be configured on a per-workload basis by configuring the `proxy.istio.io/config`
annotation on the pod.
For example:

annotations:
  proxy.istio.io/config: |
    privateKeyProvider:
      cryptomb:
        pollDelay: 0.01s

* add release notes

* add validation and tests

* modify according to api change

* address comments

* Fix lint issues

* address comments

* address jacob-delgado and howardjohn comments

* add tests

* use default config

* fix rebase conflicts

* fix config for gateway cert

* fix rebase conflicts
@rveerama1
Copy link
Copy Markdown
Member Author

How we do this with other custom integrations is OSS has unit level tests that check the generated XDS is correct. The owner of the platform runs tests on their own system with their own platform to verify it works in the real world.

For example we do this with things like Stackdriver, etc

@howardjohn I am looking into write e2e test setup for this. Need some help.

  1. Are there any existing e2e tests for XDS generation (where it involves envoy also)? If yes I can extend it with this feature.
  2. You mentioned about Stackdriver as an example for custom tests. I searched about telemetry/stackdriver tests about it. Couldn't get complete picture. Can you give some pointers where I can look about e2e tests which require custom hardware?
    or anybody to contact?

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

Labels

area/networking area/security ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants