Hacker News new | ask | show | jobs
by pdonis 20 days ago
> what they are is a cryptographic signature over a set of claims, which allows for authenticated auditing of a project's state over time.

Which is great--but does not in any way require that the attestation can only be produced by working through one of a small set of recognized "forges". You could do this just as easily by, for example, letting me upload to my PyPI account a public key (the same as forges like Github do to allow SSH access), and then letting me sign builds that I upload using the corresponding private key. But that kind of workflow is not being supported. Why not?

1 comments

> Which is great--but does not in any way require that the attestation can only be produced by working through one of a small set of recognized "forges"

That's true, there's some context elsewhere in these threads about how PyPI can enable email attestations. The short version is that PyPI wanted to make this work by default, which was trivial with Trusted Publishing (since it already provides a strong source of verifiable machine identity).

"Why not a public key?" is a good question, and the very short answer is that greenfield signing designs should not assume that all users are able to manage the secrecy of long-lived key materials, much less force them to make parameter decisions when (re)generating materials. This is the same mistake that the Web PKI made for decades, and has spent the last 15 years slowly untangling. The ideal setup is one where users demonstrate control over an identity, and then the signing scheme binds that identity to a short-lived signing key. That's how email attestations work.

> email attestations

From what I can gather from the github issue that was linked to, those would still require the email identity to be vouched for by a provider. (Though if whoever already is hosting my email could be a "provider", that would at least greatly expand the list of providers from the current small number of forges.) There doesn't seem to be any way for me to, for example, link a public key I generate myself to an email address that PyPI already has on file for me.

> "Why not a public key?" is a good question, and the very short answer is that greenfield signing designs should not assume that all users are able to manage the secrecy of long-lived key materials, much less force them to make parameter decisions when (re)generating materials.

How is offering the public-key option in any way making such an assumption or applying any such force?

As can be seen in every sub-thread of this HN post, users are constantly buffeted by bad advice around key management and generation. It’s the reason applied cryptographers still have to even say “don’t use PGP,” despite it not being a sensible thing to even seek out in 2026 (much less 2016).

(Other large-scale PKI initiatives, like the Web PKI, learned this a long time ago. It’s why we have the CABF BRs instead of asking end users to pinky promise that they’re going to securely generate -‘d store a key and keep it around for 10+ years.)

So basically, you are viewing an attestation as making some kind of promise about how carefully the attester handles their private keys. And you're willing to trust a small number of large tech companies to do that, but you're not willing to trust individuals like me to do it. Am I reading that right?
No, I wouldn't say that's right. Attestations are signatures from user-held keys under the hood; they're just short-lived keys bound to an identity rather than long-lived keys.

The nuance is that the party that does that binding is typically someone who is doing more than keeping their private keys on disk, which is why they're trusted to handle more than short-lived key materials. As mentioned elsewhere that can include "big tech companies" (is ActiveState big? I have no idea) but PyPI also supports self-hosted GitLab instances for organizations. Key management is what matters to us, and knowing that we can trust the parties that we still have to trust.

> the party that does that binding

In other words, you only trust parties to do the binding whose key management you find to be acceptable, and "I keep my private key on my local machine that nobody else ever has access to" is not acceptable. Correct?

> PyPI also supports self-hosted GitLab instances for organizations

How does PyPI verify that those organizations are doing key management in a way you find acceptable?

> the Web PKI

The Web allows self-signed certificates. I can put one on my website and people can use HTTPS to connect to it that way. And then it's up to each person who goes to my website to decide how secure my self-signed certificate is, as opposed to one that comes from a CA.

But of course the browser vendors don't look at it that way, they'll put serious warnings up to the user if they see a self-signed certificate, which they won't for a CA-signed certificate. That's basically your thought process as well, yes? Except that since you control the equivalent of the "website" and its certificate here (namely PyPI and its upload process), you won't even allow the equivalent of a self-signed certificate at all.

The Web PKI does not allow self-signed certificates. You can self-sign a certificate and badger your users into trusting it, but as you note the browsers won't help you do that because it's a security pit of despair.

> you won't even allow the equivalent of a self-signed certificate at all.

You can embed a signature into a Python package if you want. There's even a spec for it[1], although nobody has ever really adopted it. And, of course, you can always host a signature somewhere else (and even link to it via standard packaging metadata). But PyPI will no longer allow you to upload a PGP sidecar (which were never standardized, either) because we have strong evidence that (1) nobody ever really bothered to verify them, and (2) even if they had, the quality of the key material was poor.

[1]: https://peps.python.org/pep-0427/#signed-wheel-files

> The Web PKI does not allow self-signed certificates.

That's not what the rest of your post says. The rest of your post says that you can use one for your website--which of course is true since no one can stop you if you insist on doing it--but that the rest of the Web infrastructure will treat your certificate poorly.

I am simply pointing out that it looks to me like PyPI's attestation mechanism is taking a similar viewpoint to the Web infrastructure in this respect.

> You can embed a signature into a Python package if you want.

I'm talking about the attestation mechanism. That mechanism, unless I'm missing something, does not support self-signed certificates.