Differences between revisions 17 and 34 (spanning 17 versions)
Revision 17 as of 2019-04-30 20:37:38
Size: 4439
Comment: testers and feedback
Revision 34 as of 2019-08-15 21:22:16
Size: 9013
Comment: fix obsolete mention of single 2FA method
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
= Help us test PyPI's 2-Factor Auth! =
Warehouse is the code behind the Python Package Repository ([[https://pypi.org/|PyPI]]) ([[https://github.com/pypa/warehouse|source code on GitHub]],[[https://wiki.python.org/psf/WarehouseRoadmap|roadmap]]). We are seeking maintainers of Projects on PyPI to test our new two-factor auth functionality and send us bug reports.
= Help us test PyPI's authentication improvements! =
Warehouse is the code behind the Python Package Repository ([[https://pypi.org/|PyPI]]). We are seeking maintainers of Projects on PyPI to test our new security improvements while they're in beta and send us bug reports. Please help us shake the bugs out!
Line 5: Line 5:
Feedback on user experience, accessibility, and overall ease of use are welcome; we want to support your workflows for account management and package maintainership. Go to [[https://test.pypi.org/|the test site at https://test.pypi.org/]] and try it out! Feedback on user experience, accessibility, and overall ease of use are welcome; we want to support your workflows for account management and package maintainership. Go to [[https://pypi.org/manage/account/#two-factor|your account settings]] and try it out!
Line 11: Line 11:
 * You must verify your primary email address on your Test PyPI and PyPI accounts before setting up 2FA or an API token.
Line 13: Line 14:
== Changes we're making ==
To increase the security of PyPI downloads, we're introducing a few improvements:

=== Two-factor authentication ===

[[https://pypi.org/help/#twofa|two-factor authentication (2FA)]] is a new login security option.

You can use 2FA right now on [[http://test.pypi.org/|Test PyPI]] and on [[https://pypi.org|official PyPI]]. PyPI currently supports two 2FA methods. One is 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; see below for suggestions and pointers. This feature is fully deployed and out of beta.

'''In beta:''' We support !WebAuthn and thus "security keys". A security key (also known as a universal second factor, or U2F key) is hardware device that communicates via USB, NFC, or Bluetooth. Popular keys include Yubikey, Google Titan and Thetis. PyPI supports any [[https://fidoalliance.org/specifications/download/|FIDO U2F compatible key]] and follows the [[https://www.w3.org/TR/webauthn/|!WebAuthn standard]]. Users who have set up this second factor will be prompted to use their key (usually by inserting it into a USB port and pressing a button) when logging in. The !WebAuthn support is '''in beta''' so check the "caution" warning below.

Two-factor authentication currently only applies to the login step, not package uploads.

=== Upload API tokens ===

We're adding scoped API tokens so you can upload a package using a token instead of a username and password.

'''In beta:''' You can create and use API tokens to upload packages. API tokens provide an alternative way (instead of username and password) to authenticate when uploading packages to PyPI or Test PyPI. You can create a token for an entire PyPI account, in which case, the token will work for all projects associated with that account. Alternatively, you can limit a token's scope to a specific project. And then, manually or in your configuration file, when you upload, use `@token` for the username and the token string for the password. API token support is '''in beta''' so check the "caution" warning below.

=== Audit log ===

We're adding a display so you can look at things that have happened in your user account or project, and check for signs someone's stolen your credentials.

You can view a log of sensitive actions from the last two weeks that are relevant to your user account, and if you are an Owner at least one project on PyPI, you can view a log of sensitive actions (performed by ANY user) relevant to projects you're an Owner for. (And PyPI administrators are able to view the full audit log.)

'''In beta:''' We're still refining this, so check the "caution" warning below. And the sensitive event logging and display starting on 16 August 2019, so you won't see sensitive events from before that date.
Line 14: Line 42:
Most of these you can test [[http://pypi.org/|on pypi.org]] once you opt into the private beta. For testing destructive actions, like removing an owner, deleting a project, or deleting a release, please use [[https://test.pypi.org/|test.pypi.org]]. Most of these you can test [[https://pypi.org/manage/account/#two-factor|on pypi.org]]. For testing destructive actions, like removing an owner or deleting a project, please use [[https://test.pypi.org/manage/account/#two-factor|test.pypi.org]].

=== Caution (before you test) ===
During this beta testing period, if things go awry, there's a chance we will need to wipe !WebAuthn and API tokens from users' accounts, so if you choose to try it, please be forewarned. That's why you need a PyPI-verified email address on [[https://pypi.org/manage/account/|your user account]] before adding a second login auth factor, to make potential account recovery smoother.

We may also fail to log, or to properly display, events in the audit log.

Reminder! Sign up for the [[https://mail.python.org/mm3/mailman3/lists/pypi-announce.python.org/|PyPI Announcement Mailing List]] to be kept in the loop as we continue this process!
Line 17: Line 52:
 * Add/Remove 2FA token using TOTP
 * Add/Remove Maintainer
 * Add/Remove Owner
 * Transition Ownership
 * Verify primary email address: check that the user log lists the event
 * Add, disable, and remove 2FA token using TOTP: check that the user log lists the events
 * Add, disable, and remove 2FA token using U2F (!WebAuthn): check that the user log lists the events
 * Login/Logout
 * Set multiple 2FA tokens and login: check that the user log lists the events
 * Add and remove project-scoped API token, and verify that you see this in the user log
 * Add and remove user-scoped API token, and verify that you see this in the user log
 * Upload a package using API token, and verify that you see this in the project log
 * Remove a user from owner/maintainer status for a project, and verify that their API token for that project stops working and that the project log lists the event
 * Delete a release from a project: verify that the project log lists the event
 * Delete a project, and verify that an API token scoped for that project stops working
Line 22: Line 64:
 * Login/Logout
 * Password Reset
 * Remove a project
 * Remove a release
 * Password Reset: check that the user log lists the event
Line 27: Line 66:
== Testers we need ==
=== Testers we need ===
Line 31: Line 69:
 * automate uploads using continuous integration
 * save your PyPI credentials in [[https://packaging.python.org/guides/distributing-packages-using-setuptools/#create-an-account|a `.pypirc` file]]
Line 35: Line 75:
 * use an unusual TOTP app  * use an unusual TOTP app or U2F token
Line 37: Line 77:
 * block cookies and JavaScript  * usually block cookies and !JavaScript (note that you can't set up a U2F key without !JavaScript)
Line 41: Line 81:
== Setting up a TOTP application == === Setting up a TOTP application ===
See [[https://pypi.org/help/#totp|our help docs]] for guidance on choosing a TOTP app for desktop or mobile.
Line 43: Line 84:
Users who have chosen to set up two factor authentication (2FA) on their PyPI account must, once 2FA is set up, provide a second method of identity verification (other than their username and password) for each login. === Setting up a U2F security key ===
See [[https://pypi.org/help/#utfkey|our help docs]] for guidance on setting up your U2F security key. Please note that you cannot set up or use U2F for a second factor without turning on !JavaScript, and that [[https://github.com/pypa/warehouse/issues/6034|right now we only support Chrome, Edge, and Firefox]].
Line 45: Line 87:
PyPI currently supports a single 2FA method: Generating a code through a TOTP application. === Provisioning and using API Tokens ===
See [[https://pypi.org/help/#apitoken|our help docs]] for guidance on provisioning and using API Tokens. You can create a token that allows uploads for all projects your user account has Maintainer or Owner access to, or scope it to a specific project.
Line 47: Line 90:
When enabling two factor authentication (2FA) via [[https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm|TOTP]] in your account admin, you are asked to provision an application (usually a mobile phone app) in order to generate authentication codes. Popular applications include:
  * [[https://freeotp.github.io/|FreeOTP]] (open source)
  * [[https://play.google.com/store/apps/details?id=org.liberty.android.freeotpplus|FreeOTP+]] (open source)
  * Google Authenticator for [[https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2|Android]] or [[https://itunes.apple.com/app/google-authenticator/id388497605|iPhone]] (proprietary)
  * [[https://authy.com/|Authy]] (proprietary)
  * Duo Mobile for [[https://play.google.com/store/apps/details?id=com.duosecurity.duomobile|Android]] and [[https://itunes.apple.com/app/duo-mobile/id422663827|iPhone]] (proprietary)

== Security ==
== Security bugs ==
Line 57: Line 93:
== PyCon ==
Warehouse developers will be [[PackagingSprints|at the PyCon sprints]] May 6-9 to talk about problems you run into, or about how to hack on Warehouse.

Feel free to drop in!

== Notice ==

Reminder! Sign up for the [[https://mail.python.org/mm3/mailman3/lists/pypi-announce.python.org/|PyPI Announcement Mailing List]] to be kept in the loop as we continue this process!
== Our next steps ==
Once we fix all the urgent bugs we find, we'll remove the "beta" badge for each feature. Then we expect to move on to working on further security, accessibility, and internationalization tasks per [[https://wiki.python.org/psf/WarehouseRoadmap|the Warehouse roadmap]]). Thanks to the Open Technology Fund for funding this work. More progress reports at [[https://wiki.python.org/psf/PackagingWG|the Packaging Working Group's wiki page]].
Line 73: Line 103:
Email: [[https://groups.google.com/forum/#!forum/pypa-dev|pypa-dev mailing list]] Email: [[https://mail.python.org/mailman3/lists/distutils-sig.python.org/|distutils-sig mailing list]]
Line 75: Line 105:
Thank you for testing Warehouse! You're helping us launch sooner and future users of PyPI will appreciate it. :) Thank you for testing Warehouse! You're helping us secure this ecosystem, and future users of PyPI will appreciate it. :)

Help us test PyPI's authentication improvements!

Warehouse is the code behind the Python Package Repository (PyPI). We are seeking maintainers of Projects on PyPI to test our new security improvements while they're in beta and send us bug reports. Please help us shake the bugs out!

Feedback on user experience, accessibility, and overall ease of use are welcome; we want to support your workflows for account management and package maintainership. Go to your account settings and try it out!

Guidelines for Particpation

  • By participating, you agree to abide by the PyPA Code of Conduct.

  • You must verify your primary email address on your Test PyPI and PyPI accounts before setting up 2FA or an API token.
  • You should sign up for the PyPI Announcement Mailing List for updates.

Changes we're making

To increase the security of PyPI downloads, we're introducing a few improvements:

Two-factor authentication

two-factor authentication (2FA) is a new login security option.

You can use 2FA right now on Test PyPI and on official PyPI. PyPI currently supports two 2FA methods. One is 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; see below for suggestions and pointers. This feature is fully deployed and out of beta.

In beta: We support WebAuthn and thus "security keys". A security key (also known as a universal second factor, or U2F key) is hardware device that communicates via USB, NFC, or Bluetooth. Popular keys include Yubikey, Google Titan and Thetis. PyPI supports any FIDO U2F compatible key and follows the !WebAuthn standard. Users who have set up this second factor will be prompted to use their key (usually by inserting it into a USB port and pressing a button) when logging in. The WebAuthn support is in beta so check the "caution" warning below.

Two-factor authentication currently only applies to the login step, not package uploads.

Upload API tokens

We're adding scoped API tokens so you can upload a package using a token instead of a username and password.

In beta: You can create and use API tokens to upload packages. API tokens provide an alternative way (instead of username and password) to authenticate when uploading packages to PyPI or Test PyPI. You can create a token for an entire PyPI account, in which case, the token will work for all projects associated with that account. Alternatively, you can limit a token's scope to a specific project. And then, manually or in your configuration file, when you upload, use @token for the username and the token string for the password. API token support is in beta so check the "caution" warning below.

Audit log

We're adding a display so you can look at things that have happened in your user account or project, and check for signs someone's stolen your credentials.

You can view a log of sensitive actions from the last two weeks that are relevant to your user account, and if you are an Owner at least one project on PyPI, you can view a log of sensitive actions (performed by ANY user) relevant to projects you're an Owner for. (And PyPI administrators are able to view the full audit log.)

In beta: We're still refining this, so check the "caution" warning below. And the sensitive event logging and display starting on 16 August 2019, so you won't see sensitive events from before that date.

Things to test

Most of these you can test on pypi.org. For testing destructive actions, like removing an owner or deleting a project, please use test.pypi.org.

Caution (before you test)

During this beta testing period, if things go awry, there's a chance we will need to wipe WebAuthn and API tokens from users' accounts, so if you choose to try it, please be forewarned. That's why you need a PyPI-verified email address on your user account before adding a second login auth factor, to make potential account recovery smoother.

We may also fail to log, or to properly display, events in the audit log.

Reminder! Sign up for the PyPI Announcement Mailing List to be kept in the loop as we continue this process!

Workflows

  • Verify primary email address: check that the user log lists the event
  • Add, disable, and remove 2FA token using TOTP: check that the user log lists the events
  • Add, disable, and remove 2FA token using U2F (WebAuthn): check that the user log lists the events

  • Login/Logout
  • Set multiple 2FA tokens and login: check that the user log lists the events
  • Add and remove project-scoped API token, and verify that you see this in the user log
  • Add and remove user-scoped API token, and verify that you see this in the user log
  • Upload a package using API token, and verify that you see this in the project log
  • Remove a user from owner/maintainer status for a project, and verify that their API token for that project stops working and that the project log lists the event
  • Delete a release from a project: verify that the project log lists the event
  • Delete a project, and verify that an API token scoped for that project stops working
  • User Registration and Confirmation
  • Password Reset: check that the user log lists the event

Testers we need

In particular, please help us test this if any of these apply to you:

  • automate uploads using continuous integration
  • save your PyPI credentials in a `.pypirc` file

  • use Windows
  • usually visit PyPI on a mobile device
  • are an organization where users share an auth token within a group
  • have 4+ maintainers or owners for one project
  • use an unusual TOTP app or U2F token
  • have a slow Internet connection
  • usually block cookies and JavaScript (note that you can't set up a U2F key without JavaScript)

  • maintain 20+ projects
  • created your PyPI account 6+ years ago

Setting up a TOTP application

See our help docs for guidance on choosing a TOTP app for desktop or mobile.

Setting up a U2F security key

See our help docs for guidance on setting up your U2F security key. Please note that you cannot set up or use U2F for a second factor without turning on JavaScript, and that right now we only support Chrome, Edge, and Firefox.

Provisioning and using API Tokens

See our help docs for guidance on provisioning and using API Tokens. You can create a token that allows uploads for all projects your user account has Maintainer or Owner access to, or scope it to a specific project.

Security bugs

If you find any potential security vulnerabilities, please follow our published security policy. Please don't report security issues in Warehouse via GitHub, IRC, or mailing lists. Instead, please directly email one or more of our maintainers.

Our next steps

Once we fix all the urgent bugs we find, we'll remove the "beta" badge for each feature. Then we expect to move on to working on further security, accessibility, and internationalization tasks per the Warehouse roadmap). Thanks to the Open Technology Fund for funding this work. More progress reports at the Packaging Working Group's wiki page.

Contact us

Security issues: email security @ python dot org

GitHub for all other bug reports & feature requests:https://github.com/pypa/warehouse/issues/new

IRC: #pypa-dev on Freenode (someone's usually there 10am-5pm Central Time on weekdays)

Email: distutils-sig mailing list

Thank you for testing Warehouse! You're helping us secure this ecosystem, and future users of PyPI will appreciate it. :)

WarehousePackageMaintainerTesting (last edited 2019-08-15 21:22:16 by SumanaHarihareswara)

Unable to view page? See the FrontPage for instructions.