mirrorhelp icon indicating copy to clipboard operation
mirrorhelp copied to clipboard

帮助文档应避免通过 apt-key 系统全局信任 GPG 公钥

Open phy25 opened this issue 2 years ago • 4 comments

2021 年 12 月,CloudFlare 部分客户端软件 GPG 私钥遭到泄露,其后发布的一篇博客指出:

the impact of an improperly secured private key can have consequences that extend beyond the scope of one third-party repository.

简而言之,apt-key 加入的 GPG 公钥会在系统全局层面信任其签名的任意软件。apt 同时也支持按软件源验证签名,因此非系统级的第三方软件应该设置为按软件源验证签名,从而减小私钥泄露的攻击面。

经查,USTCLUG 的部分镜像帮助文档中存在使用 apt-key 的建议。以下是所有帮助中带有 apt-key 命令的项目:

  • [x] https://mirrors.ustc.edu.cn/help/raspbian-addons.html -> https://docs.raspbian-addons.org/install/
  • [x] https://mirrors.ustc.edu.cn/help/nodesource.html
  • [ ] https://mirrors.ustc.edu.cn/help/mariadb.html (指向的官方文档使用了 apt-key)
  • [x] https://mirrors.ustc.edu.cn/help/ros.html

phy25 avatar Jan 10 '22 02:01 phy25

raspbian-addons: Fixed in https://github.com/ustclug/mirrorhelp/commit/1e397c14df5eede4138253176442c9676eedaa09

nodesource: 已经不进行镜像,故不作更新

taoky avatar Jan 10 '22 05:01 taoky

ros 已在 1796b77cb49ce26962272442ff0a7dab8406c683 修复

MariaDB 使用官方的 Repository Configuration Tool 并不好处理,暂时先挂着

Edit: 刚才把 ros 和 ros2 搞混了,重新编辑了一下命令,现在 ros 的文档算正确修订好了

iBug avatar Jan 12 '22 18:01 iBug

我可以帮忙看看哪里可以反馈 MariaDB 的问题,与此同时可以先在文档中备注一下风险就算完(感觉的确不是很容易无脑替换)?

phy25 avatar Jan 12 '22 18:01 phy25

我看到文档里都调用了 gpg 来 dearmor key。 其实apt能识别 armor 格式的 key 的,只是 key 的后缀必须为 .asc。相对的,dearmor 的 key 后缀必须为 .gpg

zhsj avatar Jan 12 '22 18:01 zhsj

MariaDB 的文档似乎已经不再使用 apt-key 了(Debian/Ubuntu 全部改成了 DEB822 的格式),所以应该没有其他活跃的文档在用 apt-key 的了。

taoky avatar Jul 08 '23 08:07 taoky