-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Document additional Trusted Publishers #15192
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
c911f33
docs/user: empty sections for more publishers
woodruffw 9219252
Fix headings
di 6599491
Add provider TODOs to using-a-publisher.md
di 62be887
Move images into provider-specific directories
di f0aef1a
Update GitHub screenshots
di f75bc65
Fix asset links
di a973d38
Update admonition to match
di f849aee
Remove unnecessary quoting
di 656637e
Google Trusted Publishing docs (#15195)
di 0bfd2fc
Add Google screenshots
di fc699e0
Fix provider-specific screenshots
di db9c99b
Add GitLab Trusted Publishing docs (#15283)
facutuesca c78f60e
Merge branch 'main' into more-oidc-docs
di b9b1532
Add activestate OIDC docs (#15548)
th3coop 8cc6ee5
Slugify tab anchors
di 6f1c8b2
Add blogpost announcing more trusted publishers (#15656)
di a5f0e0b
Merge branch 'main' into more-oidc-docs
di 0b75a2d
Updating ActiveState publishing docs (#15739)
rawktron b5fb60d
Update publish date
di d9c6e7e
Merge branch 'main' into more-oidc-docs
di 10cd258
Update line for consistency
di 0f14fce
Update tabbed headings to not appear in ToC
di ccbb7ee
Wrap long lines
di 1baa169
Consistency fix
di 70d2306
Line break
di d46b615
Strip out leading $
di 05ecc46
Make note conform
di 93333b0
Translations
di 461e93c
Add border to images
di 278744b
Update screenshot
di f1d1d8e
Dark mode CSS doesn't work as expected
di 56cf575
Add alt text
di 8b0fcc7
Merge branch 'main' into more-oidc-docs
di 4789ddf
Update publication date
di 7fa8d2a
Fix ActiveState getting started Trusted Publisher links (#15801)
th3coop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
docs/blog/posts/2024-04-15-expanding-trusted-publisher-support.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| title: Expanding Trusted Publisher Support | ||
| description: Announcing additional Trusted Publishing providers | ||
| authors: | ||
| - di | ||
| date: 2024-04-15 | ||
| tags: | ||
| - publishing | ||
| - security | ||
| - oidc | ||
| --- | ||
|
|
||
| Starting today, PyPI package maintainers can publish via Trusted Publishing | ||
| from three additional providers: | ||
|
|
||
| * GitLab CI/CD | ||
| * Google Cloud | ||
| * ActiveState | ||
|
|
||
| These providers join existing support for publishing from GitHub Actions without | ||
| long-lived passwords or API tokens, which [we announced last year], and bring | ||
| support for Trusted Publishing to even more hosted providers. | ||
|
|
||
| <!-- more --> | ||
|
|
||
| ### About Trusted Publishing | ||
|
|
||
| Trusted Publishing is our term for using the [OpenID Connect (OIDC)] standard | ||
| to exchange short-lived identity tokens between a trusted third-party service | ||
| and PyPI. This method can be used in automated environments and eliminates the | ||
| need to use username/password combinations or long-lived, manually generated | ||
| API tokens to authenticate with PyPI when publishing. | ||
|
|
||
| Instead, maintainers can configure PyPI to trust an identity provided by a | ||
| given OpenID Connect Identity Provider (IdP). This allows allows PyPI to verify | ||
| and delegate trust to that identity, which is then authorized to request | ||
| short-lived, tightly-scoped API tokens from PyPI. These API tokens never need | ||
| to be stored or shared, rotate automatically by expiring quickly, and provide a | ||
| verifiable link between a published package and its source. | ||
|
|
||
| ### Get started today | ||
|
|
||
| To get started with using trusted publishers on PyPI, see our documentation | ||
| here: <https://docs.pypi.org/trusted-publishers/>. | ||
|
|
||
| ### Acknowledgements | ||
|
|
||
| Funding for work implementing Google Cloud and GitLab support was provided by | ||
| the Google Open Source Security Team, and much of the development work was | ||
| performed by [Trail of Bits], with special thanks to contributors [William | ||
| Woodruff] and [Facundo Tuesca]. | ||
|
|
||
| ActiveState support was provided by ActiveState, with special thanks to | ||
| contributors [Carey Hoffman] and [Pete Garcin]. | ||
|
|
||
| --- | ||
|
|
||
| _Dustin Ingram is a maintainer of the Python Package Index._ | ||
|
|
||
| [we announced last year]: 2023-04-20-introducing-trusted-publishers.md | ||
| [William Woodruff]: https://github.com/woodruffw | ||
| [Facundo Tuesca]: https://github.com/facutuesca | ||
| [Carey Hoffman]: https://github.com/th3coop | ||
| [Pete Garcin]: https://github.com/rawktron | ||
| [OpenID Connect (OIDC)]: https://openid.net/connect/ | ||
| [Trail of Bits]: https://www.trailofbits.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+151 KB
docs/user/assets/trusted-publishing/activestate/pending-publisher-form-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+122 KB
docs/user/assets/trusted-publishing/activestate/pending-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+113 KB
docs/user/assets/trusted-publishing/activestate/project-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+81.8 KB
docs/user/assets/trusted-publishing/activestate/project-publishing-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+309 KB
docs/user/assets/trusted-publishing/github/pending-publisher-form-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+187 KB
docs/user/assets/trusted-publishing/github/pending-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+131 KB
docs/user/assets/trusted-publishing/github/project-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+204 KB
docs/user/assets/trusted-publishing/github/project-publishing-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+270 KB
docs/user/assets/trusted-publishing/gitlab/pending-publisher-form-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+204 KB
docs/user/assets/trusted-publishing/gitlab/pending-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.8 KB
docs/user/assets/trusted-publishing/gitlab/project-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
docs/user/assets/trusted-publishing/gitlab/project-publishing-form.png
di marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+223 KB
docs/user/assets/trusted-publishing/google/pending-publisher-form-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+183 KB
docs/user/assets/trusted-publishing/google/pending-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
docs/user/assets/trusted-publishing/google/project-publisher-registered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+120 KB
docs/user/assets/trusted-publishing/google/project-publishing-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,11 +9,11 @@ Adding a trusted publisher to a PyPI project only requires a single setup step. | |
| On the ["Your projects" page](https://pypi.org/manage/projects/), click "Manage" on any project you'd like to | ||
| configure: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| Then, click on "Publishing" in the project's sidebar: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| That link will take you to the publisher configuration page for the project, | ||
| which will allow you to configure trusted publishers for the different | ||
|
|
@@ -34,7 +34,7 @@ each. | |
| that uses a publishing workflow defined in `.github/workflows/release.yml` | ||
| and a custom environment named `release`, then you'd do the following: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| !!! note | ||
|
|
||
|
|
@@ -43,15 +43,96 @@ each. | |
| your trusted workflow, such as requiring manual approval on each run | ||
| by a trusted subset of repository maintainers. | ||
|
|
||
| Once you click "Add", your publisher will be registered and will appear | ||
| at the top of the page: | ||
|
|
||
| Once you click "Add", your publisher will be registered and will appear | ||
| at the top of the page: | ||
|  | ||
|
|
||
|  | ||
| From this point onwards, the `release.yml` workflow on `octo-org/sampleproject` will | ||
| be able to generate short-lived API tokens from PyPI for the project you've registered | ||
| it against. | ||
|
|
||
| From this point onwards, the `release.yml` workflow on `octo-org/sampleproject` will | ||
| be able to generate short-lived API tokens from PyPI for the project you've registered | ||
| it against. | ||
| === "Google Cloud" | ||
|
|
||
| For Google Cloud, you **must** provide the email address of the account or | ||
| service account used to publish. [You can learn more about Google Cloud | ||
| service accounts | ||
| here](https://cloud.google.com/iam/docs/service-account-overview). | ||
|
|
||
| For example, if you have created a service account named | ||
| "SERVICE_ACCOUNT_NAME" in the project "PROJECT_NAME" which is in use by | ||
| the environment where you would like to publish to PyPI from, your service | ||
| account email would take the form | ||
| `SERVICE_ACCOUNT_NAME@PROJECT_NAME.iam.gserviceaccount.com`, and you would do | ||
| the following: | ||
|
|
||
|  | ||
|
|
||
| !!! warning | ||
|
|
||
| Google Cloud also provides [default service | ||
| accounts](https://cloud.google.com/iam/docs/service-account-types#default) | ||
| for various products: | ||
|
|
||
| * Compute Engine: `[email protected]` | ||
| * App Engine: `[email protected]` | ||
|
|
||
| However it is **not** recommended that these be used for publishing, as | ||
| they are provided by default to every service when they are created. | ||
|
|
||
| !!! note | ||
|
|
||
| Configuring the subject is optional. The subject is the numeric ID that | ||
| represents the principal making the request. While not required, providing the | ||
| subject further restricts the identity which is used for publishing, ensuring | ||
| that only a specific instance of a service account can publish, not any service | ||
| account with the configured email. See | ||
| <https://cloud.google.com/docs/authentication/token-types#id-contents> | ||
| for more details | ||
|
|
||
| Once you click "Add", your publisher will be registered and will appear | ||
| at the top of the page: | ||
|
|
||
|  | ||
|
|
||
| === "ActiveState" | ||
|
|
||
| For ActiveState, you need to provide the name of the ActiveState project, | ||
di marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| the ActiveState organization that project belongs to, and the ActiveState user performing | ||
| the publish action. Learn more about getting set up on the ActiveState Platform [here](https://docs.activestate.com/platform/start/PYPI). | ||
|  | ||
| Once you click "Add", your publisher will be registered and will appear at the top of the page: | ||
|  | ||
|
|
||
| === "GitLab CI/CD" | ||
|
|
||
| For GitLab CI/CD, you **must** provide the repository's namespace, the | ||
| repository's name, and the filepath of the GitLab CI/CD workflow that's | ||
| authorized to upload to PyPI. In addition, you may **optionally** | ||
| provide the name of a | ||
| [GitLab CI/CD environment](https://docs.gitlab.com/ee/ci/environments/). | ||
|
|
||
| For example, if you have a project at `https://gitlab.com/namespace/sampleproject` | ||
| that uses a publishing workflow defined in `release.yml` and a custom | ||
| environment named `release`, then you'd do the following: | ||
|
|
||
|  | ||
|
|
||
| !!! note | ||
|
|
||
| Configuring an environment is optional, but **strongly** recommended: | ||
| with a GitLab environment, you can apply additional restrictions to | ||
| your trusted workflow, such as requiring manual approval on each run | ||
| by a trusted subset of repository maintainers. | ||
|
|
||
| Once you click "Add", your publisher will be registered and will appear | ||
| at the top of the page: | ||
|
|
||
|  | ||
|
|
||
| From this point onwards, the `release.yml` workflow on `namespace/sampleproject` | ||
| will be able to generate short-lived API tokens from PyPI for the project you've | ||
| registered it against. | ||
|
|
||
| A publisher can be registered against multiple PyPI projects (e.g. for a | ||
| multi-project repository), and a single PyPI project can have multiple | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.