47 points · by genericlemon24 · 3y ago · 80 comments
Could equally come from the project, looking at their past HN stories they've had a lot of problems with malicious users. ID requirements might reduce that.
In any case, this multi-year phase-in is the sort of ratcheting steps you do when you want to make a change, and it's a big change, and you don't want a flag-day migration.
Or, if you don't like it, you use the boiling frog apologue - https://en.wikipedia.org/wiki/Boiling_frog .
I'm not doing anything for the Python ecosystem. I'm a Python developer, not part of core dev, PyPI, Python packaging, or anything ecosystem related.
As a consumer and maintainer myself, PyPI has had a fair share of issues, but this is definitely not one of them.
>
> The most important things you can do to prepare are to enable 2FA for your account as soon as possible, either with a security device (preferred) or an authentication app and to switch to using either Trusted Publishers (preferred) or API tokens to upload to PyPI.
So you either need to have a mobile phone (all of the linked applications[0] seem to require an Android or iOS device) or some custom device and they prefer you to rely on some 3rd party they call "Trusted Publisher"?
Weren't private+public key signatures invented for solving pretty much this thing? They might be a bit complex for Mere Mortals but programmers should at least be able to figure them out. Am i missing something?
EDIT: seems like TOTP is indeed similar to private+public key signatures (in that there is a shared secret to check against), can be done fully locally without requiring a phone or any 3rd party service and it just happened that the applications listed on the site were all for phones.
For some reason many sites seem to pretend it's a phone- or special device only thing. In principle it's more secure, but if you also have a password manager on your phone – as many people do – then it's not really.
Give https://en.wikipedia.org/wiki/Time-based_one-time_password#A... a read, it's extremely simple.
I had a huge jackie chan meme moment at that point.
Then I realized that, all along, my password manager has a feature to store TOTP, and there is not even a strict need to use all these authenticator apps. (Of course, as someone who strives to exercise some security mindfulness, I reckon it undermines much of the overall point of TOTP to keep it within the same datastore as your account password.)
It's really simple; I once wrote an implementation in Python in 20 lines or so based on just the specification, and I'm not a crypto guy at all. It's probably the simplest crypto systems to implement. Things like "connect your authentication app" make it sound complicated, but all that does is store a short secret in the app.
One clear advantage of this is that a code is only valid for a short period of time (usually a few minutes at the most). I can't re-use the code you used yesterday, and intercepting codes is also much harder as it's much more time-sensitive.
Or you can implement your own, TOTP is not complicated. Here's a Python library that does the heavy lifting for you: https://github.com/pyauth/pyotp .
And TOTP has much better user experience than raw keys, especially for beginners who might mix the public/private parts, and experts who want hardware protection.
I do feel want to mention though (largely because I think it's pretty cool), that those security devices are using a private/public key system under the covers, and they're actually designed to be privacy friendly and phishing resistant. One of the problems with TOTP based 2FA is that since it's asking users to type the TOTP code into the website, they can be phished and tricked into typing their password and TOTP code into an attacker's website, who then quickly go and use it to sign onto their account.
Those hardware tokens prevent that phishing from happening. They basically create, on the fly, a public/private key pair that is bound to the domain name of the site in question, and then give the public key of that to the site. When you come back to log in again, the site tells the hardware token what public key it has, the token looks a the site's domain and determines if it has that key for that domain, and if it does it uses a signature to prove ownership of the private key.
It all ends up working really well, since the domain name (actually the protocol, domain name, and port) is part of the identify of the key pair, it is impossible for it to get entered on the wrong site, so it completely eliminates phishing. Then since every single site gets it's own brand new keypair generated for it, there's no way to determine that the hardware token used on Site A is the same as the hardware token used on Site B. So it's entirely privacy preserving as well!
The protocol is obviously a bit more complicated then that, but that's the general idea of it.
This code snippet can be used for standard TOTP 2FA
Many desktop password managers have built in support (e.g. keepass2).
I see that as the main issue if you want to migrate away from PyPI's management practices.
Similarly, if you don't want to deal with PyPI at all, and host your own packages, then it's all too easy for someone else to register a package of the same name on PyPI. Users aren't used to configuring an alternate server.
Having an outdated version of my packages on a locked-out account on PyPI (with the up-to-date sdists that I distribute on my website) sounds like a nightmare.
I presume package authors are likely to be rather better informed than this?
https://nakedsecurity.sophos.com/2017/07/11/two-factor-via-y...
I use 2FA on many of my accounts, and it's not that bad if you're only being prompted for it once a week or so.
So, dumping hours upon hours of work into publishing a project on PyPI is fine, but setting up TOTP is where some people draw the line? To prevent against a commonly-exploited attack vector that is so simple to mitigate?
Like... Really?
Not offering an opinion on whether it's good or bad that it's enforced, but that's the difference between the two.
The biggest issue is that as the number of sites in the Authenticator grows finding them becomes more annoying.
Keys are a pain in the ass though, as their form factors usually make them impossible to keep attached to a laptop (as they snag and break if you forget to unplug them before putting the laptop in a bag), yet easy to lose if you’re not super careful.
There are low-profile keys (yubikey’s nanos) but they’re not exactly cheap, and I’ve never seen one being given out (whereas I have free keys from older programs of github and google both).
They’re all minor gripes, but they’re routine annoyances nonetheless, and as the number of sites requiring 2FA grows (rightfully so) the likelihood that you’ll meet a 2FA prompt every day closes in on 1.
And there’s a handful of sites which are really shit about it, with way too aggressive requirements and way too short sessions.
I’ve got great hopes for TPM WebAuthn.
a) are the only person who needs to use that login b) you can associate multiple logins with a single account.
As far as I can see (b) is not true which means yet another case where a colleague has to phone me every time they need to login.
I hadn't thought of that!
That can be annoying to keep in sync if you have a lot of projects, but we're rolling out organization support to make that easier for people.
edit: not shared account but a shared vault.
Current day mobile devices, infested as they are with the dubious morality and regulatory malpractices that engineered the duopoly are horrible as digital identity providers and 2FA.
2FA is a function that is becoming essential for anybody that wants to participate in a digital life. A widely available and easy to use alternative is not a good to have it is absolutely essential.
The implications of how 2FA is implemented go far beyond lovely PyPI. Entities like banks are deprecating specialized hardware in favor of the mobile. This is insane and odious.
Some 2FA systems do require some specialized mobile app, but this is not one of them.
As night follows day the next stage of 2FA will be biometrically based and there will be no escape route for "junior developers".
This allows you to lose your phone without losing your account.
Seriously, stop reinveting the wheel.