Skip to content

feat: agent-based distributed scanning#52

Open
hojmark wants to merge 71 commits intomainfrom
feat/agent
Open

feat: agent-based distributed scanning#52
hojmark wants to merge 71 commits intomainfrom
feat/agent

Conversation

@hojmark
Copy link
Copy Markdown
Owner

@hojmark hojmark commented Oct 17, 2025

No description provided.

@hojmark hojmark force-pushed the feat/agent branch 2 times, most recently from cc03943 to 7a4c18d Compare October 28, 2025 22:52
@hojmark hojmark force-pushed the feat/agent branch 5 times, most recently from a4fedd7 to 6fa5385 Compare November 10, 2025 22:07
@hojmark hojmark force-pushed the feat/agent branch 3 times, most recently from 3219be4 to fb2baab Compare December 3, 2025 19:50
@hojmark hojmark added the enhancement New feature or request label Feb 4, 2026
@hojmark hojmark added this to the 1.0.0 milestone Feb 13, 2026
@hojmark hojmark force-pushed the feat/agent branch 2 times, most recently from 8381ec4 to 5294ed8 Compare February 18, 2026 13:44
hojmark added 11 commits March 3, 2026 20:54
- Update image references from localhost/hojmark/drift:latest to localhost:5000/drift:dev
- Simplify distributed-scan-mvp topology by removing explicit bridge nodes (not supported in containerlab without OVS)
- Use direct point-to-point links for segment networks
- Add simple-test.clab.yaml for basic functionality testing
- Fix container entry points and commands for proper agent startup

Note: The distributed topology needs further work to properly create switched networks
with multiple nodes on the same segment, but basic functionality is now testable.
Change agent to bind to 0.0.0.0 instead of 127.0.0.1 to enable
connections from remote CLI instances in containerized environments.
This is essential for distributed scanning across network segments.
Extract common agent services (execution environment, subnet provider,
network scanner) into ConfigureAgentCoreServices() method to avoid
duplication between CLI and agent setup. This provides a cleaner
separation of concerns and makes it easier to maintain agent
dependencies.
- Remove manual 'agentid_' prefix addition in AgentSubnetProvider since AgentId already includes it
- Update DistributedNetworkScanner to compare full agent IDs with prefix (use agentId.Value)
- Fix Cluster peer stream creation to not add redundant prefix (2 locations)

This resolves agent lookup failures caused by doubled prefixes like 'agentid_agentid_...'
… cooperation-test

Introduces a structured containerlab integration test target (TestContainerlab)
with two passing test cases:
- simple-test: 1 agent + CLI + 1 target, verifies basic distributed scan
- cooperation-test: 3 agents + CLI + 5 targets, verifies multi-agent coordination
  and result merging (4/4 scan operations: local + 3 agents)

Fixes rootless Podman + pasta networking incompatibility by pre-creating the
'clab' management network before each deploy, so containerlab reuses it instead
of failing on the kernel bridge lookup it performs after creating a new network.

Also cleans up stale prototype topology files and adds hidden --id flag on
agent start for deterministic agent identity in tests.
- Fix MissingOption exit code: catch ArgumentException in CommandBase and return GeneralError
- Fix RemoteScan tests: update test agent IDs to use required 'agentid_' prefix
- Fix MergeOverlappingSubnetResults: dedup by Device ID (GetDeviceId().ToString()) and union addresses on merge
- Fix local scanner MAC resolution: fall back to local interface MAC for own IPs missing from ARP cache
- Add subnet-isolation containerlab topology and integration test assertions
- Update all affected Verifier snapshots
- Add WarnAgentPreview() extension method on IOutputManager that fans out
  to all outputs via CompoundLogger; covers both agent hosting and
  distributed scanning contexts
- Call WarnAgentPreview() at agent startup and before distributed scans
- Upgrade AgentSubnetProvider failure log from Information to Warning so
  excluded agents are visible
- Replace Console.WriteLine in PeerStream.DisposeAsync with structured
  LogTrace
- Update test snapshots to reflect new warning messages
hojmark added 14 commits March 3, 2026 21:16
…or annotations

Containerlab writes all its output to stderr by design. Nuke's default
logger maps stderr to Log.Error, which GH Actions annotates as errors.
Pass a custom logger to Clab() that logs both stdout and stderr at the
Information level.
@hojmark hojmark changed the title feat: agent feat: distributed network scanning Mar 10, 2026
@hojmark hojmark changed the title feat: distributed network scanning feat: agent-based distributed scanning Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant