Skip to content

Infosec ECLI-002: fix trusted publishing/provenance #239

Closed

Description

@JoshMock

From Infosec's CLI code review:

ECLI-002

npm publish lacks trusted publishing and provenance — Medium

Problem

.github/workflows/release.yml:49 runs npm publish without OIDC trusted publishing wired to the publish job. id-token: write is scoped to the release-please job only; publish has contents: read.

Fix

  1. Add id-token: write to the publish job's permissions block.
  2. Change the publish step to npm publish --provenance --access public.
  3. Register elastic/cli as a trusted publisher on npmjs.org (package settings → Publishing → Trusted Publishers).

This removes any need for a long-lived NPM_TOKEN and gives downstream consumers cryptographic attestation linking each published tarball to this repo + commit + workflow.

Risk

Medium. Without trusted publishing, authenticating publish requires a long-lived NPM_TOKEN secret. Any step in the release workflow could exfiltrate it and publish outside GitHub Actions. Trusted publishing avoids the secret and provides verifiable build provenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

security

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions