Repository navigation
fix(sensor): measure the memory bounds; zeek's halves to 2048m - #1575
Merged
Merged
Conversation
Alloy's 1024m is confirmed by 12 days of its own RSS (peak 297 MiB). Zeek's 286 MiB peak comes from only 25 h on the box, with no attack exercise in it, so its limit drops to about 7x that rather than the estate's 3.5x, and the comment says when to tighten it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The sensor memory-limit adjustment has no active review issues.
No open issues 🎉
What changed in this PR
This PR uses measured memory usage to revise the sensor stack’s limits on fenrir, reducing Zeek’s allocation while retaining headroom for attack exercises.
Changes:
- Reduce Zeek’s memory and memory-plus-swap limits from 4096m to 2048m.
- Update Zeek and Alloy comments with measurements and sizing rationale; Alloy remains at 1024m.
- Add a changelog entry recording the measurements and remaining audit work.
| File | Description |
|---|---|
stacks/sensor/compose.yaml |
Halves Zeek’s limits and documents measured usage for Zeek and Alloy. |
docs/changelog.md |
Records the limit adjustment, supporting measurements, and audit follow-ups. |
Review effort: Balanced
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
stacks/sensor/compose.yaml: zeek'smem_limit/memswap_limitgo from 4096m to 2048m. The comments on zeek and alloy now record measurements instead of "a bound, not a measurement".docs/changelog.md: a 2026-11-18 entry with the numbers and what is still open from fenrir's audit.Why
The audit of 2026-11-13 (next step 4) asked for the sensor stack's bounds to be re-derived, as the compose comments had said since October. The lab's Prometheus keeps only the root cgroup for fenrir, so:
process_resident_memory_bytes{job="fenrir-alloy"}over the 12 days of history peaked at 297 MiB, median 286. 1024m is the estate's ~3.5x (Set memory limits on the six services to bound the blast radius of a leak #114), so it stays.VmHWMwas 286 MiB (103 MiB anonymous) over the 25 h since the 2026-11-17 reboot; the cgroup'smemory.peakwas 352 MiB, page cache included. Earlier days are hidden in the guest's whole-host RSS, which workstation tooling held near 1 GiB (spikes to 1.4 GiB) until the cleanup at about 23:00 UTC 2026-11-17; since then it has peaked at 396 MiB. 2048m is about 7x, not 3.5x: a day is thin, it held no attack exercise, Zeek's state grows with connections, and an OOM-kill only restarts it with nothing alerting. The comment says to tighten it once a fortnight that includes an exercise has been read.Blast radius
The sensor stack on fenrir only, and only once
make up STACK=sensorruns there; the change recreatessensor-zeek, so capture stops for a few seconds. 2048m is 7x the measured peak, so no OOM is expected. The guest's 8 GiB inbuild-the-sensor-guest.mdis still described as a bound to re-derive, which stays true; this PR does not touch it.Verification
alexander, and/proc/<pid>/statusand the cgroups'memory.peakon fenrir (read-only, no sudo).check_docs.pyand the close-keyword check pass.lint.shpasses yamllint, shellcheck, ruff and actionlint (local binaries); it skips markdownlint-cli2, zizmor, packer, tofu and editorconfig-checker, which need a docker daemon the Mac lacks, andansible-lintfails on the Mac's runner, which is environmental: no Ansible changes here. CI runs them all, including the stack boots.make up STACK=sensoron fenrir, thendocker inspect -f '{{.HostConfig.Memory}}' sensor-zeekreads 2147483648 and the container is healthy.🤖 Generated with Claude Code