release/trusted-publishing
Packages are published with trusted publishing
A capability: each stack checks it with its own tools. Implemented for cpp, go, hugo, java, kotlin, node, php, python, ruby, rust.
Combine: all. Every implementation that runs must pass: each stack in the repository meets the requirement with its own tools.
| Severity | warning |
| Tiers | 1 |
| Stacks | any |
| Scope | root |
| Kind | capability |
| Source | library v0.2.0 |
| Selected by | fleetlint-recommended@v0.2.0 |
Requirement
A tag-triggered workflow that publishes to a registry with trusted publishing (npm, PyPI, crates.io, RubyGems) authenticates with it (OIDC): on GitHub the job has id-token: write and no registry token from secrets is passed; on GitLab the pipeline declares id_tokens:. Each stack’s implementation names its publish commands and token variables. Gitea and Forgejo workflows are not checked: the registries do not trust their tokens.
Why
A registry token in CI secrets is valid for months and publishes from anywhere once leaked; an OIDC token is minted per run, scoped to this repository and workflow, and expires in minutes.
Fix
Register the repository and workflow as a trusted publisher on the registry, grant id-token: write to the release job and delete the token secret.
Agent instruction: Grant id-token: write on the publishing job, remove the registry token from env/with (pypa/gh-action-pypi-publish without password, npm publish with npm 11.5.1 or newer, rust-lang/crates-io-auth-action for cargo, rubygems/release-gem for gems; on GitLab add id_tokens: with the registry’s audience), and tell the user to register the trusted publisher and delete the secret.
See: https://fleetlint.org/baseline/#releases, https://fleetlint.org/baseline/#security
Generated by fleetlint docs from catalog v0.2.0.