Open pgr1mard opened 8 months ago
🤖
Based on your description, it seems like the issue is related to the way KSOPS is interacting with the Azure CLI session. KSOPS relies on SOPS for decryption, and SOPS supports various KMS providers including Azure Key Vault.
To resolve this issue, you can follow these steps:
az login --use-device-code
.az login
is active and that the Azure CLI can access the required Azure resources..sops.yaml
configuration file is correctly set up to use Azure Key Vault for decryption. This involves specifying the Azure Key Vault details under the creation_rules
section with the appropriate azure_keyvault
field. Here is an example configuration:creation_rules:
- azure_keyvault: "azure-keyvault-name"
kustomize build --enable-alpha-plugins
. This typically includes AZURE_TENANT_ID
, AZURE_CLIENT_ID
, and AZURE_CLIENT_SECRET
for service principal authentication or ensuring that the Azure CLI is logged in to the correct account if using user-based authentication.az login
before attempting to run kustomize build --enable-alpha-plugins
.By ensuring that SOPS is configured to use Azure Key Vault and that the Azure CLI session is correctly authenticated and recognized, KSOPS should be able to decrypt the resources using the session created by az login --use-device-code
. Remember, this approach requires that the encryption keys used by SOPS for encrypting the resources are stored in Azure Key Vault and that the correct permissions are set for the Azure service principal or user account to access these keys.
If you're still encountering issues after following these steps, could you provide more details about your setup? Specifically, it would be helpful to know more about your .sops.yaml
configuration, the exact error message you're seeing when you try to run kustomize build --enable-alpha-plugins
, and any other relevant details about your Azure CLI and KSOPS configurations.
With sops, we can doing a "az login --use-device-code", and therefore use the command sops -d file to decrypt the content of that file.
However, with ksops, doing "az login --use-device-code" and after doing kustomize build overlay --enable-alpha-plugins doesnt work because it seem sops doesnt recognize the session open with az login --use-device-code executed before.
We would try to execute kustomize build --enable-alpha-plugins with ksops without azure service principal configured with environnement variables.