6805 Commits

Author SHA1 Message Date
Volobue
01511f3aef added endpoint to v3 branch 2026-05-25 21:37:04 +03:00
Volobue
b74ebafb8f api endpoint implemented 2026-05-25 20:07:05 +03:00
Jeremy Grossmann
0fdeb34f1a
Merge pull request #2747 from yueguobin/feature/rbac-user-isolation-roadmap
docs: add RBAC user isolation roadmap
2026-05-25 04:40:04 +08:00
YueGuobin
9e989566f5
docs: add RBAC user isolation roadmap
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 00:40:42 +08:00
Jeremy Grossmann
ec55b9f089
Merge pull request #2746 from yueguobin/feature/gns3-copilot-packet-filter
feat: add packet filter management tool for GNS3-Copilot fault injection
2026-05-25 00:00:09 +08:00
YueGuobin
ee80df9e9c
docs: add AIOps fault injection testing pipeline roadmap
Roadmap for duplicating company network architecture into GNS3 and
building an automated pipeline to inject faults and validate AIOps
diagnosis, with traffic injection support for enhanced realism.
2026-05-24 23:25:01 +08:00
YueGuobin
045db5bdd8
fix: clean BPF syntax error message and specify loopback interface
- Add -i lo to tshark command to avoid "(null)" interface in errors
- Strip "for interface" suffix from error message for cleaner output
2026-05-24 23:00:41 +08:00
YueGuobin
ce58e9adc8
feat: add BPF syntax validation using tshark
- Add _validate_bpf_syntax() method to validate BPF expressions
- Use tshark with 1-second timeout for syntax checking
- Check for "Invalid" in output to detect syntax errors
- Validate BPF filters before applying them to links
- Handle tshark not installed scenario gracefully
- Support both single and multiple BPF expressions
- Return detailed error messages for syntax validation failures
2026-05-24 22:49:59 +08:00
YueGuobin
e71931d096
feat: add show_filters_icon parameter to packet filter tool
- Add show_filters_icon parameter with default value False
- Pass show_filters_icon to link.update() in set and clear operations
- Update tool description to explain default behavior
- Remove "clear" action from description to simplify interface
- Hide filter icon in GNS3 Web UI by default for cleaner UI during fault injection
2026-05-24 22:46:52 +08:00
YueGuobin
dc04c29e7e
docs: add GNS3 appliance loading mechanism to memory
Document how GNS3 loads appliance files from builtin and custom directories with priority rules, including storage locations and the design rationale that allows users to customize devices without losing changes during registry updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 22:31:28 +08:00
YueGuobin
8ba1f064d2
feat: add packet filter management tool for GNS3-Copilot fault injection
Add comprehensive packet filter management functionality to GNS3-Copilot,
enabling AI-powered fault injection scenarios with network simulation
capabilities like latency, packet loss, and corruption.

## Changes

### New Features
- **GNS3PacketFilterTool**: New LangChain tool for managing packet filters
  on GNS3 links with support for delay, packet loss, corruption,
  frequency_drop, and BPF filtering
  - Actions: get_available, set, get, clear
  - Integrated into troubleshooting_injection mode for fault scenarios

### API Integration
- **Link.available_filters()**: Added method to custom_gns3fy.py Link class
  - Queries available filter types for specific links
  - API v3+ only (raises ValueError for v2 connectors)
  - Returns filter definitions with parameters and constraints

### Tool Integration
- Added GNS3PacketFilterTool to TROUBLESHOOTING_INJECTION_MODE_TOOLS
- Positioned as 3rd tool in fault injection workflow
- Optimized for troubleshooting practice scenarios

## Files Modified
- gns3server/agent/gns3_copilot/agent/gns3_copilot.py
- gns3server/agent/gns3_copilot/gns3_client/custom_gns3fy.py
- gns3server/agent/gns3_copilot/tools_v2/__init__.py

## Files Added
- gns3server/agent/gns3_copilot/tools_v2/gns3_packet_filter.py

## Testing
- All validation tests passed
- Version checking verified (v3+ only)
- Tool integration confirmed in troubleshooting mode
2026-05-24 22:31:28 +08:00
Jeremy Grossmann
279ea9eed3
Merge pull request #2745 from yueguobin/feat/link-show-filters-icon
feat: add show_filters_icon property to Link for controlling Web UI filter icon display
2026-05-24 22:05:04 +08:00
YueGuobin
fca4459e5f
fix: update test_json expected output to include show_filters_icon field 2026-05-24 20:48:58 +08:00
YueGuobin
31d8046e30
fix: add getattr fallback to show_filters_icon property for backward compatibility 2026-05-23 17:09:50 +08:00
YueGuobin
a1f4942746
feat: add show_filters_icon property to Link for controlling Web UI filter icon display
This commit adds a new  property to the Link class, allowing users to control whether filter icons are displayed in the Web UI at the individual link level.

**Changes:**
- Added  attribute to Link class (default: True)
- Added  property getter
- Added  method for updating the property
- Updated  to include the new field with backward compatibility
- Added  field to LinkBase schema using Optional[bool] = Field(True, ...) pattern
- Updated API routes to handle the new field in create and update operations
- Added loading logic for show_filters_icon in project.open() to preserve settings when reopening projects

**Schema Definition:**
Uses the same pattern as the  field:

**API Impact:**
- POST /v3/projects/{project_id}/links - accepts  in request body
- PUT /v3/projects/{project_id}/links/{link_id} - can update
- GET /v3/projects/{project_id}/links/{link_id} - returns  field

**Future Applications:**
This feature provides granular control for future AI fault injection modules to manage link-level protocol failures while maintaining clean UI presentation.
2026-05-23 16:57:39 +08:00
YueGuobin
367c565d7c
fix: ensure show_filters_icon is always returned in API responses
Set default value for show_filters_icon in LinkBase schema to ensure the field is always included in API responses, even when response_model_exclude_unset=True is used.
2026-05-23 15:21:44 +08:00
YueGuobin
aa6845b32b
feat: add show_filters_icon property to Link for controlling Web UI filter icon display
This commit adds a new `show_filters_icon` property to the Link class, allowing users to control whether filter icons are displayed in the Web UI at the individual link level.

**Changes:**
- Added `_show_filters_icon` attribute to Link class (default: True)
- Added `show_filters_icon` property getter
- Added `update_show_filters_icon()` method for updating the property
- Updated `asdict()` to include the new field in both topology and regular dumps
- Added `show_filters_icon` field to LinkBase schema
- Updated API routes to handle the new field in create and update operations

**API Impact:**
- POST /v3/projects/{project_id}/links - accepts `show_filters_icon` in request body
- PUT /v3/projects/{project_id}/links/{link_id} - can update `show_filters_icon`
- GET /v3/projects/{project_id}/links/{link_id} - returns `show_filters_icon` field

**Future Applications:**
This feature provides granular control for future AI fault injection modules to manage link-level protocol failures while maintaining clean UI presentation.
2026-05-23 14:57:58 +08:00
Jeremy Grossmann
8719e12c59
Merge pull request #2742 from yueguobin/fix/paramiko-dependency-conflict
fix: remove explicit paramiko pin to resolve dependency conflict with netmiko
2026-05-19 19:32:18 +08:00
YueGuobin
cd737cc5ed
fix: remove explicit paramiko pin to resolve dependency conflict with netmiko
paramiko>=5.0.0 conflicts with netmiko 4.7.0 which requires paramiko<5.0.
Remove the explicit pin; paramiko is pulled in transitively via netmiko.
To fix CVE-2026-44405, upgrade paramiko separately:
  pip install "paramiko>=5.0.0"

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 08:52:19 +08:00
Jeremy Grossmann
ca2004e715
Merge pull request #2738 from yueguobin/docs/skills-editor-api
Documentation improvements and Skills Editor API roadmap
2026-05-19 01:13:20 +08:00
Jeremy Grossmann
b65ce034e5
Merge pull request #2739 from yueguobin/fix/unclosed-client-session-websocket-proxy
fix: close DockerHTTPClient session to prevent UnixConnector leak in Web Wireshark
2026-05-19 01:12:22 +08:00
Jeremy Grossmann
529144901f
Merge pull request #2740 from yueguobin/fix/cve-2026-44405-paramiko
fix: update netmiko to 4.7.0 and pin paramiko>=5.0.0 to fix CVE-2026-44405
2026-05-19 00:59:03 +08:00
Guobin Yue
0e45d62c06
Merge branch '3.0' into fix/cve-2026-44405-paramiko 2026-05-19 00:08:38 +08:00
YueGuobin
6e7cab3fec
fix: update netmiko to 4.7.0 and pin paramiko>=5.0.0 to fix CVE-2026-44405
CVE-2026-44405 allows SHA-1 signature algorithm in paramiko through
4.0.0. netmiko 4.7.0 still permits paramiko<5.0, so pip resolves to
the vulnerable 4.0.0. Explicitly pinning paramiko>=5.0.0 ensures the
fix commit a448945 is included.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 00:07:18 +08:00
Guobin Yue
11fe3a24cf
Merge branch '3.0' into fix/unclosed-client-session-websocket-proxy 2026-05-19 00:02:26 +08:00
YueGuobin
868e317d24
fix: close DockerHTTPClient session to prevent UnixConnector leak in Web Wireshark
The Web Wireshark WebSocket endpoint created a WebWiresharkManager but
never called close(), leaving the DockerHTTPClient's ClientSession with
UnixConnector unclosed when users closed the browser tab.

Also switch asyncio.wait in WebSocket proxy from ALL_COMPLETED to
FIRST_COMPLETED to avoid blocking cleanup when one direction disconnects.
2026-05-18 23:59:56 +08:00
Guobin Yue
7444551a66
Merge branch '3.0' into docs/skills-editor-api 2026-05-18 23:42:31 +08:00
YueGuobin
ef16c87a02
docs: add Web Wireshark Docker image optimization analysis
Add comprehensive roadmap document for optimizing the gns3/web-wireshark
Docker image size from current 2GB to target 1.5GB (25% reduction).

Key findings:
- 570MB of cleanable files identified (locales, docs, ibus, dev packages)
- Compression analysis shows limited benefit (1-5%) vs file cleanup (25%)
- Detailed implementation plan with safe optimization phases
- Focus on transfer optimization and build-time compression strategies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:58:06 +08:00
grossmj
ba79f1c226
Fix Docker build and publish API doc actions 2026-05-13 17:19:08 +08:00
grossmj
7cf25bc0d5
Release v3.1.0a2 v3.1.0a2 2026-05-13 00:34:05 +08:00
grossmj
7bb0a2a863
Bundle web-ui v3.1.0a2 2026-05-13 00:29:25 +08:00
grossmj
748b8a1571
Sync appliances 2026-05-13 00:25:27 +08:00
YueGuobin
c5a59acc40
docs: move packet analysis from roadmap to implemented
Rewrite the packet-analysis document based on actual code:
protocol-oriented analysis with tshark, 40+ supported protocols,
two-tool architecture (skills query + capture analysis), field
validation, and hot reload support.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:59:34 +08:00
YueGuobin
fd08885d94
docs: reorganize roadmap files into dedicated subdirectory 2026-05-12 22:53:35 +08:00
YueGuobin
0ee370d6ab
docs: add Skills Editor API roadmap
Document the planned CRUD + PR management API for GNS3 skills
(prompts, fault injection, device skills, packet analysis),
enabling the Web UI to browse, edit, save, and contribute
skill changes back to the upstream repository.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:52:23 +08:00
Jeremy Grossmann
c71dfbb6b5
Merge pull request #2729 from yueguobin/feature/troubleshooting-issue-injection
feat: add fault injection system and external skills repository
2026-05-12 22:24:00 +08:00
YueGuobin
30a140a9e3
fix: surface tshark stderr errors to LLM, not just log them 2026-05-12 15:10:27 +08:00
YueGuobin
b79fea918d
fix: hint LLM about -c behavior when tshark returns empty with -c 2026-05-12 14:54:50 +08:00
YueGuobin
09b0fbcfea
fix: update search_fields examples to use existing field names 2026-05-12 14:48:37 +08:00
YueGuobin
73e0de7706
fix: reject multi-keyword search_fields, single keyword only 2026-05-12 14:47:00 +08:00
YueGuobin
c357d52fbf
fix: document action/query params in PacketAnalysisTool description 2026-05-12 14:36:21 +08:00
YueGuobin
2a34d0ef58
feat: add search_fields action to PacketAnalysisTool for real-time field lookup 2026-05-12 14:33:13 +08:00
YueGuobin
32c3b4cd35
feat: validate tshark -e field names before running analysis 2026-05-12 14:27:16 +08:00
YueGuobin
9c23f9037c
fix: document -c behavior caveat in PacketAnalysisTool description 2026-05-12 14:00:58 +08:00
YueGuobin
b7a0b611df
fix: demote loader-level load logs to DEBUG, info already reported by manager
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 13:52:05 +08:00
YueGuobin
89da58fe1b
fix: promote skills/prompts load logs to INFO level
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 13:46:36 +08:00
YueGuobin
c5af9ce389
fix: load packet analysis protocols during skills initialization
- Add reload_packet_analysis_protocols() call in _ensure_skills_manager()
- PACKET_ANALYSIS_REGISTRY was empty because it was never loaded
2026-05-12 13:41:52 +08:00
YueGuobin
67b3b778b8
feat: add PacketAnalysisSkillsTool
- Register packet_analysis_skills as a LangChain tool for LLM
- LLM can query protocol field definitions before calling packet_analysis
- Follows the same pattern as DeviceSkillsTool and InjectionSkillsTool
2026-05-12 13:37:59 +08:00
YueGuobin
2a38816d3d
fix: remove remaining quoted example from tool input docstring 2026-05-12 13:30:18 +08:00
YueGuobin
b991125c6c
fix: use shlex.split for tshark_args parsing
- Replace str.split() with shlex.split() to handle quoted arguments
- LLM may pass args with or without quotes, both work correctly now
2026-05-12 13:29:31 +08:00