Conversation
cc03943 to
7a4c18d
Compare
a4fedd7 to
6fa5385
Compare
3219be4 to
fb2baab
Compare
8381ec4 to
5294ed8
Compare
Enhanced DistributedNetworkScanner to provide clear visibility into scan failures without requiring TUI changes. The existing log window will automatically display these warnings: - Enhanced BuildFinalResult to log different messages based on success: - Success: Normal info log with scan statistics - Partial failure: Warning log listing failed subnet count and CIDRs - Improved error handling in ScanSingleSubnetViaAgentAsync: - Separate handling for cancellation vs other exceptions - More detailed error messages including the error reason - Clear indication that partial results are being returned These warnings will appear in: - TUI mode: Displayed in the log window - Non-TUI mode: Written to console/log output - All modes: Captured in structured logs for monitoring No TUI changes needed - minimal invasive approach using existing logging infrastructure.
Created comprehensive containerlab topology and test infrastructure to validate the distributed scanning MVP in a realistic multi-segment network environment. Topology design: - Management network (10.0.0.0/24) connecting CLI and all agents - Segment A (192.168.10.0/24) isolated from CLI, accessible to agent1 and agent3 - Segment B (192.168.20.0/24) isolated from CLI, accessible to agent2 and agent3 - 4 target devices (2 per segment) for discovery validation - Multi-homed agent3 to test overlapping subnet handling Test coverage: - Agent identity persistence across restarts - Subnet discovery from multiple agents - Distributed scanning with source-based assignment - Overlapping subnet detection and result merging - Retry logic with simulated agent failures - Warning logs for partial results - Device deduplication across scans Files added: - distributed-scan-mvp.clab.yaml: Main topology definition - test-inventory.yaml: Agent configuration for tests - test-integration.sh: Automated test script with validation - README.md: Documentation with manual testing instructions The test script validates all MVP requirements end-to-end and can be integrated into CI/CD pipelines.
- 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
…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.
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.
No description provided.