Repository navigation
feat(soc): serve the lab pipeline's agent MSIs from odin, to the six only (#1068) - #1071
Merged
Merged
Conversation
…only (#1068) #448's rebuild stopped at --tags soc: roles/soc_agents had no URL for either installer. The SOC stack gains agent-msi, the estate's Caddy at stacks/lab's digest (numeric user, read-only root, every capability dropped), serving ${SOC_DATA_DIR}/agent-msi on 8448. Its Caddyfile answers 10.0.30.50-55 and gives everyone else 403, since Hicks routes to odin and the Velociraptor MSI carries the enrolment config. scripts/stage-agent-msis.sh stages both from the role's pins: the Wazuh MSI from the vendor, and the Velociraptor MSI found by hash in the server's datastore. It refuses a hash mismatch, and renames files into the bind-mounted directory rather than replacing it. group_vars/all.yaml sets both URLs from the pinned versions. Refs #1068: it closes once odin serves the MSIs and a fresh guest installs from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Configurable paths and ports can diverge between staging, Compose, and Ansible, and cleanup can leave unintended served files.
4 open findings
What changed in this PR
Adds an address-restricted MSI service on odin so fresh lab-domain guests can install pinned SOC agents.
Changes:
- Adds hardened Caddy-based MSI hosting.
- Adds verified MSI staging and Ansible URLs.
- Documents deployment, security, and architecture impacts.
| File | Description |
|---|---|
stacks/soc/README.md |
Documents the new service. |
stacks/soc/compose.yaml |
Defines the hardened Caddy container. |
stacks/soc/Caddyfile |
Restricts MSI access to six guests. |
stacks/soc/.env.example |
Adds the published port setting. |
scripts/stage-agent-msis.sh |
Fetches, verifies, and stages MSIs. |
scripts/README.md |
Documents the staging script. |
docs/security.md |
Records the accepted security residual. |
docs/runbooks/build-the-soc-guest.md |
Adds MSI staging instructions. |
docs/runbooks/build-the-lab-domain.md |
Adds staged MSIs as a prerequisite. |
docs/changelog.md |
Records the change. |
docs/adr/0030-give-the-security-tooling-its-own-guest-and-its-own-stack.md |
Documents port 8448. |
ansible/roles/soc_agents/defaults/main.yml |
Updates MSI-source documentation. |
ansible/inventory/group_vars/all.yaml |
Configures agent download URLs. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…ck's data dir (#1068) - check_caddyfile.sh finds a stack's Caddy image by the service name `caddy`, so Validate configs failed on `agent-msi`. Renamed; the container is still soc-agent-msi. - 8448 is fixed in compose.yaml: group_vars names it in both URLs, so a tunable could only drift from them. AGENT_MSI_PORT is gone. - stage-agent-msis.sh reads SOC_DATA_DIR from the environment, then the stack's .env, then .env.example, the way compose.yaml gets it. - Its cleanup removes every other entry, hidden files and directories included, since whatever is left is served. - stacks/soc/README.md's Layout block names the Caddyfile and seven services. Refs #1068 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
added a commit
that referenced
this pull request
Oct 8, 2026
#1071's first deploy on odin crash-looped ('exec caddy failed: Operation not permitted'): the image's caddy binary carries cap_net_bind_service as a file capability, and the compose had dropped every capability. Nothing in CI started the container, so odin was the first place it showed. The hardened-boot job now boots soc/caddy like the sensitive tier's five, with stacks/soc/compose.yaml in the proof cache's key. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.


Replaces #1070, whose commit message carried a close keyword for #1068 ("No close keyword in prose" failed, rightly). Same tree, one commit, message corrected.
Refs #1068. #1068 closes after deploy on odin and a
--tags socthat fetches from it.Why
#448's rebuild stopped at
--tags soc:roles/soc_agentshad no URL for either installer. It got past that with a temporaryhttp.serveron odin.What
stacks/soc: newagent-msiservice.stacks/labruns, with that stack's hardening:user 65534,read_only,cap_drop: [ALL]andno-new-privileges. Port 8448 is above 1024, so it keeps no capability at all.${SOC_DATA_DIR}/agent-msiread-only on${BIND_ADDR}:8448.stacks/soc/Caddyfile:/healthzfor the healthcheck;file_serverfor10.0.30.50/31 .52/31 .54/31only, with no directory browsing;403for everyone else. Hicks routes to odin from VLAN 50, and the Velociraptor MSI carries the client's enrolment config, the same reason feat(ansible): the lab domain's tiers, shares and SOC agents as roles (#448) #864 took it out of SYSVOL.scripts/stage-agent-msis.sh, run as root on odin:roles/soc_agents/defaults/main.yml, so there is one copy of the pins;group_vars/all.yaml:soc_agents_wazuh_msi_urlandsoc_agents_velociraptor_msi_urlare built from the pinned versions. They resolve tohttp://10.0.30.60:8448/wazuh-agent-4.14.7.msiand…/velociraptor-client-0.77.2.msi.build-the-soc-guest.md§11 gains the staging step;security.mdrow: scoped by address and accepted, with a spoofable address as the residual;Checked here
caddyv2.11.7 passesvalidateandfmt --diff. Run with the allow-list pointed at 127.0.0.1: an allowed file gives 200 with its body,/gives 404 (no listing), a missing file gives 404, and a disallowed address (::1) gives 403.shellcheckis clean.ansible-lintpasses at the production profile;yamllintis clean oncompose.yamlandgroup_vars. Both URLs resolve as above throughansible -m debug.markdownlintandcheck_docs.pypass.Still to do, on odin, after merge
make up STACK=soc;sudo scripts/stage-agent-msis.sh;🤖 Generated with Claude Code