-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PEP 763: Limiting deletions on PyPI #4080
Conversation
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Co-authored-by: dm <[email protected]>
Co-authored-by: dm <[email protected]>
Co-authored-by: dm <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Co-authored-by: dm <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@dstufft Please could you confirm your sponsorship of this PEP? |
Co-authored-by: Adam Turner <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failing because this PR is a bit out of date -- but we can't use the "Update branch" button because this PR is made from a fork. If you merge in the lastest HEAD then I think it should pass (and you'll fill in the missing numbers in CODEOWNERS).
Other than that, a few comments in-line.
A
peps/pep-0763.rst
Outdated
This PEP does not identify any positive or negative security implications | ||
associated with proposed approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given above we discuss security implications of permitting deletions, I would expect that the security implications are this PEP makes things better (but also see my comment above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A possible negative implication is that it may be harder to stop users from downloading a file that has security issues, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Yeah, I need to qualify this: the positive implication above was that external users of the index (e.g. companies) benefit from limiting deletion because it makes post-compromise triage and remediation simpler, since the attacker can't remove their trail as easily. I wasn't sure whether to put that under this section though, since it's an indirect/fuzzy security implication, but I'll work it in for further discussion.
A possible negative implication is that it may be harder to stop users from downloading a file that has security issues, right?
@JelleZijlstra Could you elaborate a bit on what you're thinking here? This PEP doesn't stipulate any changes to PyPI admins' abilities to delete things, so the existing malware reporting and quarantining flows remain in place. So from my perspective this doesn't make it any harder to halt downloads of malicious packages.
OTOH, maybe you're thinking of packages that aren't malicious but just have security issues? For those I think the pre-existing "yank" mechanism is good enough (and is what people already use in practice), but I could add in some qualifications there if you think the PEP would benefit from it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, if a package maintainer discovers that there is malware in a package they released, they can delete the package. With this PEP's proposal, they'd have to instead wait for PyPI admins to get to it, which may take longer.
Example scenario: I am a maintainer of https://pypi.org/project/black/. I discover (e.g., through private disclosure) that one of the compiled wheels of the latest release contains malicious code due to a backdoor in cibuildwheel/GH Actions/mypyc (pretty outlandish scenarios, but bear with me). Right now, the first thing I would do is go to PyPI and delete the malicious wheel. With this PEP's proposal, I'd have to figure out the right channels to raise the issue to the PyPI admins, and possibly wait for some time.
This is not a common scenario and your answer could well be that the tradeoff is worth it, but it doesn't seem impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks for elaborating! That's an interesting case -- I can see the argument that it represents a slightly worse security posture, since there's now a middleman (PyPI's admins) for malware response.
I think my position is that it's "worth it," especially now that PyPI has a dedicated malware reporting flow (see screencap) as well as project "quarantine" support for temporarily suspending a project's downloads without actually deleting it. But I'll make sure to include that in a revision to fairly characterize this PEP's changes.
![Screenshot 2024-10-28 at 12 10 53 PM](https://private-user-images.githubusercontent.com/3059210/380795511-8114b805-34fb-42f1-a617-0db463902a57.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTkwMTAsIm5iZiI6MTczOTA5ODcxMCwicGF0aCI6Ii8zMDU5MjEwLzM4MDc5NTUxMS04MTE0YjgwNS0zNGZiLTQyZjEtYTYxNy0wZGI0NjM5MDJhNTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMTA1ODMwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjhlMTQ4Y2Y5MDM1MGFmMmJiNTNjY2U1NzVmYWNhYzRkMzNhYTBiMzlmOGU3ZjU2ZWFjNTg4Yzg0OTM2MTc1NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.EGjaJRFMUnbwKNLy5IoKwdbVGo3czMJ2xv89xVXXC0s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that position makes sense to me!
Co-authored-by: Adam Turner <[email protected]>
This leaves projects in a catch-22 situation where new projects may be pulling | ||
down this known broken version, but if they do anything to prevent that they’ll | ||
break projects that are already using it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaves projects in a catch-22 situation where new projects may be pulling | |
down this known broken version, but if they do anything to prevent that they’ll | |
break projects that are already using it. | |
This leaves a project author in a catch-22 situation where other projects may be pulling | |
down this known broken version, but if the project author does anything to prevent that, it | |
breaks projects where the dependency has been pinned for use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as https://github.com/python/peps/pull/4080/files#r1817037637 -- I like this rephrasing but I don't know whether it's kosher to rewrite a direct quote 😅
Co-authored-by: Carol Willing <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Please do this after the PR is merged :) |
peps/pep-0763.rst
Outdated
This PEP does not identify any positive or negative security implications | ||
associated with proposed approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A possible negative implication is that it may be harder to stop users from downloading a file that has security issues, right?
I think the PEP could be make stronger with a discussion of what other ecosystems do. There's some discussion of NPM, but do any other packaging systems (maybe Rust, Go, OPAM, Cabal, ...) allow deletions? If so, under what circumstances? Is there any precedent for not allowing deletions? |
Signed-off-by: William Woodruff <[email protected]>
These are not strictly relevant to the PEP itself. Signed-off-by: William Woodruff <[email protected]>
Yes. |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
I think this is ready for merge, so that I can make the discussion thread! I don't think I covered 100% of the topics raised above, but I'd like to punt that to discussions so that the conversation isn't siloed here 😅 (In particular, I'm flagging @JelleZijlstra's precedent comment as one I need to address -- there's ample precedent in other packaging ecosystems and I'll add that to this PEP in a follow-up.) |
Co-authored-by: Hugo van Kemenade <[email protected]>
Signed-off-by: William Woodruff <[email protected]> Co-authored-by: Alexis <[email protected]> Co-authored-by: dm <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
Pre-PEP thread: https://discuss.python.org/t/pre-pep-limiting-deletions-on-pypi/66351
Once allocated a number, I'll create the official PEP discussion thread as well 🙂
Basic requirements (all PEP Types)
pep-NNNN.rst
), PR title (PEP 123: <Title of PEP>
) andPEP
headerAuthor
orSponsor
, and formally confirmed their approvalAuthor
,Status
(Draft
),Type
andCreated
headers filled out correctlyPEP-Delegate
,Topic
,Requires
andReplaces
headers completed if appropriate.github/CODEOWNERS
for the PEPStandards Track requirements
Python-Version
set to valid (pre-beta) future Python version, if relevantDiscussions-To
andPost-History
Signed-off-by: William Woodruff [email protected]
📚 Documentation preview 📚: https://pep-previews--4080.org.readthedocs.build/pep-0763/