Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

how to use with Yubikey #113

Open
xmlking opened this issue Apr 2, 2019 · 4 comments
Open

how to use with Yubikey #113

xmlking opened this issue Apr 2, 2019 · 4 comments

Comments

@xmlking
Copy link

xmlking commented Apr 2, 2019

I created my key with gpg --expert --full-gen-key and Yubikey in USB port.
got ID from gpg --fingerprint and added to .sops.yaml

$ helm secrets enc secrets.yaml
Encrypting secrets.yaml
Encrypted secrets.yaml

decrypt failed

 helm secrets edit secrets.yaml
Failed to get the data key required to decrypt the SOPS file.

Group 0: FAILED
  99381AAAAA....: FAILED
    - | could not decrypt data key with PGP key:
      | golang.org/x/crypto/openpgp error: Could not load secring:
      | open /Users/xyz/.gnupg/secring.gpg: no such file or
      | directory; GPG binary error: exit status 2

Recovery failed because no master key was able to decrypt the file. In
order for SOPS to recover the file, at least one key has to be successful,
but none were.
Error: plugin "secrets" exited with error
@mhyllander
Copy link
Contributor

This is not really related to helm secrets. "helm secrets dec secrets.yaml" is basically the same thing as "sops -d secrets.yaml". The issue is rather to make sure that the gpg secret key on the Yubikey is available to gpg and sops. Try commands like "gpg --card-status" and "gpg -K" to verify that the Yubikey has been found and that the gpg keys on it are available.

@xmlking
Copy link
Author

xmlking commented May 29, 2019

I think, sops depends on gpg1 where yubikey relaying on gpg2. That might be the problem

@mhyllander
Copy link
Contributor

Sops uses the "gpg" command by default. You can tell it to use e.g. "gpg2" with an environment variable: https://github.com/mozilla/sops/#specify-a-different-gpg-executable

@mwasilew2
Copy link

might be related: getsops/sops#489 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants