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

Add a credential helper for gopass #138

Open
sudoforge opened this issue Mar 29, 2019 · 5 comments · May be fixed by #268
Open

Add a credential helper for gopass #138

sudoforge opened this issue Mar 29, 2019 · 5 comments · May be fixed by #268

Comments

@sudoforge
Copy link

sudoforge commented Mar 29, 2019

Background Information

gopass is a rewrite of pass written in Go. It provides a very similar interface to zx2c4's pass, while adding some additional functionality that helps using the password manager within team or multi-team environments, such as mounting external stores, encrypting different blobs for different recipients, etc.

It has a configuration file, located at $XDG_CONFIG_HOME/gopass/config.yml, example below:

root:
  askformore: false
  autoclip: true
  autoimport: true
  autosync: true
  check_recipient_hash: false
  cliptimeout: 45
  concurrency: 1
  editrecipients: false
  nocolor: false
  noconfirm: false
  nopager: false
  notifications: true
  path: gpgcli-gitcli-fs+file:///home/username/code/src/github.com/username/my-personal-store
  recipient_hash: {}
  safecontent: false
  usesymbols: false
mounts:
  work:
    askformore: false
    autoclip: true
    autoimport: true
    autosync: true
    check_recipient_hash: false
    cliptimeout: 45
    concurrency: 1
    editrecipients: false
    nocolor: false
    noconfirm: false
    nopager: false
    notifications: true
    path: gpgcli-gitcli-fs+file:///home/username/code/src/git.company.com/username/my-work-store
    recipient_hash: {}
    safecontent: false
    usesymbols: false

The root dictionary, above, holds the configuration for the root ("default") store. The mounts list provides zero or more dictionaries for additional stores which are "mounted" at the top-level name (the mount's name). For example, with the above configuration:

$ gopass foo

would attempt to access and decrypt foo.gpg in /home/username/code/src/github.com/username/my-personal-store, and

$ gopass work/foo

would attempt to access and decrypt foo.gpg in /home/username/code/src/git.company.com/username/my-work-store.


Proposal

I personally switched over to gopass some time ago, as I found it more intuitive than pass when I began managing passwords for clients and other organizations. It would be great to have a credential helper that interfaced with gopass. I currently utilize pass only because it is the only available credential helper that appeals to me; I would like to remove this dependency and utilize the password manager I use for everything else.

Note: I'm drafting this issue here, but fully plan on contributing to the project and writing this helper myself within the next few weeks. If this would be ill received, please advise.

@captn3m0
Copy link

captn3m0 commented Apr 9, 2019

How different is the gopass cli interface from pass? I was going through https://github.com/docker/docker-credential-helpers/blob/master/pass/pass_linux.go and it seems that the helper just invokes the pass command.

Was wondering if a symlink that points /usr/bin/pass to /usr/bin/gopass work?

@sudoforge
Copy link
Author

@captn3m0 It's not all that different, and at the core, for a user with one password store and who doesn't store additional metadata within it, /usr/bin/pass and /usr/bin/gopass are fairly interchangeable. The difference mostly lies in the fact that gopass supports the management of additional, external "mounts" - separate, unrelated repositories (see my example in the original issue comment); additionally, metadata can be stored/accessed within any particular entry:

$ gopass foo
mysupersucretpassword
username: sudoforge
favorite_color: green

$ gopass foo favorite_color
green

Personally, I'd prefer if the gopass credential helper allowed for the specification of an entry to use - if such an entry is provided, then the token is stored and accessed as metadata, rather than generating one or more new entries altogether.

On a side note from that, I've noticed (but not yet opened or searched existing issues for) several bugs in the pass implementation as it exists today -- so even if it would work, I wouldn't want to reimplement it for gopass or use it to support gopass - although it can serve as a good base or example to start from.

@binarin
Copy link

binarin commented Dec 14, 2021

There are some slight command-line arguments incompatibilities. It still can be used almost as-is, by using a simple compatibility wrapper installed as pass:

#!/usr/bin/env bash
if [[ $1 == "--clip" ]]; then
   # xmonad pass prompt
    exec gopass show "$@"
elif [[ $1 == "ls" && $# == 1 ]]; then
    # proton-bridge
    # no fancy chars in output
    exec gopass ls -f
elif [[ $1 == "rm" && $2 == "-rf" ]]; then
    # proton-bridge
    # `-rf` as single arg is not supported, split them in 2
    shift 2
    exec gopass rm -r -f "$@"
else
  exec gopass "$@"
fi

@alexisph
Copy link

alexisph commented Jan 29, 2022

I had trouble getting docker-credential-pass to work with podman and gopass, even after adding @binarin 's script above to my $PATH as pass.

To make it work, I had to:

  1. Add credential-helpers = [ "pass" ] to /etc/containers/registries.conf.d/gopass.conf
  2. ln -s ~/.local/share/gopass/stores/root ~/.password-store. See https://github.com/docker/docker-credential-helpers/blob/master/pass/pass.go#L106

@sudoforge
Copy link
Author

To make it work, I had to:

  1. ln -s ~/.local/share/gopass/stores/root ~/.password-store. See https://github.com/docker/docker-credential-helpers/blob/master/pass/pass.go#L106

You could set PASSWORD_STORE_DIR instead of keeping that symlink around.

sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 13, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
@sudoforge sudoforge linked a pull request May 13, 2023 that will close this issue
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 13, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 13, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 27, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 27, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 27, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 28, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 29, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 29, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue May 29, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jun 10, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jun 12, 2023
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <9c001b67637a@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Apr 7, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jul 11, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jul 11, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jul 11, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jul 11, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
sudoforge added a commit to sudoforge/docker-credential-helpers that referenced this issue Jul 11, 2024
This change adds support for `gopass` as a credential store, based on
the `pass` implementation.

Closes: docker#138
Closes: docker#166
Signed-off-by: sudoforge <no-reply@sudoforge.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants