npm / npm/cli

Smart security enhancment: Limit Trusted Publisher to not tag "latest"

Open
#9,169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

We use Trusted Published workflow to automatically publish our libraries with the tag "dev". We can then let customers and user try the libraries before we feel comfortable enough to do npm dist-tag add XXXX latest manually. This prohibits from accidentially publish official versions of the libraries.

BUT: This is only controlled by the CI workflow file and if we don't pay attention to contributions changing this, a PR could slip in that would publish libs with "latest" tag.

Suggestion: Make it possible for a Trusted Publisher configuration to forbid "latest" publish but allow any other tag.

Related to #8547

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Trusted Publisher configuration and the CI workflow file mentioned in the issue, using the existing npm dist-tag add XXXX latest flow as the reference point. Done means a configuration can forbid publishing with the latest tag while still allowing other tags such as dev, protecting the workflow from accidental changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
ci-cd, release, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.