agent: lumotia — supply-chain pre-flight (npm audit signatures + install discipline)
Adds defence-in-depth against npm-worm attacks (Shai-Hulud / mini-Shai-Hulud). - run.sh: gates dev launch on `npm audit signatures` whenever package-lock.json is newer than .lumotia-last-audit. Fails loud on signature mismatch. Skip with LUMOTIA_SKIP_AUDIT=1 for offline dev. - README: documents `npm ci --ignore-scripts` as the install discipline (blocks the postinstall vector worms exploit) and explains the audit hook. - .gitignore: excludes the per-clone audit stamp. Lumotia's current tree (192 packages) cross-references clean against the mini-Shai-Hulud affected-package list — this is preventive, not remedial.
This commit is contained in:
15
run.sh
15
run.sh
@@ -20,6 +20,21 @@ case "$(uname -s)" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Supply-chain pre-flight. Verify npm registry signatures whenever the
|
||||
# lockfile has changed since the last successful audit. Skip with
|
||||
# LUMOTIA_SKIP_AUDIT=1 (e.g. offline dev). Fails loud on signature mismatch.
|
||||
audit_stamp=".lumotia-last-audit"
|
||||
if [ "${LUMOTIA_SKIP_AUDIT:-0}" != "1" ]; then
|
||||
if [ ! -f "$audit_stamp" ] || [ "package-lock.json" -nt "$audit_stamp" ]; then
|
||||
printf 'Lockfile changed since last audit. Verifying npm signatures...\n' >&2
|
||||
if ! npm audit signatures; then
|
||||
printf 'npm audit signatures FAILED. Possible supply-chain compromise. Investigate before launching. Override: LUMOTIA_SKIP_AUDIT=1\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
touch "$audit_stamp"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf 'Starting Vite dev server...\n' >&2
|
||||
npm run dev:frontend &
|
||||
VITE_PID=$!
|
||||
|
||||
Reference in New Issue
Block a user