Skip to content

Conversation

@kksriram
Copy link
Contributor

@kksriram kksriram commented Aug 9, 2017

  • Initial version of Vault KMS Provider
  • Renamed image file to be consistent with spec name
  • Brought spec inline with EnvelopeTransformer interfaces in PR 49350
  • Wrap at 80

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 9, 2017
@kksriram
Copy link
Contributor Author

check CLA again

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 10, 2017
@kksriram
Copy link
Contributor Author

Proposal for Issue kubernetes/kubernetes#49817

@deads2k deads2k added the sig/auth Categorizes an issue or PR as relevant to SIG Auth. label Aug 10, 2017
@deads2k
Copy link
Contributor

deads2k commented Aug 10, 2017

I'm very interested in having a second example of a KMS provider.

@kubernetes/sig-api-machinery-feature-requests @kubernetes/sig-auth-feature-requests

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 10, 2017
@kksriram
Copy link
Contributor Author

This is the same content that was socialized via the google doc at sig-auth 7/27, with a few updates to bring it inline with @sakshamsharma 's changes.

- secrets
providers:
- kms:
name: vault

Choose a reason for hiding this comment

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

Indent the properties of KMS (name, cache size, config file) one more level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

#### Authentication Configuration
##### Vault Server Authentication

For the Kubernetes cluster to authenticate the vault server, if TLS is enabled :
Copy link
Member

Choose a reason for hiding this comment

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

"if TLS is enabled" why optional? let's mandate it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Fixed.

1. ``role-id`` : RoleID of the AppRole
2. ``secret-id`` : secret Id only if associated with the appRole.

Here's a sample configuration file with Vault AppRole
Copy link
Member

Choose a reason for hiding this comment

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

This sample configuration did not render well when i clicked on "view"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

