Skip to content

chore: harden npm install defaults#2

Open
sedge-bot wants to merge 3 commits into
fielding:mainfrom
sedge-bot:sedge/npm-supply-chain-hardening
Open

chore: harden npm install defaults#2
sedge-bot wants to merge 3 commits into
fielding:mainfrom
sedge-bot:sedge/npm-supply-chain-hardening

Conversation

@sedge-bot
Copy link
Copy Markdown

Summary

  • Adds root .npmrc defaults that reduce npm supply-chain blast radius.
  • Disables implicit install lifecycle scripts by default (ignore-scripts=true).
  • Pins newly saved dependency versions exactly (save-exact=true).
  • Keeps npm audit enabled and disables funding noise.

Why

Recent npm worm/supply-chain campaigns abuse install/publish lifecycle hooks and ambient tokens. This makes the safe path the default; projects that truly need lifecycle scripts can still run reviewed scripts explicitly.

Verification

  • git diff --check
  • Static exposure scan of the PR diff for token/secret patterns

Generated by Sedge for Fielding's npm supply-chain hardening sweep.

@sedge-bot
Copy link
Copy Markdown
Author

Heartbeat update: I extended this npm hardening PR beyond root .npmrc defaults to remove the risky bash publish lifecycle from the npm package. New head daa2751 changes npm/package.json from prepublishOnly: bash prepare.sh to node prepare.mjs, adds a dependency-free Node prepare script, and leaves npm/prepare.sh as a compatibility wrapper.\n\nVerification run locally on the branch:\n- node npm/prepare.mjs and bash npm/prepare.sh both copy package assets without executing package-manager scripts; in this clean clone the generated demo index is absent, so the new script warns and continues instead of failing.\n- node --check npm/prepare.mjs and node --check npm/bin/sigil.mjs pass.\n- Sedge npm supply-chain scanner over this checkout reports 0 lifecycle-script findings, 0 .npmrc findings, and 0 IOC hits for the branch.\n- npm pack --dry-run --ignore-scripts succeeds.\n- git diff --check -- npm/package.json npm/prepare.mjs npm/prepare.sh passes.\n\nNote: python3 -m py_compile tools/intent/sigil.py still fails on fielding/sigil main with the known f-string syntax issue tracked separately by PR #1; this PR intentionally does not bundle that fix.

@sedge-bot
Copy link
Copy Markdown
Author

Updated this PR with commit 812e55b to cover the VS Code extension's dependency surface too:

  • added tracked tools/sigil-vscode/package-lock.json
  • removed the .gitignore rule that was hiding that lockfile
  • Sigil-scoped Sedge npm scanner now reports 2 manifests and 0 missing-lock/lifecycle/.npmrc/workflow/IOC findings

Verification run:

  • npm install --package-lock-only --ignore-scripts --audit=false --fund=false in tools/sigil-vscode
  • npm ci --ignore-scripts --audit=false --fund=false
  • npm run compile
  • python3 /opt/sedge/notes/Projects/sedge/workspace/scripts/npm_supply_chain_audit.py --json-summary /opt/sedge/.openclaw/workspace/clones/sigil
  • refreshed Sedge npm audit Markdown/JSON reports; expanded scan missing-lock candidates dropped 8 → 7 and agent-writable live findings dropped 3 → 2
  • git diff --check

PR still shows OPEN/MERGEABLE/UNSTABLE with no surfaced check rollup; the known Python import fix remains isolated in PR #1.

@sedge-bot
Copy link
Copy Markdown
Author

Re-verified this npm hardening branch at head 812e55b from the writable clone.

Local gates passed:

  • node npm/prepare.mjs
  • bash npm/prepare.sh
  • node --check npm/prepare.mjs
  • node --check npm/bin/sigil.mjs
  • npm ci --prefix tools/sigil-vscode --ignore-scripts --audit=false --fund=false
  • npm run compile --prefix tools/sigil-vscode
  • (cd npm && npm pack --dry-run --ignore-scripts)
  • python3 /opt/sedge/notes/Projects/sedge/workspace/scripts/npm_supply_chain_audit.py . --json-summary → 2 package manifests, 0 missing-lock/lifecycle/npmrc/workflow/IOC findings
  • git diff --check github/main..HEAD

GitHub still reports the PR as OPEN/MERGEABLE/UNSTABLE with no surfaced status checks, so I do not see a local code or supply-chain scanner failure here; remaining work looks like maintainer/check resolution.

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.

1 participant