security: migrate PyPI publish to Trusted Publishing (OIDC)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start with .github/workflows/publish-pypi.yml and the Trusted Publishing guidance from PyPI and pypa/gh-action-pypi-publish. Check the workflow's permissions, publish environment, and existing PyPI and Test PyPI secrets. Done means publishing uses OIDC with reviewer approval and the long-lived token secrets can be removed after verification.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
publish-pypi.yml currently authenticates to PyPI using a long-lived PYPI_API_TOKEN repo secret. This is a security risk: if the secret is ever leaked or the repo is compromised, the token can be used to publish arbitrary versions to PyPI indefinitely.
Recommended fix
Migrate to PyPI Trusted Publishing (OIDC), which is supported natively by pypa/gh-action-pypi-publish. With trusted publishing:
- No long-lived token is stored anywhere
- PyPI issues a short-lived token scoped to a specific GitHub repo + workflow + environment for each publish run
- Even if the workflow is triggered unexpectedly, the token expires immediately after use
Steps
-
On PyPI, add a Trusted Publisher for
tabcmd:- Owner:
tableau - Repository:
tabcmd - Workflow:
publish-pypi.yml - Environment:
pypi-production(create this environment on the repo with required reviewers)
- Owner:
-
Update
publish-pypi.yml:- Add
permissions: id-token: writeto the job - Remove
password: ${{ secrets.PYPI_API_TOKEN }}from the publish step - The action authenticates automatically via OIDC
- Add
-
Add a
pypi-productionGitHub environment with required reviewer approval as an extra gate. -
Delete the
PYPI_API_TOKENrepo secret once verified.
Same change can be applied to TEST_PYPI_API_TOKEN / Test PyPI.
References
- Lingua principale
- Python
- Stelle
- 52
- Fork
- 17
- Merge medio
- 5g 20h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tableau/tabcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
feat: publish missing --description flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
feat: creategroup missing --role flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di tableau/tabcmd
Issue simili
-
documentation good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
sujithputta02/Esapay#13 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Flaky: credential-proxy admission metric test asserts a wall-clock bound it does not establishApertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gke-labs/kube-agents#3277 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jbacalso24/mimry#291 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
eli-alvarado/us-watchlist-alerts#14 ·
I maintainer di solito rispondono entro 1 giorno