getsops / getsops/sops

Issue while decrypting secrets with sops 3.2 and gpg 2.2

Open
#489 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

I have my mac running on below sops and gpg versions (3.2.0 and 2.2.13) respectively.

$ sops --version
sops 3.2.0
[warning] failed to retrieve latest version from upstream: Version information not found in upstream file

[warning] failed to compare current version with latest: Version string empty
 (latest)
$ gpg --version
gpg (GnuPG) 2.2.13
libgcrypt 1.8.4
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/sahilmahajan/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

But I am facing issues while decrypting secrets,

Failed to get the data key required to decrypt the SOPS file.
 508405C0A353AA2A: FAILED
    - | could not decrypt data key with PGP key:
      | golang.org/x/crypto/openpgp error: Reading PGP message
      | failed: openpgp: incorrect key; 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

I tried with this resolution and appended the below 2 lines in ".bash_profile".

GPG_TTY=$(tty)
export GPG_TTY

But the issue is still there. Could this be an issue with sops version ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing decryption with sops 3.2.0 and GnuPG 2.2.13 on macOS using the reported error and key identifier. Check whether setting GPG_TTY changes the result and determine whether the failure is caused by a version, key, or environment issue. Done means documenting a confirmed cause and resolution.

Written by the indexing model from the issue text.

Assessment

Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.