Harden bench, refresh endpoints, sysbench by default with optional Geekbench 7 #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jay/sysperf!1
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/lucid-planck-v4zwtb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Security hardening for
bench, based on an audit of the script, plus fixes and improvements from testing on a fresh server. The basebenchis identical upstream iniandk/sysperf, so this applies there unchanged.What was wrong
$HOME/geekbench.icanhazip.com(plain HTTP) was expanded unquoted intocurl http://ip-api.com/json/$as_check. A spoofed reply such as1.2.3.4 -o /etc/cron.d/x http://evil/injects curl options, so an attacker could write any file as root.$RANDOM_IOTESTname (32k possibilities) in the current directory. In a world-writable directory, a local user could plant symlinks and have root overwrite any file with 2 GB of data.rm *_IOTESTalso deleted unrelated files.rm -rf geekbench/deleted./geekbenchin the current directory, not$HOME/geekbenchwhere the download actually went.echo -e, so JSON\u001bescapes from the lookup became real terminal escape sequences.readswallowed a byte of the script when run aswget … | bash.pingwasn't checked for. Geekbench scores came out blank because the result page answers 403 to scripted requests.Changes
Security
ipinfo.io/json(it looks up the caller's own address), so no response is ever put into a command line. Output is stripped of control characters and printed withprintf %s. The provider changed from ip-api.com, whose free tier is HTTP-only.https://ipv6.icanhazip.com.mktemp -ddirectory (mode 0700) in the current directory, so the I/O test still measures that disk. It's removed by an EXIT trap, and only our own files are deleted.awk -v.apt-get). The confirmation is read from/dev/tty.CPU benchmark
sysbenchfrom the distribution's own packages: single thread and all threads, 10 s each, reported in events per second. It's a ~1 MB download plus small libraries and uploads nothing. It's added to the dependency check and auto-install.GEEKBENCH=7(or1), for x86_64 and ARM.--proto '=https') and checked against pinned SHA-256 checksums before extraction. Primate Labs doesn't publish checksums, so the pins are the tarballs their CDN served over HTTPS on 2026-11-09.unknown error (internal code 35)).Network tests
speed.hetzner.de(dead). Cloudflare was left out because it answers 403 to scripted downloads; OVH outside Roubaix was left out because it redirects to an unknown location.curl: the first 100 MB via a range request (so 1 GB test files work too), capped at 15 s per host and averaged over what arrived. A row needs HTTP 200/206 and more than 1 MB, otherwise it showsfailed.curlfalls back from dead IPv6 addresses quickly.ping: retries over IPv4 when IPv6 gets no reply.iputils-pingis checked and installed.UX
/dev/ttyonly, so| teelogs stay clean, and disabled when there's no terminal.GEEKBENCH=7, including that with the piped one-liner the variable goes beforebash. The PayPal link now uses https.Testing
Fresh Debian 13 server (dual-stack KVM, 2 vCPU, 4 GB), final version:
GEEKBENCH=7run from a clean state: the missingsysbenchwas detected and installed. Every one of the 12 latency targets and 34 speed hosts returned a value. sysbench gave 610 single / 1230 multi, and Geekbench 7.1.0 gave 1290 single / 2363 multi, with the result link.Sandbox (Ubuntu 24.04 container):
GEEKBENCHvalues: unset,0,1,7, an unknown value and low disk space all behave as intended. The pinned checksums match the real tarballs.n/afallback.speed_test: a large file, a 404, a tiny file and an unreachable host, served locally.tee, and without a terminal.Follow-ups (not in this PR)
GEEKBENCH=7is used (marked with aTODOinbench). The free CLI has no option for it:--helplists only--unlock,--cpuand--sysinfo, and Primate Labs requires Geekbench Pro for offline use. It would need a user-supplied Pro license. The default run uploads nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_01WFUVi2gu5nYSuZeyRWAGiM