Skip to content

Conversation

@ardaguclu
Copy link
Member

@ardaguclu ardaguclu commented Oct 25, 2025

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 Status endpoint).

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 25, 2025
@openshift-ci-robot
Copy link

@ardaguclu: This pull request explicitly references no jira issue.

In response to this:

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 Status endpoint).

This PR relies on the building blocks of encryption library that works for other encryption types.

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.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 25, 2025
@openshift-ci openshift-ci bot requested review from p0lyn0mial and tkashem October 25, 2025 14:34
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ardaguclu
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ardaguclu ardaguclu force-pushed the kms-integration branch 6 times, most recently from 4516c9e to 9a0295d Compare October 27, 2025 07:06
@ardaguclu ardaguclu changed the title WIP: NO-JIRA: Introduce KMS encryption mode in encryption library NO-JIRA: Introduce KMS encryption mode in encryption library Oct 27, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 27, 2025
@ardaguclu
Copy link
Member Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 27, 2025
@ardaguclu ardaguclu force-pushed the kms-integration branch 2 times, most recently from 34f1117 to e4ac86e Compare October 27, 2025 08:17
@ardaguclu
Copy link
Member Author

Opened this openshift/cluster-kube-apiserver-operator#1951 to verify in terms of regression
/cc @flavianmissi @dgrisonnet

@ardaguclu
Copy link
Member Author

/retest

return "", nil, fmt.Errorf("failed to generate KMS unix socket path: %w", err)
}

kmsClient, err := kms.NewKMSClient(socketPath)
Copy link
Member

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?

Copy link
Member Author

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 3, 2025

@ardaguclu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/unit 4a45d50 link true /test unit

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.

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants