-
Notifications
You must be signed in to change notification settings - Fork 30
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
Azure workload identity needs to be setup in podLabels which isn't currently possible. #190
Comments
merged, please let me know if that fixes the issue |
@isindir YES! That does fix the issue! Now I'm able to decrypt using Azure Workload identity. Thanks you 🙏 no I only have the problem that the actual secrets are not produced, have no idea why. |
@isindir well, I might have spoken to early, it does solve one problem (that the token isn't mounted), but I still have issues with the decryption. I'll be back once I know what is going on. |
@isindir Okay, so there is another part to this puzzle. In order to azure to be able to authorize the Workload Identity it is expecting a specific Service Account name. So In order to fix this I would also need to actually set the ServiceAccountName in the deployment. This is the part of the error that has this clue: "AADSTS700213: No matching federated identity record found for presented assertion subject 'system:serviceaccount:sops:sops-sops-secrets-operator'" Full error:
|
I have used it with azure fairly long time ago, but from this documentation:
From error message I catch following:
Later suggests that some cloud configuration bit is missing for Kubernetes service account - it is not authorised to fetch token. in AWS EKS on service account there should be set an annotation like please check also https://learn.microsoft.com/en-gb/entra/workload-id/workload-identity-federation |
Yeah, Azure is fun... What you’re seeing is 3 methods for authentication:
Which requires environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET. This is the only one of the three methods that requires a password, with AZURE_CLIENT_SECRET serving as that credential. Service Principal credentials typically have an expiration date, so at some point, the password will stop working unless it’s rotated, which can make this method inconvenient for long-term production use. It’s useful in development or scenarios where secret management is feasible, but I generally avoid it in production if I can use a password-free option. In your scenario, this will work if all the variables are set, so this is supported already.
This approach doesn’t need a password but does require a In your scenario, this is partly required as the pod label now is allowed, but it also requires that the service account can be pointed to instead of created.
also doesn’t require a password and allows access to Azure resources at the node level. For System-Assigned Managed Identity, it’s enabled by default on AKS nodes, so no additional pod configuration is needed. For User-Assigned Managed Identity, you’ll need to create the identity in Azure, assign it the necessary permissions, and then add the annotation In your scenario, this should also work as the annotations for the pods was already there. In this case, it might make sense to use a Managed identity, but I since I don't own this cluster, I cannot set it up. So I need the workload identity. Also, if I do template out the resources and add them instead of using the charts and use the existing service account it does work. |
Ok, so the requirement is :
|
Yes, Workload, needs pod labels (which you fixed earlier) and to set the service account (which is lacking today). The other should be possible with what is there today! |
@isindir the deployment needs to point to the ServiceAccountName of my choosing, not sure it did? Doing too many things at the same time :-( Sorry about that. |
I think I covered that already: https://github.com/isindir/sops-secrets-operator/pull/192/files#diff-db6b1ba4bcca23297327a6daa538c0fd9a8261ba3ca11b7dce5a749c8b9d866eR32 what you need to do is disable sa and specify name of your own sa via values see: |
Perfect! Then it should work. :-) |
It works now - Thank you for your swift response 🙏 |
In order to use Azure Workload identity, I have to be able to set a label on the pod (azure.workload.identity/use: "true") but currently I'm only able to set annotations on the pods, so I cannot use the helm chart, but have to setup the manifests manually.
The text was updated successfully, but these errors were encountered: