【问题标题】:How secure is git credential caching with `git config --global credential.helper 'cache`?git config --global credential.helper 'cache' 的 git 凭证缓存有多安全?
【发布时间】:2021-02-18 16:42:00
【问题描述】:

将 git HTTPS 凭据缓存与 git config --global credential.helper 'cache 相比如何与使用 git SSH 密钥身份验证安全性进行比较?

git credential.helper cachedocumentation 表示:

The stored credentials never touch the disk, and are forgotten after a configurable timeout. The
cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions.

我发现您可以通过以下方式查看 HTTPS 缓存凭据 echo url=https://[example.com] | git credential fill。不确定这与使用 SSH 密钥的安全含义。如果其他人 SSH 进入同一设备(作为具有不同 SSH 密钥的不同用户),他们是否也能够查看凭据,或者因为他们是不同的用户,他们将无法以这种方式查看凭据?

鉴于使用这两种方法,如果有人可以访问您的系统并假设您的用户,他们可以查看密码或 SSH 密钥,是否正确地说 HTTPS 身份验证通常更安全,因为它在给定期限 II) 重启后到期,III) 可以配置为仅针对某些 git 操作的范围权限?

【问题讨论】:

    标签: git security ssh https


    【解决方案1】:

    如果其他人通过 SSH 连接到同一设备(作为具有不同 SSH 密钥的不同用户),他们是否也能够查看凭据

    不,因为正如文档所述,缓存可通过 Unix 域套接字访问,受文件系统权限限制为当前用户。

    比较与使用 git SSH 密钥身份验证安全吗?

    SSH 密钥意味着您没有输入密码。
    要使用 HTTPS 实现相同的目的,最好使用持久缓存,而不是临时缓存,因为您需要在每个会话中输入密码。

    最新的是GCM-core: Git Credential Manager Core
    它需要to be installed,但是一旦将git config credential.helper 设置为manager-core,它就会将密码(对于给定的URL)存储在一个安全的本地保险库中,using libscret 以使用D-Bus 与“秘密服务”通信(gnome-keyringksecretservice 都是特勤局的实现。)

    【讨论】:

      猜你喜欢
      • 2014-02-02
      • 2022-10-30
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 2016-06-02
      相关资源
      最近更新 更多