Skip to content

Disable npm audit to stop registry.npmjs.org egress in Rush self-install (CFSClean) - #3703

Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
mainfrom
gavinbarron/cfs-npm-audit-off
Aug 7, 2026
Merged

Disable npm audit to stop registry.npmjs.org egress in Rush self-install (CFSClean)#3703
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
mainfrom
gavinbarron/cfs-npm-audit-off

Conversation

@gavinbarron

Copy link
Copy Markdown
Member

Stop remaining registry.npmjs.org egress in the Generation pipeline (CFSClean)

Context

PRs #3696 and #3697 routed autorest's npm calls and the Rush package registry to the private CFS feed (PowerShell_V2_Build). Validation run 231003 (pipeline 187, on the merged #3697 content) built successfully and confirmed the autorest pre-populate leak is gone — but the Microsoft Graph PowerShell SDK CI Build job still showed 2 registry.npmjs.org hits, traced (network-isolation telemetry + build log) to the Rush Build step.

Root cause

rush install first self-installs Rush and pnpm via npm install, and each of those runs npm audit:

Running "npm install" in ...\rush-5.170.1
Running "npm install" in ...\pnpm-10.32.1
  added 1 package, and audited 2 packages in 5s
  1 high severity vulnerability

npm audit POSTs the dependency set to the public registry.npmjs.org audit endpoint (the private Azure Artifacts feed doesn't implement it), so the registry redirect alone can't stop it. Two self-installs ⇒ two npmjs hits.

Fix

Add audit=false (and fund=false) to the .npmrc content written by Configure-PrivateNpmFeed.ps1. Rush copies/transforms common/config/rush/.npmrc to each self-install location, so these settings propagate to the offending npm install calls. always-auth=true and the private registry= are unchanged, so package resolution stays on the CFS feed.

Validation

Re-run pipeline 187 after merge and confirm registry.npmjs.org = 0 in the CI Build job. (PowerShell Gallery hits are a separate, looser CFSClean2 tier.)

…-install (CFSClean)

PR #3696/#3697 routed the autorest and Rush package registry to the private CFS feed, but pipeline 187 still showed 2 registry.npmjs.org hits during 'Rush Build'. Root cause: 'rush install' self-installs Rush and pnpm via 'npm install', and each runs 'npm audit', which POSTs to the public registry.npmjs.org audit endpoint (the private Azure Artifacts feed does not serve it) - 2 self-installs = 2 npmjs hits. Adding audit=false (and fund=false) to the .npmrc content written by Configure-PrivateNpmFeed.ps1 propagates through Rush's .npmrc transforms to those self-install npm calls, eliminating the egress. Verified via build 231003 log + network-isolation telemetry (hits during the Rush Build window, node.exe).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d3f8fec7-b00b-46be-ba39-7e1f3e7f7188
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner August 7, 2026 16:45
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) merged commit d9cb29a into main Aug 7, 2026
6 of 8 checks passed
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) deleted the gavinbarron/cfs-npm-audit-off branch August 7, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants