An isolated local lab that extends the single-VM de-risk (deploy/validation/vm, 2026-11-08) to a multi-sensor fleet run over days, to produce the delayed-label history the Stage 4 fleet gate needs. All local/offline: Caldera on loopback (rootless Docker, capped), sensor VMs reach it only via the qemu slirp gateway, no traffic leaves the host; payloads are inert markers (a copy of /bin/sleep with a marker string), never real malware. - range_up.sh: boot/resume Caldera + N Arch VMs running the real daemon (eBPF + fanotify), benign workload and a Caldera agent as systemd units; idempotent and travel-safe (VM disks + scheduler state persist under $SB_RANGE_DIR, the scheduler paces by its own uptime, so suspend/reboot just pauses it and range_up.sh resumes). - range_workload.sh: varied benign activity so the detector learns a real baseline the emulated incidents must stand out from. - range_attack.py: one distinct Caldera incident per 30-90 min per sensor (fresh ability + operation so each lands in its own replay window); incidents are unknown to the rules at exec time, then a later rule-file update + rules reload lets the retro-hunt label the earlier windows -- the delayed extra positives the gate measures, produced the production way, not injected. - range_status.sh / range_down.sh (pause or --destroy), README, cloud-init. Nothing here writes to the repo; the $SB_RANGE_DIR runtime tree is disposable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
1.9 KiB
Bash
Executable file
34 lines
1.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Benign background activity on a range sensor (runs as the `arch` user under systemd). Varied, realistic
|
|
# shapes so the daemon learns a real baseline the attacks have to stand out from: shells and pipelines,
|
|
# small compiles, git, package queries, python one-liners, local HTTP fetches, cron-like bursts, file
|
|
# churn in the home dir. Paced (sleep between iterations) and niced by the unit.
|
|
set -uo pipefail
|
|
work=$HOME/work
|
|
mkdir -p "$work/src" "$work/logs"
|
|
cd "$work"
|
|
[ -d repo/.git ] || { git init -q repo && cd repo && git config user.email range@example && git config user.name range && \
|
|
echo seed >README && git add . && git commit -qm init && cd ..; }
|
|
cat >src/hello.c <<'EOF'
|
|
#include <stdio.h>
|
|
int main(void) { puts("hello"); return 0; }
|
|
EOF
|
|
python3 -m http.server 18080 --bind 127.0.0.1 --directory /usr/share/doc >/dev/null 2>&1 &
|
|
trap 'kill %1 2>/dev/null' EXIT
|
|
i=0
|
|
while true; do
|
|
i=$((i + 1))
|
|
case $((RANDOM % 10)) in
|
|
0) gcc -O1 -o src/hello src/hello.c && ./src/hello >/dev/null ;;
|
|
1) (cd repo && date >>README && git add README && git commit -qm "update $i" && git log --oneline | head -3 >/dev/null) ;;
|
|
2) pacman -Q | awk '{print $1}' | sort | head -50 | wc -l >/dev/null ;;
|
|
3) python3 -c "import json,hashlib; print(json.dumps({'i': $i, 'h': hashlib.sha256(b'$i').hexdigest()}))" >"logs/j$((i % 20)).json" ;;
|
|
4) curl -s -o /dev/null http://127.0.0.1:18080/ || true ;;
|
|
5) find /usr/share -maxdepth 2 -name '*.txt' 2>/dev/null | head -20 | xargs -r wc -l >/dev/null 2>&1 ;;
|
|
6) tar -czf logs/backup.tgz logs/*.json 2>/dev/null; ls -la logs >/dev/null ;;
|
|
7) ps aux | sort -k3 -rn | head -5 >/dev/null; uptime >/dev/null ;;
|
|
8) for f in a b c; do echo "$i $f" | sha1sum >/dev/null; done; sleep 1 ;;
|
|
9) journalctl --user -n 5 --no-pager >/dev/null 2>&1 || true ;;
|
|
esac
|
|
sleep $((5 + RANDOM % 25))
|
|
done
|