-
Notifications
You must be signed in to change notification settings - Fork 617
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
[barbican-kms-plugin] Pass KeyId to EncryptResponse #2535
Conversation
|
Welcome @GlassOfWhiskey! |
Hi @GlassOfWhiskey. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
Please fix the release note in the PR description and best if you'll use the repo template. |
What are the symptoms of not sending the keyId? |
The ValidateKeyID check fails and the KMS does not encrypt secrets. |
Added |
Anything else to do here? |
I do not have any exp with kms in openstack |
Hi @dulek , |
Unfortunately yes, we tend to try to have at least two reviews before merging and personally I never used Barbican KMS, so don't feel confident enough to accept this. Also there's not Barbican KMS CI either. I'm trying to deploy this now myself, once I confirm this works as expected I'll merge the patch. It'll probably be tomorrow morning. |
@GlassOfWhiskey: So after quite a lot of fighting I deployed this on my env and tried version with and without your patch. Peaking into the DB I can see that in both cases data is saved encrypted and also K8s is able to decrypt it. I understand the protobuf definition mismatch here, but I'd like to actually see the error you're describing. How do I get to this? |
Hi @dulek, This is the apiVersion: v1
kind: EncryptionConfig
resources:
- providers:
- kms:
apiVersion: v2
endpoint: unix:///root/kms/kms.sock
name: barbican
timeout: 10s
- identity: {}
resources:
- secrets And this is the apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
cdk-addons: 'true'
cdk-restart-on-ca-change: 'true'
k8s-app: barbican-kms
name: barbican-kms
namespace: kube-system
spec:
selector:
matchLabels:
k8s-app: barbican-kms
template:
metadata:
labels:
k8s-app: barbican-kms
spec:
containers:
- args:
- /bin/barbican-kms-plugin
- --socketpath=$(KMS_ENDPOINT)
- --cloud-config=$(CLOUD_CONFIG)
env:
- name: CLOUD_CONFIG
value: /etc/config/cloud.conf
- name: KMS_ENDPOINT
value: /root/kms/kms.sock
image: alphaunito/barbican-kms-plugin:v1.29.0
livenessProbe:
exec:
command:
- ls
- $(KMS_ENDPOINT)
failureThreshold: 5
initialDelaySeconds: 10
periodSeconds: 60
timeoutSeconds: 10
name: barbican-kms
volumeMounts:
- mountPath: /etc/config
name: cloud-config-volume
- mountPath: /root/kms/
name: socket-dir
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/control-plane: ''
serviceAccountName: cloud-controller-manager
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
value: 'true'
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
volumes:
- name: cloud-config-volume
secret:
secretName: cloud-config
- hostPath:
path: /root/kms/
type: DirectoryOrCreate
name: socket-dir
updateStrategy:
type: RollingUpdate The |
/approve Okay, I think I observed the problem. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dulek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#2561 is also a result of this investigation. |
What this PR does / why we need it:
The
KMSv2
API requires to pass the remoteKeyID
in theEncryptResponse
object. Indeed, the documentation of theEncryptResponse
ProtoBuf object says:This PR implements this requirement in the Barbican KMS Plugin.
Release note: