Skip to content
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

Nudge users to use Trusted Publishers when publishing to PyPI and TestPyPI #164

Closed
sethmlarson opened this issue Jun 28, 2023 · 5 comments · Fixed by #167
Closed

Nudge users to use Trusted Publishers when publishing to PyPI and TestPyPI #164

sethmlarson opened this issue Jun 28, 2023 · 5 comments · Fixed by #167
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest 🎃🐱‍💻 DO's annual PR encouragement help wanted Extra attention is needed

Comments

@sethmlarson
Copy link

sethmlarson commented Jun 28, 2023

We can use a GitHub Action workflow command to send warnings to users in their workflows to nudge users towards enabling Trusted Publishers instead of username/password and API tokens.

  • We would show the warning only when users are using a username+password or API token instead of a trusted publisher.
  • Since this GHA can be used to publish to any index we should limit this warning message to appearing only for indices that we know support Trusted Publishers (ie PyPI and TestPyPI) and shouldn't show when using an unknown index.

How warnings appear in GitHub Actions

This warning message appears in the workflow execution and in the summary screen and can point users at the exact workflow file they need to modify in addition to linking out to documentation on how to use Trusted Publishers.

A hypothetical warning message being:

Upgrade to Trusted Publishers

Trusted Publishers allows publishing packages to PyPI from GitHub Actions securely without managing credentials like passwords and API keys. Read more: https://docs.pypi.org/trusted-publishers

The warning shows up on the summary page for the GitHub Action execution:

Screenshot 2023-06-28 161107

The warning shows up inline in the logs as well:

Screenshot 2023-06-28 161126

@webknjaz
Copy link
Member

I like this idea, thanks 🙏

@woodruffw @di any comments/objections? I'm pretty much in favor unless there's something I overlooked..

@webknjaz webknjaz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers Hacktoberfest 🎃🐱‍💻 DO's annual PR encouragement labels Jun 28, 2023
@di
Copy link
Sponsor Member

di commented Jun 28, 2023

I'm overall in favor, I think the message could be slightly improved, maybe something like:

Trusted Publishers allows publishing packages to PyPI from automated environments like GitHub Actions without needing to use username/password combinations or API tokens to authenticate with PyPI. Read more: https://docs.pypi.org/trusted-publishers

@woodruffw
Copy link
Member

Sounds good to me as well!

@woodruffw
Copy link
Member

I'm willing to quickly knock this out, unless @sethmlarson is already planning on it 😉

@sethmlarson
Copy link
Author

@woodruffw Please go ahead! 🚀

woodruffw added a commit to trail-of-forks/gh-action-pypi-publish that referenced this issue Jul 10, 2023
Closes pypa#164.

Signed-off-by: William Woodruff <william@trailofbits.com>
renovate bot added a commit to allenporter/flux-local that referenced this issue Jul 13, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | patch | `v1.8.7` -> `v1.8.8` |

---

### Release Notes

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.8.8`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.8)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.7...v1.8.8)

##### 💅 Cosmetic output impovements

- In
[pypa/gh-action-pypi-publish#167,
[@&#8203;woodruffw](https://togithub.com/woodruffw) introduced a
nudge-warning encoraging people to start using secretless publishing to
PyPI, as suggested by [@&#8203;sethmlarson] in
[pypa/gh-action-pypi-publish#164,
collaborating with [@&#8203;di](https://togithub.com/di).

*:bulb: Tip:* The OIDC-based trusted publishing integration details can
be found in the action README at
https://github.com/marketplace/actions/pypi-publish#trusted-publishing
and on the PyPI docs page at https://docs.pypi.org/trusted-publishers/.
It's gone GA on April 20, 2023, during PyCon:
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/.
And the Trail Of Bits blog post has some deeper explanation here:
https://blog.trailofbits.com/2023/05/23/trusted-publishing-a-new-benchmark-for-packaging-security/.

##### 🛠️ Internal dependencies

- [@&#8203;pquentin] bumped the runtime dependency pins to the recent
versions
@&#[pypa/gh-action-pypi-publish#168.

##### 💪 New Contributors

- [@&#8203;pquentin](https://togithub.com/pquentin) made their first
contribution in
[pypa/gh-action-pypi-publish#168

**:mirror: Full Diff**:
pypa/gh-action-pypi-publish@v1.8.7...v1.8.8

[@&#8203;pquentin]: https://togithub.com/sponsors/pquentin

[@&#8203;sethmlarson]: https://togithub.com/sponsors/sethmlarson

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to allenporter/pyrainbird that referenced this issue Jul 13, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | patch | `v1.8.7` -> `v1.8.8` |

---

### Release Notes

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.8.8`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.8)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.7...v1.8.8)

#### 💅 Cosmetic output impovements

- In
[pypa/gh-action-pypi-publish#167,
[@&#8203;woodruffw](https://togithub.com/woodruffw) introduced a
nudge-warning encoraging people to start using secretless publishing to
PyPI, as suggested by [@&#8203;sethmlarson] in
[pypa/gh-action-pypi-publish#164,
collaborating with [@&#8203;di](https://togithub.com/di).

*:bulb: Tip:* The OIDC-based trusted publishing integration details can
be found in the action README at
https://github.com/marketplace/actions/pypi-publish#trusted-publishing
and on the PyPI docs page at https://docs.pypi.org/trusted-publishers/.
It's gone GA on April 20, 2023, during PyCon:
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/.
And the Trail Of Bits blog post has some deeper explanation here:
https://blog.trailofbits.com/2023/05/23/trusted-publishing-a-new-benchmark-for-packaging-security/.

#### 🛠️ Internal dependencies

- [@&#8203;pquentin] bumped the runtime dependency pins to the recent
versions
@&#[pypa/gh-action-pypi-publish#168.

#### 💪 New Contributors

- [@&#8203;pquentin](https://togithub.com/pquentin) made their first
contribution in
[pypa/gh-action-pypi-publish#168

**:mirror: Full Diff**:
pypa/gh-action-pypi-publish@v1.8.7...v1.8.8

[@&#8203;pquentin]: https://togithub.com/sponsors/pquentin

[@&#8203;sethmlarson]: https://togithub.com/sponsors/sethmlarson

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
andrewpollock pushed a commit to google/osv.dev that referenced this issue Aug 9, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | patch | `v1.8.7` -> `v1.8.8` |

---

### Release Notes

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.8.8`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.8)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.7...v1.8.8)

#### 💅 Cosmetic output improvements

- In
[pypa/gh-action-pypi-publish#167,
[@&#8203;woodruffw](https://togithub.com/woodruffw) introduced a
nudge-warning encouraging people to start using secretless publishing to
PyPI, as suggested by [@&#8203;sethmlarson] in
[pypa/gh-action-pypi-publish#164,
collaborating with [@&#8203;di](https://togithub.com/di).

*:bulb: Tip:* The OIDC-based trusted publishing integration details can
be found in the action README at
https://github.com/marketplace/actions/pypi-publish#trusted-publishing
and on the PyPI docs page at https://docs.pypi.org/trusted-publishers/.
It's gone GA on April 20, 2023, during PyCon:
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/.
And the Trail Of Bits blog post has some deeper explanation here:
https://blog.trailofbits.com/2023/05/23/trusted-publishing-a-new-benchmark-for-packaging-security/.

#### 🛠️ Internal dependencies

- [@&#8203;pquentin] bumped the runtime dependency pins to the recent
versions
@&#[pypa/gh-action-pypi-publish#168.

#### 💪 New Contributors

- [@&#8203;pquentin](https://togithub.com/pquentin) made their first
contribution in
[pypa/gh-action-pypi-publish#168

**:mirror: Full Diff**:
pypa/gh-action-pypi-publish@v1.8.7...v1.8.8

[@&#8203;pquentin]: https://togithub.com/sponsors/pquentin

[@&#8203;sethmlarson]: https://togithub.com/sponsors/sethmlarson

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6am on wednesday" in timezone
Australia/Sydney, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/google/osv.dev).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest 🎃🐱‍💻 DO's annual PR encouragement help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants