Repository navigation
fix(soc): first bring-up perms — velociraptor config dir, root-ca.pem, mount check - #681
Merged
Merged
Conversation
…, mount check Three things surfaced building odin (#266/#267), the first real bring-up of the soc stack. Velociraptor and alloy both run as root with cap_drop: [ALL], so they have no CAP_DAC_OVERRIDE and are bound by ordinary file permissions: - Velociraptor writes server.config.yaml on first start, but the checkout's stacks/soc/velociraptor/etc is owned by the deploy user, so root-without- DAC_OVERRIDE cannot create a file in it. The generate step fails silently (write_file returns null) and the container crash-loops on "no such file". Runbook §3 now chowns that dir to root, like the datastore already is. - alloy reads root-ca.pem (the CA's PUBLIC cert) to verify wazuh.indexer, but the generator leaves it 0400 owned by uid 1000, unreadable by capless root. Runbook §6 now chmods the public cert (never a key) to 0444. - check_mounted_config.py, run by `make up`, read every host-side mount source including the manager's certs (owned uid 999, 0400) and crashed with PermissionError, failing `make up` after the stack was already healthy. It now skips a cert the deploy user cannot read — generated once, never edited, so the edit-then-reload drift this guard catches cannot reach it. Also: §6's cert generator shares the stack's compose.yaml, so compose resolves every ${VAR:?} in it before running the service — `.env` must exist first. §6 now runs `make render STACK=soc` before the generator. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wazuh vulnerability detection downloads its content (~400 MB) and unpacks it to an ~8.5 GB tar in /var/ossec/tmp before importing it. That path was on the manager container's writable layer, so the first start filled odin's 30 GB OS disk to 100% (every other service healthy). §0's hardware note already puts "the vulnerability feed" on the 96 GB data disk; this routes the staging there, as a bind-backed volume beside indexer-data and velociraptor-datastore, and §2 creates /srv/soc-data/manager-tmp (uid 999, the manager's wazuh user). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-on to the manager-tmp fix: the ~8.5 GB the feed unpacks to (manager-tmp) was only half of it. Vulnerability detection then builds a persistent content database under /var/ossec/queue/vd that is itself ~8.5 GB and grows with the feed, and /var/ossec/queue was a plain named volume on the 30 GB OS disk — so the first import filled / to 100% and wedged the guest a second time, after the staging tar had been moved off. Bind-back manager-queue to the data disk, where §0 already accounts for "the vulnerability feed"; §2 creates the directory (uid 999). The agent event queue lives here too and wants the data disk anyway. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Sep 27, 2026
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.
Building
odin(#266/#267) was the first real bring-up of the soc stack, and three things needed fixing. Velociraptor and alloy both run as root withcap_drop: [ALL]— so noCAP_DAC_OVERRIDE, and they're bound by ordinary file permissions:Velociraptor config dir. It writes
server.config.yamlon first start, but the checkout'sstacks/soc/velociraptor/etcis owned by the deploy user. Root-without-DAC_OVERRIDEcan't create a file there, soinit.vql'swrite_filereturns null (silently) and the container crash-loops onopen /etc/velociraptor/server.config.yaml: no such file. Runbook §3 nowchown root:roots that dir, matching the datastore (/srv/soc-data/velociraptor) which §2 already makes root's.root-ca.pemperms. alloy reads the CA's public cert to verifywazuh.indexer(rather than skip verification), but the generator leaves it0400owned by uid 1000 — unreadable by capless root, so alloy restarts onCouldn't load root certificate … permission denied. Runbook §6 nowchmod 0444s the public cert (never a key).check_mounted_config.py(run bymake up) read every host-side mount source, including the manager's certs (uid 999,0400), and crashed withPermissionError— failingmake upafter the stack was already healthy. It now skips a cert the deploy user can't read: generated once, never edited, so the edit-then-reload drift this guard exists to catch can't reach it.Plus an ordering fix: the §6 cert generator shares the stack's
compose.yaml, and compose resolves every${VAR:?}in the file before running any one service — so.envmust exist first. §6 now runsmake render STACK=socbefore the generator.All four containers + alloy verified healthy on odin after these changes.
🤖 Generated with Claude Code