Skip to content

feat: add byok support and refactor #66

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

Merged
merged 2 commits into from
Feb 5, 2021
Merged

feat: add byok support and refactor #66

merged 2 commits into from
Feb 5, 2021

Conversation

aramase
Copy link
Member

@aramase aramase commented Nov 20, 2020

Reason for Change:

  • Adds flags to support BYOK scenario
  • Switches to using protodef from k8s.io/apiserver
  • Switches to klog for logging

Issue Fixed:

fixes #55
fixes #59
fixes #63

Notes for Reviewers:

@aramase
Copy link
Member Author

aramase commented Jan 16, 2021

Sample log:

➜ kubectl logs azure-kms-provider-k8s-master-20554482-0 -n kube-system -f
I0116 01:22:12.188341       1 main.go:56] "Starting KeyManagementServiceServer service" version="byok01" buildDate="2021-01-15-17:12"
I0116 01:22:12.386847       1 keyvault.go:133] "using kms key for encrypt/decrypt" vaultName="aokvrjbpab47fxymu" keyName="k8s" keyVersion="262067a9e8ba401aa8a746c5f1a7e147"
I0116 01:22:12.387447       1 main.go:82] Listening for connections on address: /opt/azurekms.socket
I0116 01:23:38.736659       1 server.go:56] encrypt request complete
I0116 01:23:42.818829       1 server.go:56] encrypt request complete
I0116 01:23:50.169612       1 server.go:56] encrypt request complete


func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
klog.V(2).Infof("GRPC call: %s", info.FullMethod)
klog.V(2).Infof("GRPC request: %v", req)
Copy link
Member

Choose a reason for hiding this comment

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

we should increase the verbosity of these logs as it can contain sensitive data. we should also see if we need to mask anything here.

Copy link
Member Author

Choose a reason for hiding this comment

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

The request and response for this doesn't contain much information other than the plain and cipher text. Both are information that we don't want to log at any levels. So I've removed that and added logs in the methods to log start and end.

@aramase
Copy link
Member Author

aramase commented Jan 25, 2021

@ritazh I've taken another pass to add more appropriate logs with redacted client information. PTAL when you get a chance.

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

Finally we have BYOK! 🎉

@aramase aramase merged commit 75eb433 into Azure:master Feb 5, 2021
@aramase aramase deleted the byok branch February 5, 2021 17:59
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.

cleanup: Use proto def from k8s.io/apiserver Switch to using klog for logging instead of fmt BYOK support
2 participants