Skip to content
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

Workload Identity requires Access Keys on Azure Storage Account to be enabled #1351

Open
mkemmerz opened this issue Apr 12, 2024 · 4 comments

Comments

@mkemmerz
Copy link

mkemmerz commented Apr 12, 2024

Hello, I have some questions to the Workload Identity feature.

Currently trying out the blob-csi-driver 1.24.1 release together with an AKS 1.29.2. I am not using the microsoft managed blob-csi-driver.

I only got the Workload Identity for blobs running if my Azure Storage Account has access keys enabled. The blob-node pod would print out the following message:
clientID(xxx) is specified, use service account token to get account key

This is in the blob.go

// if client id is specified, we only use service account token to get account key
if clientID != "" {
	klog.V(2).Infof("clientID(%s) is specified, use service account token to get account key", clientID)
	if subsID == "" {
		subsID = d.cloud.SubscriptionID
	}
	accountKey, err := d.cloud.GetStorageAccesskeyFromServiceAccountToken(ctx, subsID, accountName, rgName, clientID, tenantID, serviceAccountToken)
	authEnv = append(authEnv, "AZURE_STORAGE_ACCESS_KEY="+accountKey)
	return rgName, accountName, accountKey, containerName, authEnv, err
}

Azure also shows the access in the Activity log:
image

The Service Account Token should be used to directly access the Storage Account resources I think.
The Workload Identity should allow to disable the access keys and only use RBAC for the Azure Storage Account.
Maybe I missed something here or my setup is not correct or is this intended behaviour?

@andyzhangx
Copy link
Member

andyzhangx commented Apr 12, 2024

this driver would use workload identity to get access keys, if you don't want to use access keys, you could follow this example:
Mount an azure blob storage with a dedicated user-assigned managed identity, while this example dose not use workload identity

@itzikbekelmicrosoft
Copy link

this driver would use workload identity to get access keys, if you don't want to use access keys, you could follow this example: Mount an azure blob storage with a dedicated user-assigned managed identity, while this example dose not use workload identity

Not sure I understood, it should solve the mentioned issue? we have similar setup just like the example in your repository but we still see the MI is used for getting the Storage Key as mentioned by @mkemmerz

Could you please clarify? there is support to mount blob storage using fuse without storage key?

@andyzhangx
Copy link
Member

if you use the example(https://github.com/qxsch/Azure-Aks/tree/master/aks-blobfuse-mi), it would always mount with managed identity auth instead of account key, the key part is AzureStorageAuthType: MSI

    volumeAttributes:
      protocol: fuse
      resourceGroup: aks-fuseblob-mi
      storageAccount: myaksblob
      containerName: mycontainer
      AzureStorageAuthType: MSI
      AzureStorageIdentityObjectID: "xxxxx-xxxx-xxx-xxx-xxxxxxx"

@rohayon
Copy link

rohayon commented Jun 24, 2024

@andyzhangx Thank you we followed the guide and successfully mount blobs. Thanks razo

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

No branches or pull requests

4 participants