Skip to content

feat(analyst): OpenVAS on garuda, on demand, fenced to the domain's six (ADR-0093) - #1166

Merged
Gerrrt merged 7 commits into
mainfrom
gerrrt/garuda-openvas-921
Oct 11, 2026
Merged

Gerrrt merged 7 commits into
mainfrom
gerrrt/garuda-openvas-921

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Refs #921 (phase 3).

OpenVAS on garuda, as decided on 2026-10-10:

  • Kali's gvm packages, run on demand;
  • scans limited to the lab domain's six, 10.0.30.50–.55;
  • that scope enforced by nftables on garuda, not only by GVM's target list.

The decision is ADR-0093, and the procedure is scan-the-lab-with-openvas.md.

The fence

The scanner, openvas, runs as root, started by ospd-openvas through sudo. A rule keyed to the _gvm user would therefore miss every scan packet. The rule matches the cgroup of ospd-openvas.service instead.

  • Why the cgroup holds. Kali's /etc/pam.d/sudo includes only common-session-noninteractive, which has no pam_systemd. So sudo opens no systemd session, and openvas stays in that cgroup.
  • What it allows: the six, loopback, and DNS to morpheus. Everything else is counted, logged and dropped. There is no flush ruleset, so Docker's rules are untouched.
  • How it loads. nftables resolves a cgroup path at load, which nft -c on Saruman confirmed ("cgroupv2 path fails"). So a drop-in loads the table as the service's ExecStartPre, inside its cgroup. If the load fails, the start fails.

No estate silence

ADR-0091 expected a silence owned by #921. A scan of the six never crosses a router, and nothing estate-side sees inside VLAN 30, so there is nothing to silence. LabSegmentReachedInternalNetwork would fire only if the fence failed, and must page then.

State

  • On garuda: gvm is installed (Kali's units ship disabled at boot), and gvm-setup with its feed sync is running now.
  • Before this merges, this PR gets:
    • the fence installed;
    • the proof, a GVM Discovery task against out-of-scope 10.0.30.40 that must reach nothing and must raise the drop counter;
    • the setup facts, in the runbook's §7.

Local checks: check_docs.py, markdownlint 0.23.3 (0 issues) and lint pass.

🤖 Generated with Claude Code

…ix (ADR-0093)

Phase 3 of the analyst workstation.

- ADR-0093: Kali's gvm packages, run on demand (Kali ships every GVM unit
  disabled at boot); the scope is 10.0.30.50-55; no estate silence, because
  a scan of the six crosses no router and no estate alert sees it, while
  LabSegmentReachedInternalNetwork would mean the fence failed.
- stacks/analyst/gvm/gvm-scope.nft: an nftables table matching
  ospd-openvas.service's cgroup. The scanner runs as root through sudo, so
  no user match would hold it; the cgroup does, since Debian's sudo opens
  no systemd session. It allows the six, loopback and DNS to morpheus, and
  counts, logs and drops the rest. No flush ruleset.
- stacks/analyst/gvm/ospd-openvas-scope.conf: loads that table as the
  scanner's ExecStartPre, inside its cgroup, which nftables needs to exist
  at load; a failed load fails the start.
- docs/runbooks/scan-the-lab-with-openvas.md: setup, the fence, its proof
  by a GVM scan of an out-of-scope host, a scan, upgrades, removal.
- ADR-0091 note, roadmap, network, architecture, the analyst README and
  garuda's runbook point at it.

Refs #921.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The fence misses OpenVAS raw Ethernet traffic, its loader lacks required privileges, and the promised deployment proof remains unrecorded.

4 open findings
What changed in this PR

Adds on-demand OpenVAS scanning on garuda, intended to restrict scans to the six lab-domain hosts.

Changes:

  • Adds an nftables cgroup fence and systemd drop-in.
  • Adds ADR-0093 and an operational runbook.
  • Updates architecture, network, roadmap, and stack documentation.
File Description
README.md Updates ADR and runbook counts.
docs/​adr/​0091-put-a-kali-purple-analyst-workstation-on-saruman.md Links the deferred OpenVAS decision.
docs/​adr/​0093-run-openvas-on-garuda-on-demand-scoped-to-the-domain-by-nftables.md Records the OpenVAS architecture decision.
docs/​architecture.md Documents garuda’s scanner role.
docs/​network.md Documents intended scan boundaries.
docs/​roadmap.md Records completion of phase 3’s design.
docs/​runbooks/​build-the-analyst-workstation.md Links the OpenVAS procedure.
docs/​runbooks/​scan-the-lab-with-openvas.md Adds setup, verification, scanning, and removal steps.
stacks/​analyst/​README.md Describes the host-level GVM files.
stacks/​analyst/​gvm/​gvm-scope.nft Implements the nftables scope rules.
stacks/​analyst/​gvm/​ospd-openvas-scope.conf Loads the fence before scanner startup.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread stacks/analyst/gvm/gvm-scope.nft Resolved
Gerrrt and others added 6 commits October 10, 2026 15:56
ospd-openvas runs as _gvm, so its ExecStartPre ran nft as _gvm and the
first start on garuda failed with "Operation not permitted" (failing
closed, as designed). The + prefix lifts the user for that one command;
it still runs in the service's cgroup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runbook section 7: setup (feed import over an hour after gvm-setup), the
fence's first start failing closed until ExecStartPre=+, and the proof: a
GVM Discovery scan of out-of-scope 10.0.30.40 dropped 11,681 times with 0
open ports. The drop log is now rate-limited (5/s) while the counter still
counts every packet; re-checked from inside the scanner's cgroup, with the
in-scope .50 reachable. GVM stopped afterwards. Changelog entry.

Refs #921.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gvm-start only starts the services, so the runbook's scan and upgrade steps
and ADR-0093 now run greenbone-feed-sync --type all first, as gvm-setup
does, and wait for gvmd's import before scanning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed and accepted

A review noted that OpenVAS's NASL send_frame and send_arp_request use
AF_PACKET, below the nftables output hook, so the cgroup fence is IP only.
Measured on garuda: an arping from a test netns to the out-of-scope .40 put
no frame on eth0, which is what strict L2 containment would buy. But the
clean netns form (veth + NAT) collides with Docker's FORWARD policy here, so
it would need the scanner's own NIC.

On VLAN 30, one broadcast domain where every host already reaches every
other at L2 and ARP spoofing is assumed (ADR-0068), that gain is immaterial.
So the cgroup IP fence stands, alive tests are kept off ARP (ICMP/TCP or
Consider Alive), and the L2 residual is written into ADR-0093 decision 4,
security.md and the runbook, with the dedicated-NIC netns design recorded as
the upgrade for the day garuda scans across a routed boundary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…0093)

Replaces the cgroup IP fence, which a review showed was IP-only: NASL's
send_frame and send_arp_request go through AF_PACKET, below an IP hook.

The scanner (ospd-openvas and the openvas it spawns) now runs in a gvmscan
network namespace whose only route to the segment is scan0, a macvlan at
10.0.30.63, behind an nftables netdev egress filter that drops every frame
-- IP, ARP, raw -- to anything but the six. A macvlan, not a second NIC: no
tofu or Proxmox change, on-link so Docker's FORWARD=DROP (which blocked a
veth+NAT form) never sees it. A veth carries only MQTT to the host broker.

- stacks/analyst/gvm/: gvm-scan-netns.{sh,service} build the namespace;
  scan0-egress.nft is the netdev filter; ospd-openvas-netns.conf joins the
  namespace; mosquitto-gvm.conf + the order drop-in add the veth listener.
  The cgroup files are removed.
- Proved on garuda: ospd in gvmscan; arping/TCP/ICMP to out-of-scope .40
  dropped (counter rising); in-scope .50:445 connected.
- ADR-0093 decision 4, the runbook (install/proof/upgrade/teardown/§7),
  security.md, network.md (.63) and the analyst README rewritten.

Refs #921.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 71b21bc into main Oct 11, 2026
8 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/garuda-openvas-921 branch October 11, 2026 04:41
Gerrrt added a commit that referenced this pull request Oct 11, 2026
…0094

#1166 (OpenVAS on garuda) merged first as ADR-0093, so this branch's ADR
is renumbered to ADR-0094, with every reference to it changed and #1166's
references to its own ADR-0093 left alone. README counts 94 ADRs and
main's 49 runbooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants