PyPIが開発者に2FAを要求して抗議を受けている理由

yomoyomoさん経由。元記事はLog4jの脆弱性などを発端に活発に議論されるようになったオープンソースのセキュリティに関するものだが、その中でPyPIというPythonのレポジトリに2FA(2要素認証)を導入しようとしたところコミュニティから大きな反発があったという箇所が気になった。

しかし、オープンソースコミュニティ自体、必要なリソースと最低限のセキュリティ対策を要求する影響力を持っていない。最近、PyPI が重要なプロジェクトに対し、二要素認証を義務化をアナウンスしたが大きな反発をくらった。つまり、善意であれオープンソースコミュニティ単独でセキュリティ基準の引き上げを達成するのは難しい。

ということで原文を辿ってみることにする。

Recently, one of the most popular collections of open-source projects, the Python Package Index (PyPI), announced that it will impose minimum security measures on “critical” projects—the top 1 percent of downloaded projects. This comes out to about 3,500 projects and requires that maintainers of those projects secure their accounts with two-factor authentication to continue contributing to the project. This resulted in an outcry from the community—authors of extremely popular projects threatened to abandon their posts, which could potentially break the systems of any end user reliant on that code.

PyPIは2022年8月の時点で40万ものプロジェクトが管理されており、PyPIに登録されているソフトウェアは簡単なコマンドでインストールができるのだが、PyPIが上位1%にあたる3500のプロジェクトに対して2FAを要求したところ、コミュニティからoutcry(抗議)があったという。

一見、パッケージマネージャに不正が混入しにくくなりそうで「良い取り組み」だと思うのだが、開発者は何に抗議をしたのだろう。Djangoなど、PyPIの上位1%にあたるプロジェクトをメンテナンスするJames Bennettがブログに書いている。

But a lot of people in comment threads are trying really hard to figure out a way to impose requirements and standards on PyPI’s maintainers but not on anyone else, which then contradicts the “it’s open-source, you can’t demand anyone do anything” basis of the whole argument.

「it’s open-source, you can’t demand anyone do anything(オープンソースは誰かに何かを要求できるものではない)という考えと矛盾するのだという。

So let’s talk about responsibility. Many people, including Armin, have been arguing that authors of open source code either don’t have, or shouldn’t have, any responsibility for things like the security of the eventual users of the code.

PyPIを管理しているArmin Ronacherに対し、「Arminだって、オープンソースの開発者はeventual(最終的)なユーザのセキュリティのような責任は負わないし負うべきではないと言ってたじゃないか」と言っている。(「進撃の巨人」に出てくるアルミンを彷彿してしまう)

James BennettはPyPIの2FAが嫌だと言っているのではなく、ここで原理を曲げてはいけないということのようだ。

当のArminはPyPIで2FAを始めることに対して「Congratulations」と書いているが、その中でRustがCargo-vetというプロジェクトについて触れている。

In the Rust world Mozilla started a project that looks quite promising called cargo-vet. It's based on the idea that the users of packages can vet dependencies and most importantly individual versions of them. You can share your vettings with others or at least within your organization. There is an interactive tool that assists you in the vetting process.

cargo-vetはパッケージのユーザが依存関係や個々のバージョンをvet(検査)できるようにするもので、vettings(検査結果)を自分の組織を含む外部と共有することができるようだ。

cargo-vet自体も半年ぐらい前から始まったような取り組みだし、結論を出すには早すぎる段階だが、他の言語のエコシステムも似たような議論となっているのだろう。

この記事が気に入ったらサポートをしてみませんか?