Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security: end to end package signature validation. #11224

Closed
1 task done
jpic opened this issue Jul 2, 2022 · 5 comments
Closed
1 task done

Security: end to end package signature validation. #11224

jpic opened this issue Jul 2, 2022 · 5 comments
Labels
type: feature request Request for a new feature

Comments

@jpic
Copy link

jpic commented Jul 2, 2022

What's the problem this feature will solve?

Currently, we can upload signed packages.

However, I didn't find any other GPG related feature in pip, and I believe a package manager in 2022 should provide a mechanism for end to end package validation.

Describe the solution you'd like

I think pip should work like Arch Linux pacman for signature validation:

  • have a local keyring
  • be able to install key packages to contribute to the keyring
  • be able to tell pip to not install any untrusted package without interactive validation or explicit whitelisting

Alternative Solutions

Well you can use your distribution package manager, but you won't get the whole pypi ecosystem nor the latest versions in general.

Additional context

https://wiki.archlinux.org/title/Pacman/Package_signing

Code of Conduct

@jpic jpic added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Jul 2, 2022
@jpic jpic changed the title Finish up GPG support Security: end to end package signature validation. Jul 2, 2022
@auvipy
Copy link

auvipy commented Jul 2, 2022

I can look into it. btw #8719 is this partially related?

@pradyunsg
Copy link
Member

No, it's not related.

There's a much broader thing, that affects more than just pip. Luckily, you're not the only person who wants this, and there's actually been extensive discussions and design toward this in the ecosystem as a whole. See https://peps.python.org/pep-0458/ and https://peps.python.org/pep-0480/.

I'm gonna close this, since this is being tracked in pypi/warehouse#10672

@jpic
Copy link
Author

jpic commented Jul 6, 2022

Thanks for your answer.

However, it's not quite the same. I understand I'm late in train to discuss this PEP, but if the point of PEP 480 is end to end encryption to counter the risk of PyPi's compromission, why does it want to require developers to upload keys on PyPi? This solution doesn't seem to mitigate the risk.

Currently, developers can already upload signed packages on PyPi with python setup.py upload --sign, they can already host their keys on pgp servers, keys already include trust levels, and we can already install GPG.

Please, can someone explain why PEP-0480 is better than just including signature validation in pip install with own keyring for example? Unless python setup.py upload --sign doesn't actually upload the signature on PyPi already, I don't understand why a change to PyPi is necessary, especially to upload public keys to use for validation there as well...

Thanks.

@dstufft
Copy link
Member

dstufft commented Jul 6, 2022

https://caremad.io/posts/2013/07/packaging-signing-not-holy-grail/

@dstufft
Copy link
Member

dstufft commented Jul 6, 2022

PEP 480 also does not require developers to upload keys to PyPI, it requires them to tell PyPI what keys they're going to use to sign their files.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2022
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants