mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
scripts/bump.sh's safe bumps, patches and minors: - images: mise 2026.11.10 -> 2026.11.14 (base and the host's, with internal/tools/mise.go's checksums), nix 2.35.6 -> 2.36.0, Docker's buildx 0.39.0 -> 0.39.1 and model 1.2.9 -> 1.2.10 - e2e: the lock's pnpm 12.21.0 -> 12.23.0, bun 1.4.4 -> 1.4.5, codex 0.169.1 -> 0.171.0, opencode 2.3.2 -> 2.4.1, pi 1.5.2 -> 1.6.0; --from's node:24 by its new digest - dev-tools: nilaway to its newest commit's pseudo-version (0.0.0-20261124161746-91ad9bf5d8e6), goreleaser 2.20.3, vale 3.28.1, markdownlint-cli2 0.24.2, whose lock folder moves to .mise/locks/markdownlint-cli2/0.24.2/, zizmor 1.33.1, with mise.lock - ci: the workflows' mise 2026.11.14, jdx/mise-action v5.3.0, amannn/action-semantic-pull-request v6.1.4 The e2e lock keeps Claude Code at 2.1.327: 2.1.328 made its sign-in link much shorter, without the state parameter that the network section's login check reads to answer it, so with 2.1.330 that check and the refresh after it fail. devvm itself never reads the link. mise's and Nix's new checksums match upstream's SHASUMS256.txt and .sha256 files; buildx and model are apt packages from Docker's signed repository. Cursor's CLI stays on 2026.11.17-f532c45: 2026.11.22-e9042b2 is out, and it moves only when named. pflag stays held below 1.1.0 and Node on 24. The new nilaway no longer reports three of agentsave.go's bounds findings, so their lines leave testdata/nilaway-baseline.txt, which nilaway and nilaway:linux fail on while they're stale. The CHANGELOG's Unreleased has the pins line, and the 0.2.0 page a section for them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
187 lines
8.3 KiB
YAML
187 lines
8.3 KiB
YAML
name: Vulnerabilities
|
|
|
|
# govulncheck once a week, on main's code for Linux and macOS and on the
|
|
# binaries of the latest release and of the newest release, prerelease or not:
|
|
# what it finds goes in one open issue, which closes when every scan finds
|
|
# nothing. CI's vuln job checks each push, and this catches a vulnerability
|
|
# published since, and one in what users run. The scan job has only read
|
|
# access; the issue job, which can write issues, runs no govulncheck.
|
|
on:
|
|
schedule:
|
|
- cron: "37 6 * * 1"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: vuln
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
scan:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
# Only Go and govulncheck.
|
|
- uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0
|
|
with:
|
|
version: 2026.11.14
|
|
install_args: go go:golang.org/x/vuln/cmd/govulncheck
|
|
cache: false
|
|
- name: Scan main and the releases
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
shopt -s nullglob
|
|
work=$RUNNER_TEMP/scan
|
|
mkdir -p "$work" "$RUNNER_TEMP/findings"
|
|
found=$RUNNER_TEMP/findings/found.txt
|
|
# A fixed first line, so the artifact is never empty; the issue
|
|
# job checks it and skips it.
|
|
echo "# govulncheck findings" > "$found"
|
|
# scan NAME ARGS…: govulncheck exits 3 when it finds a vulnerability,
|
|
# and any other failure fails the job, so a scan that didn't run
|
|
# never closes the issue.
|
|
scan() {
|
|
local name=$1 status=0
|
|
shift
|
|
govulncheck "$@" > "$work/report.txt" || status=$?
|
|
cat "$work/report.txt"
|
|
case $status in
|
|
0) ;;
|
|
3)
|
|
{
|
|
echo "[$name]"
|
|
grep -E '^Vulnerability #|^ +(Found|Fixed) in: ' "$work/report.txt"
|
|
} >> "$found"
|
|
;;
|
|
*)
|
|
echo "govulncheck failed on $name with status $status" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
}
|
|
# What mise run vuln runs: the code for each OS devvm ships for.
|
|
GOOS=linux scan "main linux" ./...
|
|
GOOS=darwin scan "main darwin" ./...
|
|
latest=$(gh release view --json tagName --jq .tagName)
|
|
newest=$(gh release list --exclude-drafts --limit 1 --json tagName --jq '.[0].tagName')
|
|
printf '%s\n' "$latest" "$newest" | sort -u > "$work/tags.txt"
|
|
while IFS= read -r tag; do
|
|
if [[ ! $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]]; then
|
|
echo "unexpected release tag: $tag" >&2
|
|
exit 1
|
|
fi
|
|
version=${tag#v}
|
|
dir=$work/$tag
|
|
mkdir -p "$dir"
|
|
gh release download "$tag" --dir "$dir" --pattern SHA256SUMS --pattern "devvm-$version-*.tar.gz"
|
|
archives=("$dir"/devvm-"$version"-*.tar.gz)
|
|
if (( ${#archives[@]} == 0 )); then
|
|
echo "$tag has no archives" >&2
|
|
exit 1
|
|
fi
|
|
# Every archive has a line in SHA256SUMS, so --ignore-missing
|
|
# skips none of them.
|
|
for archive in "${archives[@]}"; do
|
|
base=${archive##*/}
|
|
if ! awk -v b="$base" '$2 == b { f = 1 } END { exit !f }' "$dir/SHA256SUMS"; then
|
|
echo "$tag's SHA256SUMS has no line for $base" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
(cd "$dir" && sha256sum --check --ignore-missing --strict SHA256SUMS)
|
|
for archive in "${archives[@]}"; do
|
|
platform=${archive##*/devvm-"$version"-}
|
|
platform=${platform%.tar.gz}
|
|
tar -xzf "$archive" -C "$dir" "devvm-$version-$platform/devvm"
|
|
scan "$tag $platform" -mode=binary "$dir/devvm-$version-$platform/devvm"
|
|
done
|
|
done < "$work/tags.txt"
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: findings
|
|
path: ${{ runner.temp }}/findings/found.txt
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
|
|
# Only main's run reports, so a run started on another branch never
|
|
# closes the issue as main's.
|
|
issue:
|
|
needs: scan
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
issues: write
|
|
steps:
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: findings
|
|
path: ${{ runner.temp }}/findings
|
|
# govulncheck's report holds the vulnerability database's text: it goes
|
|
# through files, never into a script.
|
|
- name: Open, update or close the issue
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
title="Known vulnerabilities in devvm"
|
|
# Each scan's vulnerabilities and versions, with only the characters
|
|
# those lines use, so no text from the database can end the issue's
|
|
# code fence (a backtick) or add markup; \133 and \135 are the
|
|
# brackets, written so no tr reads them as a class.
|
|
found=$RUNNER_TEMP/findings/found.txt
|
|
if [[ $(head -n 1 "$found") != "# govulncheck findings" ]]; then
|
|
echo "the findings don't start with the scan job's first line" >&2
|
|
exit 1
|
|
fi
|
|
tail -n +2 "$found" | LC_ALL=C tr -cd '0-9A-Za-z.+~_ ()#@:/,\133\135\n-' > "$RUNNER_TEMP/clean.txt"
|
|
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
|
|
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
|
|
if [[ ! -s $RUNNER_TEMP/clean.txt ]]; then
|
|
if [[ -n $number ]]; then
|
|
gh issue close "$number" --comment "govulncheck finds no known vulnerability in main's code or in the releases' binaries."
|
|
fi
|
|
exit 0
|
|
fi
|
|
{
|
|
echo "govulncheck found known vulnerabilities in main's code or in the releases' binaries:"
|
|
echo
|
|
# Four backticks: a line from the database can't end the block early.
|
|
echo '````'
|
|
cat "$RUNNER_TEMP/clean.txt"
|
|
echo '````'
|
|
echo
|
|
grep -oE 'GO-[0-9]{4}-[0-9]+' "$RUNNER_TEMP/clean.txt" | sort -u | sed 's#.*#- https://pkg.go.dev/vuln/&#'
|
|
echo
|
|
echo "A binary's scan lists the vulnerable code it holds, and can name a package that isn't linked,"
|
|
echo "so check one with \`go version -m\` and \`govulncheck -mode=binary -show traces\` before releasing for it."
|
|
echo "A vulnerability in the standard library is fixed by the Go release that fixes it: \`scripts/bump.sh go\`,"
|
|
echo "or \`scripts/bump.sh go-minor\` when only a newer minor has the fix."
|
|
echo "One in a module is fixed by the module's fixed version: \`scripts/bump.sh go-mods\` or \`go get\`."
|
|
echo "A release's binaries keep theirs until the next release ships the fix:"
|
|
echo "see [Known vulnerabilities](https://next.devvm.dev/docs/contributing/maintaining/#known-vulnerabilities)."
|
|
} > "$RUNNER_TEMP/body.md"
|
|
if [[ -z $number ]]; then
|
|
gh issue create --title "$title" --label bug --body-file "$RUNNER_TEMP/body.md"
|
|
exit 0
|
|
fi
|
|
# An edit alone notifies nobody, so changed findings, the lines in
|
|
# the body's code fence, get a comment; a change to the rest of the
|
|
# text only edits the body.
|
|
gh issue view "$number" --json body --jq .body | tr -d '\r' > "$RUNNER_TEMP/old.md"
|
|
if ! cmp -s "$RUNNER_TEMP/old.md" "$RUNNER_TEMP/body.md"; then
|
|
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
|
|
if ! awk '/^````$/ { n++; next } n == 1' "$RUNNER_TEMP/old.md" | cmp -s - "$RUNNER_TEMP/clean.txt"; then
|
|
gh issue comment "$number" --body "The scans' findings changed: the description lists what they find now."
|
|
fi
|
|
fi
|