Azure / kubernetes-keyvault-flexvol

Azure keyvault integration with Kubernetes via a Flex Volume
MIT License
253 stars 83 forks source link

Sanitise error messages #127

Closed timja closed 4 years ago

timja commented 4 years ago

Reason for Change: Fixes no access to vault error not showing up in pod description

Issue Fixed: Fixes https://github.com/Azure/kubernetes-keyvault-flexvol/issues/121

Notes for Reviewers: To test it remove your SP from the access policy on the vault Recreate your pod

After this change when you describe the pod you should see something like:

  Warning  FailedMount  86s (x17 over 20m)  kubelet, kind-control-plane  MountVolume.SetUp failed for volume "test" : mount command failed, status: Failure, reason: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/azure~kv/azurekeyvault-flexvolume failed, Access denied. Caller was not found on any access policy. Caller: appid=****;oid=****;numgroups=0;iss=https://sts.windows.net/****/ Vault: ****;location=uksouth InnerError={code:AccessDenied}