-
Notifications
You must be signed in to change notification settings - Fork 245
NO-JIRA: Introduce KMS encryption mode in encryption library #2041
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
base: master
Are you sure you want to change the base?
Conversation
|
@ardaguclu: This pull request explicitly references no jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
3728ed0 to
abef62d
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ardaguclu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4516c9e to
9a0295d
Compare
|
/hold |
34f1117 to
e4ac86e
Compare
e4ac86e to
196d70f
Compare
|
Opened this openshift/cluster-kube-apiserver-operator#1951 to verify in terms of regression |
|
/retest |
ef9f041 to
6d2bd1a
Compare
6d2bd1a to
8b6ff7a
Compare
| return "", nil, fmt.Errorf("failed to generate KMS unix socket path: %w", err) | ||
| } | ||
|
|
||
| kmsClient, err := kms.NewKMSClient(socketPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think depending on the kms plugin to generate the unix socket path creates a fundamental chicken-egg problem where the unix socket path is generated based on a gRPC call to the plugin's Status endpoint, but the plugin requires a unix socket path before it can run. Unless I'm missing something crucial, this simply cannot work... right?
My suggestion is that, for dev preview, we just use the KeyArn from the APIServer config as the key_id. This won't be an issue with the aws kms plugin because the key_id is always matches the KeyArn. This is okay for the aws kms plugin because it does not change the key_id when the key is rotated, so this approach is only good for dev preview. We can refactor it later to something more robust.
What do y'all think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think depending on the kms plugin to generate the unix socket path creates a fundamental chicken-egg problem where the unix socket path is generated based on a gRPC call to the plugin's Status endpoint, but the plugin requires a unix socket path before it can run. Unless I'm missing something crucial, this simply cannot work... right?
Unix path is generated based on the hashsum of kmsconfig. It does not include key_id retrieved from Status endpoint. Otherwise, it would indeed be a chicken-egg problem.
|
@ardaguclu: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
This PR introduces KMS encryption mode into encryption library in library-go. Since there is no keys in KMS, it uses hashsum of KMS Configuration as well as KeyID returned by KMS plugin (by calling an grpc call to
Statusendpoint).This PR relies on the building blocks of encryption library that works for other encryption types.
#1876 was a good attempt. This PR adopts some bits from there.