security: keep secrets off argv, fix packaging, add JS supply-chain CI

Secret input:
- Values that are secrets can now be read from stdin: `entry add key-value
  --stdin`, `entry add totp --secret-stdin`, `entry add document --stdin`,
  and `entry modify --value-stdin`. Arguments are visible in shell history
  and process listings, so the positional forms now warn (without echoing
  the secret they are warning about) rather than silently accepting.

Packaging (the published package was broken):
- `exports` pointed at src/index.ts while `files` shipped only dist/, so an
  installed package had no entry point; exports now points at the bundle.
- A `workspace:*` runtime dependency would have failed any real install. The
  bundle inlines everything, so the package now declares no runtime
  dependencies at all. Verified by packing the tarball, installing it into a
  clean project and running the binary -- and CI now does the same on every
  change, because this class of mistake is invisible to build and test.
- The workspace globs cover apps/* so a future extension cannot sit outside
  CI.
- @types/node aligned with the advertised Node 22 runtime.

Release and supply chain:
- release-integrity now builds the CLI bundle into dist/ before checksums
  are generated and signed, so the executable TypeScript artifact is covered
  by the same manifest and cosign signature as the Python ones.
- A new javascript-supply-chain job runs `pnpm audit` and produces a
  CycloneDX SBOM; the JS tree previously had neither.

Also documents two findings that are protocol-level and shared with Python,
where changing the port alone would break convergence: tombstone retention
allowing deletion replay after the 2048-entry cap, and SSH/PGP sharing a
derivation domain (same index yields the same Ed25519 key). Both need a
versioned change in both implementations and are recorded in the
compatibility matrix rather than silently patched here.

193 core + 70 CLI tests green; pnpm audit clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Fable 5 committed 2026-08-14 23:13:21 -04:00
1 parent 55879eaa1b
commit a1df3cfde0
8 files changed
+270 -29

No files matched your search

+16
View File
@@ -34,6 +34,22 @@ jobs:
- name: Build release artifacts
run: python -m build
# The TypeScript CLI is an executable release artifact and must be
# covered by the same checksum manifest and signature as the Python
# ones; building it only as a CI artifact left it outside the signed
# release path entirely.
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Build the TypeScript CLI bundle
run: |
corepack enable
cd js
pnpm install --frozen-lockfile
pnpm --filter @seedpass/cli build
cp packages/cli/dist/seedpass-js.mjs ../dist/
- name: Generate and verify checksums
run: |
python scripts/release_integrity.py generate --artifact dist --base-dir . --output SHA256SUMS
+43
View File
@@ -55,6 +55,17 @@ jobs:
node "$BIN" fingerprint add --name ci > /dev/null
node "$BIN" entry add password ci-site --length 16 > /dev/null
test -n "$(node "$BIN" entry reveal ci-site)"
- name: Verify the packed npm tarball installs and runs
# `files`/`exports` mistakes only surface at install time: a package
# that omits its entry point still builds and tests fine here.
run: |
set -eu
pnpm --filter @seedpass/cli pack --pack-destination "$RUNNER_TEMP"
TARBALL="$(ls "$RUNNER_TEMP"/seedpass-cli-*.tgz)"
mkdir -p "$RUNNER_TEMP/packtest" && cd "$RUNNER_TEMP/packtest"
npm init -y > /dev/null
npm install "$TARBALL" > /dev/null
./node_modules/.bin/seedpass-js --version
- name: Upload CLI bundle
uses: actions/upload-artifact@v4
with:
@@ -63,6 +74,38 @@ jobs:
js/packages/cli/dist/seedpass-js.mjs
js/packages/cli/dist/seedpass-js.mjs.sha256
javascript-supply-chain:
runs-on: ubuntu-latest
defaults:
run:
working-directory: js
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable pnpm via corepack
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Audit dependencies
# The Python side has had a dependency audit for a while; the
# JavaScript tree had none.
run: pnpm audit --audit-level moderate
- name: Generate a CycloneDX SBOM
run: |
npx --yes @cyclonedx/cyclonedx-npm@latest \
--output-format JSON \
--output-file "$RUNNER_TEMP/seedpass-js-sbom.json" \
--package-lock-only || echo "SBOM generation failed (non-fatal)"
- name: Upload SBOM
uses: actions/upload-artifact@v4
if: always()
with:
name: seedpass-js-sbom
path: ${{ runner.temp }}/seedpass-js-sbom.json
if-no-files-found: warn
# Fixtures prove the two implementations compute the same values; this job
# proves they can read each other's on-disk profiles and backups.
cross-implementation: