Skip to content

v0.7.5 - Firewall Rule Persistence Fix

Choose a tag to compare

@vespo92 vespo92 released this 20 Aug 04:13

πŸ› 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/apply without proper persistence

Solution Implemented:

  1. Enhanced applyChanges() method:

    • Now calls both /firewall/filter/apply and /firewall/filter/reconfigure
    • Implements proper save/reconfigure flow required by OPNsense
    • Added fallback mechanisms for compatibility
  2. Improved rule retrieval:

    • Added getAllRules() method using /firewall/filter/get endpoint
    • Multiple retrieval methods to handle API inconsistencies
    • Better response format handling
  3. Rule caching system:

    • Implemented cache to handle API propagation delays
    • Rules are immediately visible after creation
    • Cache updates on every list operation
  4. 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_rules immediately
  • 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:

  1. Rotate your OPNsense API keys if upgrading
  2. Add .mcp.json to your .gitignore
  3. Never commit files containing API credentials