### Pseudocode
#### Prefix Metadata
Every encrypted secret will have the following metadata prefixed.
``k8s:enc:kms:<api-version>:vault:len(<KEK-key-name>:<KEK-key-version>:<DEK
Copy link
Member

Choose a reason for hiding this comment

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

Should all this just be json or yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

performance impact. Hence, depending on the cache size, there will be a
performance impact.
3. Response time.
4. will depend on choice of encryption algorithm and strength.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Choose a reason for hiding this comment

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

Still not fixed. If you look at the file preview, the bullet points are inline and not nested as you wanted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see it. Thanks. Will fix it on the next go around with other comments.

to implement specific providers for each (in K8S).
* Reduced risk of encryption key compromise.
* encryption key is stored and managed in Vault.
* encryption key does not need to leave the Vault.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 15, 2017
@kksriram
Copy link
Contributor Author

@destijl You had a question at sig-auth today whether supporting additional Vault Auth Backends will need code changes.

Right now, of the supported Auth Backends, typically its just the three in the current spec that would be used by system processes. The rest would typically be used by humans (which I think doesn't matter in this particular case).

At first glance, I don't see how we can get away with not changing code when adding other auth backends.

Talking over with @vineet-garg we will need code changes if supporting new auth back-ends beyond what's in the proposal. I would prefer to focus on a small set of auth backends (the ones in the proposal) and get those in first. Based on interest in the community, we can consider supporting others.

key(s) locally in a server configuration file. The provider encrypts and
decrypts secrets in-process. Building upon these, a KMS provider framework with
an option to support different KMS providers like google cloud KMS is being
added via PRs [48574](https://github.com/kubernetes/kubernetes/pull/48575) and
Copy link
Contributor

@hongchaodeng hongchaodeng Aug 24, 2017

Choose a reason for hiding this comment

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

48574

Shouldn't it be kubernetes/kubernetes#48522 ?

Choose a reason for hiding this comment

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

the proposal refers to pull request#(48574), what you posted is corresponding issue#(48522).

role-id: db02de05-fa39-4855-059b-67221c5c2f63
```

## Key Generation and rotation
Copy link
Contributor

Choose a reason for hiding this comment

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

How is DEK generated?

Choose a reason for hiding this comment

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

That is in envelope.generateKey which is part of existing envelope transformer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Worth adding that note to the proposal?

@jcbsmpsn
Copy link

This comment on the Google KMS review will affect your implementation. Basically, the expected direction is to implement these integrations out of the Kubernetes repo. The mechanism to accomplish that does not exist yet.

@liggitt
Copy link
Member

liggitt commented Aug 29, 2017

I still think gaining experience with a small number of encryption providers in-tree is valuable in designing an out of process plugin mechanism.

@kksriram
Copy link
Contributor Author

@jcbsmpsn @liggitt I haven't caught up on the in-tree v out-of-process discussion over on @sakshamsharma PR 48574. FWIW, my colleague @vineet-garg has an implementation for this spec, that should be coming upstream later this week. We could use that to review what the impact is with a second provider.

More after I catch up on the discussion on 48574.

@deads2k
Copy link
Contributor

deads2k commented Sep 19, 2017

@destijl You had a question at sig-auth today whether supporting additional Vault Auth Backends will need code changes.

@destijl the response #888 (comment) looked pretty reasonable as a starting point. Do you have further questions?

@kksriram
Copy link
Contributor Author

I meant to update earlier but slipped my mind. I did catch up on the in-tree vs out-of-tree discussion and the proposal .

I agree with @liggitt earlier comment that gaining experience with a second encryption provider in-tree would help guide the design of the proposal for out-of-tree.

As such, my preference would be to get the Vault code merged after review, as an in-tree provider and then refactor based on what we learn with the out-of-tree proposal.

@deads2k
Copy link
Contributor

deads2k commented Sep 26, 2017

This lgtm. I'm going to see where we'll put it in API machinery, but the KMS plugin structure is unopinionated about whether it is or isn't a cloud provider, so that won't cause any trouble.

@lavalamp
Copy link
Contributor

What new (compile-time) dependencies would be required?

This is not really a sustainable way of developing addons/plugins. I would much rather have a process boundary here. I am slightly persuaded by the argument that we should have two concrete uses before generalizing, but only slightly. I would definitely want an agreement that we would force the next person to want to add one of these to build a cross-process API. We can talk about it at tomorrow's sig meeting.

@deads2k
Copy link
Contributor

deads2k commented Sep 26, 2017

I would definitely want an agreement that we would force the next person to want to add one of these to build a cross-process API.

Assuming this one goes well and doesn't expose fundamental concerns, I'm ok with that. Though I may be inclined to force the existing impls out of tree a release or two later to maintain equal footing.

The KEK is generated in Vault and rotated using direct API call or CLI to Vault
itself. The Key never leaves the vault.

Note that when a key is rotated, Vault does not allow to choose a different
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Vault does not allow to choose/Vault does not allow choosing/g

2. ``key-names`` list of names of the keys in Vault to be used. eg: key-name:
kube-secret-enc-key.

Note : key name does not need to be changed if key is rotated in Vault, the
Copy link
Contributor

Choose a reason for hiding this comment

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

s/if key is/if the key is/

minimum:

1. ``addr`` Vault service base endpoint eg. https://example.com:8200
2. ``key-names`` list of names of the keys in Vault to be used. eg: key-name:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need an API version field for the config here to inform the <api-version> of the metadata listed above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably do. Missed that. Thanks for catching it.

Choose a reason for hiding this comment

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

It is the existing EnvelopeTransformer that is reading the property from configuration file and adding it to metadata, Not the vaultEnvelopeService as mentioned in above : "Of the above metadata..."

@vineet-garg
Copy link

@lavalamp Compile time dependencies:
github.com/ghodss/yaml
github.com/hashicorp/vault/api

* Initial version of Vault KMS Provider

* Renamed image file to be consistent with spec name

* Brought spec inline with EnvelopeTransformer interfaces in PR 49350

* Wrap at 80
@kksriram kksriram force-pushed the for/upstream/master/vault_provider_spec branch from 2841b7b to 526cd08 Compare October 5, 2017 15:56
@deads2k
Copy link
Contributor

deads2k commented Oct 5, 2017

/lgtm

Discussed in sig-auth and sig-apimachinery. This will be the second impl.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue.

@k8s-github-robot k8s-github-robot merged commit badb60e into kubernetes:master Oct 5, 2017
@kksriram kksriram deleted the for/upstream/master/vault_provider_spec branch October 5, 2017 19:37
danehans pushed a commit to danehans/community that referenced this pull request Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. 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.