feat: run Fleet Node discovery without Nmap - #1034
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: HIGH Findings[HIGH] Automated review incomplete
NotesHuman review is required because the bounded automated review was incomplete. Generated by Codex Security Review | |
d51f0f5 to
7180786
Compare
7180786 to
7d8f89f
Compare
7d8f89f to
5ef95a6
Compare
5ef95a6 to
f7452e3
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is consistent and well tested; only a minor obsolete README security reference remains.
Pull request overview
Replaces Fleet Node Nmap execution with shared in-process TCP scanning while preserving direct plugin probing for explicit targets.
Changes:
- Adds bounded TCP scanning, probing, cancellation, and partial-result handling.
- Removes Fleet Node Nmap packaging and installation requirements.
- Adds platform-specific firmware disk-space checks.
File summaries
| File | Description |
|---|---|
server/internal/domain/fleetnode/discovery/service.go |
Uses shared range validation. |
server/internal/domain/fleetnode/discovery/reportscope.go |
Uses shared target matching. |
server/internal/domain/fleetnode/discovery/iprange_test.go |
Tests inclusive range behavior. |
server/go.mod |
Makes x/sys direct. |
server/Dockerfile.fleetnode.dev |
Removes Nmap package. |
server/docker-compose.fleetnode-ui-test.yaml |
Drops NET_RAW. |
server/cmd/fleetnode/scan.go |
Implements scanning and probing. |
server/cmd/fleetnode/scan_test.go |
Tests new discovery paths. |
server/cmd/fleetnode/run.go |
Configures the shared scanner. |
server/cmd/fleetnode/README.md |
Documents TCP discovery. |
server/cmd/fleetnode/nmap.go |
Removes Nmap integration. |
server/cmd/fleetnode/nmap_windows.go |
Removes Windows Nmap handling. |
server/cmd/fleetnode/nmap_unix.go |
Removes Unix Nmap handling. |
server/cmd/fleetnode/nmap_test.go |
Removes obsolete Nmap tests. |
server/cmd/fleetnode/minercommand.go |
Moves disk-space logic. |
server/cmd/fleetnode/firmware_space_windows.go |
Adds Windows disk-space support. |
server/cmd/fleetnode/firmware_space_unix.go |
Preserves Unix disk-space checks. |
server/cmd/fleetnode/control.go |
Integrates scanning and retained uploads. |
server/cmd/fleetnode/control_test.go |
Updates discovery tests. |
justfile |
Stops staging Nmap. |
deployment-files/fleetnode/tests/test-install-fleetnode.sh |
Removes Nmap installer assertions. |
deployment-files/fleetnode/install-fleet-node.sh |
Removes Nmap prerequisite. |
.github/workflows/proto-fleet-artifact-build.yml |
Stops installing Nmap in CI. |
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f7452e3 to
c2f54b9
Compare
c2f54b9 to
54d459f
Compare
54d459f to
4e86e7d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33073a6fa4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewable diff: +870/-699 across 24 files (excludes generated, test, and story files).
Summary
Fleet Nodes discover miners without installing or executing Nmap. Network scans feed open TCP endpoints into the existing miner plugins. Explicit IP lists and ranges probe plugins directly, preserving virtual miners that have no TCP listeners, and both paths retain identified devices when discovery stops early.
Stack: #1034 (this PR) → #1035 → #1036 → #1037
This diff targets
mainand includes the shared parser, DNS policy and bounded TCP scanner alongside Fleet Node adoption. PR #1030 is already onmainand supplies dispatch and report routing. This layer still uses the existing wire mode name and 1,024-target limit.Server runtime and dependency removal are in #1035; operator warnings in #1036; coordinated API rename and larger limits in #1037.
How it works
A node validates private targets and resolves names locally using the shared target and port rules. Network-mode validation reuses its parsed target for private-scope checks and address enumeration. Network scans filter open TCP ports; explicit IP lists and ranges feed the validated endpoints directly into the same bounded pool of up to 32 plugin probes. The ten-minute command budget and ten-second probe deadlines remain. At completion, the node uploads retained reports in 1,024-device batches under one 30-second upload budget, then acknowledges the command. Upload failure takes precedence over scan failure; deadline or supervisor truncation produces PARTIAL.
Diagrams
Areas of the code involved
Key technical decisions & trade-offs
Testing & validation
Post-deploy monitoring & validation
Release the complete stack with server, nodes and client updated together. On a controlled network, compare expected miners against both server and node discovery, exercise an incomplete scan, and confirm that retained results and its warning reach the client. Pause rollout if expected devices disappear, scans cannot stop within their budgets, or completed reports are lost. No deployment was performed for these draft PRs.
Restack validation: affected unit/race suites, server lint, protobuf lint, client type check and 33 focused client tests pass. Database integration tests remain for CI.