TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PyPI now supports digital attestations

218 pointsby miketheman6 months ago

21 comments

belval6 months ago
I have a bit of uneasiness about how this is heavily pushing GitHub actions as the correct way to publish to PyPI. I had to check PEP740 to make sure it was not directly supported by Microsoft.<p>&gt; The generation and publication of attestations happens by default, and no changes are necessary for projects that meet all of these conditions: publish from GitHub Actions; via Trusted Publishing; and use the pypa&#x2F;gh-action-pypi-publish action to publish.<p>If you then click on &quot;The manual way&quot; it adds a big disclaimer:<p>&gt; STOP! You probably don&#x27;t need this section; it exists only to provide some internal details about how attestation generation and uploading work. If you&#x27;re an ordinary user, it is strongly recommended that you use one of the official workflows described above.<p>Where the only official workflow is &quot;Use GitHub Actions&quot;.<p>I guess I am an idealist but as a maintainer this falls short of my expectations for the openness of Python and PyPI.
评论 #42137628 未加载
评论 #42138035 未加载
评论 #42140525 未加载
评论 #42140881 未加载
评论 #42138967 未加载
评论 #42137831 未加载
评论 #42142188 未加载
评论 #42144423 未加载
评论 #42144001 未加载
ris6 months ago
I&#x27;m not really convinced of the value of such attestations until a second party can reproduce the build themselves on their own hardware.<p>Putting aside the fact that the mechanisms underpinning Github Actions are a mystery black box, the vast vast vast majority of github workflows are not built in a reproducible way - it&#x27;s not even something that&#x27;s encouraged by Github Actions&#x27; architecture, which emphasises Actions&#x27; container images that are little more than packaged installer scripts that go and download dependencies from random parts of the internet at runtime. An &quot;attestation&quot; makes no guarantee that one of these randomly fetched dependencies hasn&#x27;t been usurped.<p>This is not to go into the poor security record of Github Actions&#x27; permissions model, which has brought us all a number of &quot;oh shit&quot; moments.
评论 #42147338 未加载
krnavy6 months ago
After 2FA, the previous PyPI buzzword that was forced on everyone, JFrog discovered a key leak that compromised everything:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40941809">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40941809</a><p>JFrog also discovered multiple malicious package exploits later.<p>Now we get a Github centric new buzzword that could be replaced by trusted SHA256 sums. Python is also big on business speak like SBOM. The above key leak of course occurred after all these new security &quot;experts&quot; manifested themselves out of nowhere.<p>The procedure remains the same. Download a package from the original creators, audit it, use a local repo and block PyPI.
评论 #42138028 未加载
评论 #42144668 未加载
评论 #42143607 未加载
评论 #42138937 未加载
jeroenhd6 months ago
From the [docs](<a href="https:&#x2F;&#x2F;docs.pypi.org&#x2F;trusted-publishers&#x2F;internals&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.pypi.org&#x2F;trusted-publishers&#x2F;internals&#x2F;</a>):<p>&gt; Reliability &amp; notability: The effort necessary to integrate with a new Trusted Publisher is not exceptional, but not trivial either. In the interest of making the best use of PyPI&#x27;s finite resources, we only plan to support platforms that have a reasonable level of usage among PyPI users for publishing. Additionally, we have high standards for overall reliability and security in the operation of a supported Identity Provider: in practice, this means that a home-grown or personal use IdP will not be eligible.<p>From what I can tell, this means using self-hosted Github&#x2F;Gitlab&#x2F;Gitea&#x2F;whatever instances is explicitly not supported for most projects. I can&#x27;t really tell what &quot;a reasonable level of usage among PyPI users&quot; means (does the invent.kde.org qualify? gitlab.gnome.org? gitlab.postmarketos.org?) but I feel like this means &quot;Gitlab.com and maybe gitea.com&quot; based on my original reading.<p>Of course by definition PyPI is already a massive single point of failure, but the focus on a few (corporate) partners to allow secure publishing feels like a mistake to me. I&#x27;m not sure what part of the cryptographic verification process restricts this API to the use of a few specific cloud providers.
guappa6 months ago
They even got some public money from Germany&#x27;s sovreign tech fund to couple uploads with gigantic USA companies.<p>This is probably deserving a criminal investigation since it appears the funds were probably misused?<p>Well done guys! Good job!
评论 #42148242 未加载
评论 #42145501 未加载
jonnycomputer6 months ago
Supply chain security is very important, and this seems like an important step. Seems absolutely essential that something like the Mozilla foundation, or EFF, or some other open-source friendly entity help provide such a service, instead of corralling users into companies with exploitative business models.<p>I am in no hurry to be pushed into using Github, Gitlab or whatever else. Programmer&#x27;s open source code has been monetized by these companies to feed AI LLM beasties, and it&#x27;s fundamentally objectionable to me. I self-host my code using Gitea for that reason.
SethMLarson6 months ago
Congratulations to everyone involved in this work! This is an incredible building block for not just supply-chain security both inside and downstream of the PyPI ecosystem but also for data analysis of open source projects (through strong linkage back to source repositories). Thank you all &lt;3
ashvardanian6 months ago
Here is the GitHub issue you can subscribe to for automatically generated attestations in the GitHub CI PyPi upload action: <a href="https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;gh-action-pypi-publish&#x2F;issues&#x2F;288">https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;gh-action-pypi-publish&#x2F;issues&#x2F;288</a>
评论 #42136782 未加载
trishankkarthik6 months ago
Very cool, and congrats!<p>The corresponding ToB blog post says the following:<p>&gt; Longer term, we can do even better: doing “one off” verifications means that the client has no recollection of which identities should be trusted for which distributions. To address this, installation tools need a notion of “trust on first use” for signing identities, meaning that subsequent installations can be halted and inspected by a user if the attesting identity changes (or the package becomes unattested between versions).<p>Agree: signing is only as good as verification. However, trust-on-first-use (TOFU) is not the most secure way to map packages to attestations because nothing stops attackers who have taken over PyPI from tampering with the _unsigned_ mapping of identities to attestations in package lockfiles for new clients (certainly in containerized environments where everything could look new), and even just new versions of packages.<p>Although [PEP 458](<a href="https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0458&#x2F;" rel="nofollow">https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0458&#x2F;</a>) is about signing the Python package index, it sets the foundation for being able to securely map packages to signed in-toto _policies_, which would in turn securely map identities to attestations. I think it is worth noting how these different PEPs can work together :)
cpburns20096 months ago
The root point of this seems to be PyPI does not have the resources to manage user identity, and wants to outsource that component to Github, et al. That sounds fairly reasonable. But why deprecate GPG signatures? The problem with GPG signatures as I understand it is it&#x27;s difficult to find the associated public key. That&#x27;s fair. Why not host and allow users to add their public keys to their accounts? Wouldn&#x27;t that solve the problem?
评论 #42147481 未加载
woodruffw6 months ago
I&#x27;m very excited this has come to fruition!<p>PyPI&#x27;s user docs[1] have some more details, as does the underlying PEP[2].<p>[1]: <a href="https:&#x2F;&#x2F;docs.pypi.org&#x2F;attestations&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.pypi.org&#x2F;attestations&#x2F;</a><p>[2]: <a href="https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0740&#x2F;" rel="nofollow">https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0740&#x2F;</a>
dlor6 months ago
This is awesome to see, and the result of many years of hard work from awesome people.
Uptrenda6 months ago
Despite crypto getting easier and easier + more main stream. You often don&#x27;t see it used that often. Even in (((&#x27;&quot;```blockchain&#x27;&quot;```))) projects (wink emoji; skull emoji; frown; picture of a chart crashing.) I welcome these additions to PyPI. I am a proud Python Chad and always will be.
cpburns20096 months ago
Great, now how do you use attestations with Twine when publishing packages on PyPI outside of the Github ecosystem?
评论 #42140707 未加载
评论 #42138625 未加载
pabs36 months ago
Wonder when PyPI will be doing bootstrappable and reproducible builds.<p><a href="https:&#x2F;&#x2F;bootstrappable.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bootstrappable.org&#x2F;</a> <a href="https:&#x2F;&#x2F;reproducible-builds.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;reproducible-builds.org&#x2F;</a>
评论 #42142927 未加载
Ferret74466 months ago
I wonder why they aren&#x27;t using SLSA attestations. It&#x27;d be good to have a single standard than every language having its own format.
评论 #42147246 未加载
antononcube6 months ago
It looks like another process certain software engineers want to program and facilitate. I hope it is and stays optional.
评论 #42141274 未加载
评论 #42137157 未加载
OutOfHere6 months ago
Are tools like uv, rye, hatch, etc. going to facilitate this?
评论 #42145702 未加载
Comma29766 months ago
Great, now all that is missing is a decent packaging system for Python.
amelius6 months ago
I&#x27;m curious what would happen if a maintainer&#x27;s PC is compromised. Is there any line of defense left at that point?
评论 #42144542 未加载
评论 #42144678 未加载
ldng6 months ago
So, let me get this clear, after PyPA enshittifying the package expérience for more than a decade, and now mess has been clean by uv, the security FUD (and let not be naive here, the power struggle) move onto enshittifying PyPI and make Python user miserable for a decade more ?