-
Notifications
You must be signed in to change notification settings - Fork 995
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
2FA/API tokens: staging/testing rollout #5661
Comments
If we want to roll out to TestPyPI first, we'll probably want to feature-flag this feature, which would be a bit of work. It might be preferable to do a true "beta" on PyPI instead, with a limited group of users. This could just be a boolean field on the This could allow us to do a timeline like:
Possibly? I think we should be explicit in our "beta" announcement that this might happen, so users aren't surprised.
I think all the groups you listed would be ideal.
This is a good point -- it looks pretty likely that our dependency on
I think it is. We don't really claim that TestPyPI should be depended on for much. |
+1 to this approach. |
It should be relatively easy to add a fallback here: we can display the
This looks good to me! |
@nlhkabu - does this feel ok to you? If so then I will declare consensus and start planning this, writing sets of "hey come test this" announcement text, etc. |
Hi @brainwane - sounds very reasonable to me. I'd like to run some direct user tests alongside open testing - sessions where I am able to observe users and understand anywhere they get stuck. I've set up a Google form for registering users for this. @brainwane would you be able to:
To be clear, I don't think that manual user testing should block the launch of 2FA, unless I find any major technical issues that are not raised by open beta testing. |
@nlhkabu One small comment on the form: might want to ask for their PyPI username as well, so we can enable 2FA for them during the private beta. |
#5567 is close to being done. I'm going to plan on merging it on or before Friday, May 3rd, which would give us the following timeline:
|
OK, draft announcements: For distutils-sig/discuss.python.org and other longform places: Subject line: PyPI two-factor auth (2FA) trial May 3-20 Dear PyPI users: To increase the security of PyPI downloads, we're beginning to introduce two-factor authentication (2FA) as a login security option, and want project maintainers and owners to start testing it. Starting this Friday, May 3rd, you'll be able to use 2FA on Test PyPI. And if you'd like to try 2FA on official PyPI, please fill out this Google form so we can invite you to the private beta, which we plan to hold 3-20 May. PyPI currently supports a single 2FA method: generating a code through a Time-based One-time Password (TOTP) application. After you set up 2FA on your PyPI account, then you must provide a TOTP (along with your username and password) to log in. Therefore, to use 2FA on PyPI, you'll need to provision an application (usually a mobile phone app) in order to generate authentication codes; our our testing wiki page gives you suggestions and pointers. This change only applies to the login step, not package uploads. More details at our testing wiki page. During this testing period, if things go awry, there's a chance we will need to wipe tokens from users' accounts, so if you choose to try it, please be forewarned. We suggest you make sure you have a PyPI-verified email address on your user account before trying the feature, to make potential account recovery smoother. And please let us know if you run into glitches. We expect to end this testing period on May 20th, then enable the optional 2FA feature for all PyPI users, and move on to working on WebAuthn support. Thanks to the Open Technology Fund for funding this work. More progress reports at the Packaging Working Group's wiki page. -the PyPI team for pypi-announce: Subject line: PyPI two-factor auth (2FA) trial May 3-20 Dear PyPI users: To increase the security of PyPI downloads, we're beginning to introduce two-factor authentication (2FA) as a login security option, and want project maintainers and owners to start testing it. Starting this Friday, May 3rd, you'll be able to use 2FA on Test PyPI. And if you'd like to try 2FA on official PyPI, please fill out this Google form so we can invite you to the private beta, which we plan to hold 3-20 May. More details at our testing wiki page. We expect to end this testing period on May 20th, then enable the 2FA feature for all PyPI users, and move on to working on WebAuthn support. Thanks to the Open Technology Fund for funding this work. More progress reports at our wiki page. -the PyPI team |
(I need to add a note calling out that this doesn’t affect the upload endpoint currently.) |
Looks good to me @brainwane - thank you. You can probably change this sentence to be shorter:
|
First:
Should this say that it's really more of a user test? It's not just joining a beta, the plan is to sit with these folks for an hour, right? I eagerly clicked the link, then was disappointed since I didn't have the hour. Second: Is there a plan to require 2FA eventually, or, if there isn't a plan, is it worth threatening that that might happen eventually? I think it makes sense to have 2FA for software repos like PyPi, but I know requiring it would be difficult. Maybe there's a middle ground to start pushing for. |
@mlissner You don't need to be available for that hour to be in the beta, just respond "no". :) |
I'm like 10% sure that changed? Anyway, good! |
When we flipped the switch for this feature on Test PyPI & canon PyPI, we did not initially update the user model so that existing Test PyPI accounts had the feature on. Ernest (I believe) ran some SQL to update all the Test PyPI accounts yesterday and turn on the flag. Right now, new Test PyPI accounts (as in, created since that time yesterday) do not have the flag set so they don't see 2FA in their account settings. I'd like @ewdurbin to run the "turn this on for everybody on Test PyPI" SQL again just to get that taken care of, then figure out what to do next. I think @di told me that turning it on by default for all Test PyPI accounts would also turn it on for all canon PyPI accounts (does this mean we ought to have a better feature flag system in general, or just for this feature?) (and I presume that constraint would also stop us from doing something to fix this like: verifying the email address triggers turning on 2FA support). |
Reran the enabling of 2FA on test.pypi.org |
Today's the 20th and it looks like we aren't done with the beta yet, because #5866 is a blocker. Once we finish that, there are some UI issues that we should fix, but it's ok to roll out 2FA to everyone on pypi.org before fixing them. And then a note for next time: let's address #5869 (or having "flip bit in user model" in the runbook for the WebAuthN rollout). |
@ewdurbin @dstufft @di do we have any way of knowing how many users on PyPI have turned on 2fa? Is that even a useful statistic? I naively assume that it would be, and that we would want the number to go up over time, and that we would want a rough estimation in particular of how many users have it turned on who own or maintain at least one package. (I am ok with the answer being "it is a pain to check that" in which case I will probably ask that we check it, like, nowish and then again in a couple months, as we check how well our staging/rollout/publicity are going. I am of course also ok with the answer being "we cannot know that" or "it is a vulnerability to say this publicly" or what have you.) |
|
Update as of this time:
|
Update as of today:
|
Per our conversation in the Friday meeting we plan to roll out the WebAuthn feature on test.pypi.org and on pypi.org with the "beta" badge (#5976) but without doing a bunch of messy bit-flipping. I've also updated https://wiki.python.org/psf/WarehousePackageMaintainerTesting so it'll be ready to publicize. Working on copy for blog post(s), mailing list posts, social media, and so on. |
OK, today we're rolling WebAuthn out as beta and asking a few people to test it, and in the afternoon we'll post blog posts and I'll notify distutils-sig et alia. Later this week I'll publicize it to some more communities, and then in maybe 10 days we'll remove the "beta" badge and I'll email pypi-announce and python-announce. Once that is done I figure we can close the issue. |
This comment has been minimized.
This comment has been minimized.
Percentage of Logins (to pypi.org via browser, I think) using Two-Factor Authentication: May: 2.25% And, for logins in the past 2 days, it's 23.1%. That is mostly a weekend, so it'll be interesting to see whether the trend changes on weekdays... |
This comment has been minimized.
This comment has been minimized.
We have updated the token username and prefix in #6342. username: These changes should alleviate the need for escaping heroics. The previous format will continue to work for now, but users will be notified to update their configurations to match the new syntax before the beta period is over. |
Contractors on the OTF-funded work need to stop/deprioritize work on the security features in order to ensure we complete the accessibility and internationalization work by the end of the month. Therefore, even though some security features are still in beta, I'm closing the milestone. |
I'm writing a discuss.python.org/distutils-sig post now to update our community on the end of the OTF-funded work. I'd like for us to have a few more beta blockers closed before we send out a pypi-announce email, to reduce how much time we and other volunteers spend on support issues; it's ok with me if that means the email doesn't go out for a few more weeks. |
Update for today:
warehouse=> select count(distinct user_id) from (SELECT user_id::uuid from user_security_keys UNION SELECT id::uuid from users where totp_secret is not null) as a;
count
-------
3544
(1 row)
TOTP warehouse=> select count(*) from users where totp_secret is not null;
count
-------
3398
(1 row) WebAuthn warehouse=> select count(distinct user_id) from user_security_keys ;
count
-------
336
(1 row)
warehouse=> select count(*) from macaroons ;
count
-------
1127
(1 row) |
Almost ready for API tokens to leave beta! Just waiting to land pypa/packaging.python.org#687 . @ewdurbin may I ask for an updated count, on how many users have turned on 2FA at all, and how many users have a TOTP method provisioned, and how many have a WebAuthn key provisioned? |
Addresses pypi#5661.
My current draft of an announcement email: Subject: Start using 2FA and API tokens on PyPI Dear PyPI users: To increase the security of PyPI downloads, we have added two-factor authentication (2FA) as a login security option, and API tokens for uploading packages. If you maintain or own a project on the Python Package Index pypi.org , you should start using these features. Click "help" on PyPI for instructions. Details and plans for the future: 2FA: PyPI's implementation of the WebAuthn standard means you can use any 2FA device that meets the FIDO standard. 2FA only affects logging in via a web browser, and not (yet) package uploads. API tokens: use these (instead of username and password) to authenticate when uploading packages to PyPI. You can make tokens that work for all your uploads. You can also make tokens whose scope is limited to one specific package. That way, if a token is compromised, you can just revoke and recreate that token, instead of having to change your password in lots of automated processes. For more details and instructions, click "help" on PyPI: https://pypi.org/help/ . (These features are also available on Test PyPI.) In the future, PyPI will set and enforce a policy requiring users with two-factor authentication enabled to use API tokens to upload (rather than just their password, without a second factor). We do not yet know when we will make this policy change. Thanks to the Open Technology Fund for funding this work. -Sumana Harihareswara on behalf of the PyPI team |
Update as of this moment:
warehouse=> select count(distinct user_id) from (SELECT user_id::uuid from user_security_keys UNION SELECT id::uuid from users where totp_secret is not null) as a;
count
-------
5362
(1 row)
TOTP warehouse=> select count(*) from users where totp_secret is not null;
count
-------
5090
(1 row) WebAuthn warehouse=> select count(distinct user_id) from user_security_keys ;
count
-------
571
(1 row)
warehouse=> select count(*) from macaroons ;
count
-------
3232
(1 row) |
I've made the launch announcement on pypi-announce and thus I now declare this issue closed. Thank you, everybody. |
This was declared as out-of-beta in pypi#5661
This was declared as out-of-beta in #5661
What's the problem this feature will solve?
To finish #996 (see #5567), we need to test MFA with real users on real packages; asking them to spin up dev environments is too hard and won't help multi-maintainer projects reason well about what MFA policies they want to set up.
Describe the solution you'd like
My tentative suggestion is:
Additional context
Cc @ewdurbin .
The text was updated successfully, but these errors were encountered: