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

Ksops doesnt recognize az login #231

Open
pgr1mard opened this issue Feb 27, 2024 · 1 comment
Open

Ksops doesnt recognize az login #231

pgr1mard opened this issue Feb 27, 2024 · 1 comment
Labels
kind:bug Something isn't working

Comments

@pgr1mard
Copy link

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.

Copy link

dosubot bot commented Feb 27, 2024

🤖

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:

  1. Ensure that the Azure CLI is installed and correctly configured to use the device code flow with az login --use-device-code.
  2. Verify that the session created by az login is active and that the Azure CLI can access the required Azure resources.
  3. Ensure that your .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"
  1. Make sure that the environment variables required by Azure CLI for authentication are correctly set in the environment where you're running 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.
  2. If you are running this in a CI/CD pipeline or a similar automated environment, ensure that the Azure CLI is installed and that the script or pipeline step explicitly performs 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.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@pgr1mard pgr1mard changed the title Kops doesnt take az login Ksops doesnt take az login Feb 27, 2024
@pgr1mard pgr1mard changed the title Ksops doesnt take az login Ksops doesnt recognize az login Feb 27, 2024
@dosubot dosubot bot added the kind:bug Something isn't working label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant