aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/build
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-15 14:56:35 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-15 14:56:35 +0200
commit7fc2fa04d7d88a1cdf0d290ddd2de3815a7d52a5 (patch)
treec2ca93040bb95f5bcb667846a2fa91ddf0dd99bb /packaging/build
parent9dd6d1003cf92c0e4e7f23414565314691aa5516 (diff)
downloadmeshbay-7fc2fa04d7d88a1cdf0d290ddd2de3815a7d52a5.tar.gz
build: audit the shipped Python dependencies with pip-audit
No lock file pins the dependencies, so each build installs the newest releases and what ships is only known once it has. packaging/audit_deps.py runs pip-audit then: build-common.sh on the venv before stripping it, build-node-runtime.ps1 on the environment before PyInstaller freezes it. A known vulnerability stops the build, unless its id is listed in packaging/pip-audit-ignore.txt with why it does not apply. No network only skips the audit with a warning, as does a pip-audit that cannot be installed or writes no report. pip-audit runs from a venv of its own, never from the one that ships. Our packages are not audited (not on PyPI), nor pip, setuptools and wheel, which do not ship. Checked with the real build-common.sh (79 packages, none known), with PyJWT 2.14 (the build stops on its two advisories, and goes on once they are listed) and offline (a warning, the build goes on). The PowerShell step was not run here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packaging/build')
-rwxr-xr-xpackaging/build/build-common.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/packaging/build/build-common.sh b/packaging/build/build-common.sh
index 2010d1b..ca5bd1b 100755
--- a/packaging/build/build-common.sh
+++ b/packaging/build/build-common.sh
@@ -60,6 +60,13 @@ echo " writing THIRD-PARTY-NOTICES.txt"
"$VENV_BUILD/bin/python" "$REPO/packaging/third_party_notices.py" \
-o "$ROOT/opt/meshbay-common/THIRD-PARTY-NOTICES.txt" meshbay-hub meshbay-node
+# --- Known vulnerabilities in what ships -----------------------------------
+# One stops the build unless packaging/pip-audit-ignore.txt says why it does not
+# apply; no network only skips the audit, with a warning. pip-audit runs from a
+# venv of its own under the staging dir, never from the one shipped.
+echo " auditing dependencies (pip-audit)"
+"$VENV_BUILD/bin/python" "$REPO/packaging/audit_deps.py" --tool-dir "$STAGING/pip-audit"
+
# --- Strip build tools from the venv (not needed at runtime) ---------------
echo " stripping build tools"
"$VENV_BUILD/bin/pip" uninstall -y pip setuptools wheel 2>&1 | tail -1