Skip to content

Secure token storage #715

Closed
Closed

Description

@jaraco

Description of the problem, including code/CLI snippet

I haven't read the code, but from reading the documentation, it sounds like python-gitlab only has support for soliciting a private-token from a plain-text config file in the user's home directory. Better techniques exist for storing secrets more securely, including the keyring library, which stores passwords in system-managed secure stores. It would be nice if the library would allow and even recommend that tokens be stored/queried there.

Expected Behavior

Users would be incentivized not to store any secrets on the file system in plain text.

Actual Behavior

Users are required to store secrets in the file system in plain text.

Specifications

  • python-gitlab version: 1.8.0
  • API version you are using (v3/v4): n/a
  • Gitlab server version (or gitlab.com): n/a

Activity

  1. jamesquilty commented on Apr 11, 2019

    @jamesquilty

    It's a reasonable point, but I would note that passwordless SSH private keys, required for non-interactive scripted access to remote git repositories, are effectively the same as a token and are stored in the file system in plain text format. The important thing is that these files are readable only by the owner and not anyone else. That would mean that, for example, on macOS and Linux systems the ~/.python-gitlab.cfg file should have -rw------- permissions.

    I'd suggest that this issue requesting "Secure token storage" should perhaps be for python-gitlab to raise a warning and/or enforce appropriate config file permissions.

  2. devpie commented on Aug 19, 2019

    @devpie

    It just installed python-gitlab and wondered, why there is no keyring integration ;-)

    @jamesquilty while you are probably right, i always choose a more secure way of storing secrets than simply not allowing others to read them.

    For me this is a +1

  3. nejch commented on Apr 18, 2021

    @nejch
    Member

    This is an old one, but closed now with #1359 thanks to @klorenz!

  4. locked as resolved and limited conversation to collaborators on Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions