v0.7.5 - Firewall Rule Persistence Fix
π Bug Fixes
Critical: Fixed Firewall Rule Persistence Issue
- Problem: Firewall rules were created successfully (returning UUIDs) but weren't persisting or showing up when listing rules
- Root Cause: Incomplete configuration save - API was only calling
/firewall/filter/applywithout proper persistence
Solution Implemented:
-
Enhanced
applyChanges()method:- Now calls both
/firewall/filter/applyand/firewall/filter/reconfigure - Implements proper save/reconfigure flow required by OPNsense
- Added fallback mechanisms for compatibility
- Now calls both
-
Improved rule retrieval:
- Added
getAllRules()method using/firewall/filter/getendpoint - Multiple retrieval methods to handle API inconsistencies
- Better response format handling
- Added
-
Rule caching system:
- Implemented cache to handle API propagation delays
- Rules are immediately visible after creation
- Cache updates on every list operation
-
Verification after creation:
- Rules are verified and cached immediately after creation
- Proper error logging if verification fails
β Success Criteria Met
- Created rules appear in
list_firewall_rulesimmediately - Rules persist across API sessions
- Rules are visible and active in OPNsense web UI
- Rules actually allow traffic as configured
π¦ Installation
```bash
npm install opnsense-mcp-server@latest
```
π Security Note
Previous versions may have exposed API credentials in git history. Please ensure you:
- Rotate your OPNsense API keys if upgrading
- Add
.mcp.jsonto your.gitignore - Never commit files containing API credentials