OPNsense Guard

v0.1.1
io.github.d3ltasecurity/opnsense-guard-mcp Checked 21 hours ago Published 1 month ago

Safety-first OPNsense firewall MCP: read-only by default, planned and auto-reverting writes.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

system_status

OPNsense firmware version and pending updates (needs the System: Firmware privilege).

system_information

Hostname, uptime, load, and general system information.

system_resources

Memory, swap, and disk utilisation of the firewall itself.

service_list

All services OPNsense knows about and whether each is running.

posture_check

Health snapshot: system, services, IDS state. Flags security-relevant services that are installed but not running.

suricata_status

Whether the Suricata IDS/IPS service is running, stopped, or disabled.

suricata_settings

Suricata configuration: enabled, IPS mode, interfaces, active rulesets.

suricata_alert_status

Whether Suricata is producing alerts, from its eve.json file metadata. OPNsense only serves alert *rows* over POST (queryAlerts), which a read-only server must not call. This reports liveness instead: the log file's size and last-modified time. Query alerts in your SIEM.

firewall_rules

The firewall filter ruleset, one line per rule. Use firewall_rule_get for every field of one rule. Args: search: optional text filter (interface, description, address). limit: maximum rules to return (1-1000). detail: return the full OPNsense rows instead of one-line summaries.

ParameterTypeDescription
detailboolean
limitinteger
searchstring

firewall_rule_get

One filter rule by UUID, with all fields. Args: uuid: rule UUID as shown by firewall_rules.

ParameterTypeDescription
uuid *string

firewall_aliases

Firewall aliases and their contents. Args: search: optional text filter on alias name or description. limit: maximum aliases to return (1-1000).

ParameterTypeDescription
limitinteger
searchstring

firewall_log

Recent firewall log entries (pass/block decisions). Args: limit: number of log lines to return (1-1000). search: optional filter phrase (IP, port, interface, action).

ParameterTypeDescription
limitinteger
searchstring

firewall_states

Active connection state table. Args: limit: number of states to return (1-1000). search: optional filter on address or port.

ParameterTypeDescription
limitinteger
searchstring

system_log

Recent entries from the OPNsense system log. Args: limit: number of lines to return (1-1000).

ParameterTypeDescription
limitinteger

interfaces

All network interfaces with status, addresses, and link state.

arp_table

ARP table: IP to MAC mappings currently known to the firewall.

routing_table

The firewall's active routing table.

dhcp_leases

Current DHCP leases across all backends (Kea, ISC dhcpd, dnsmasq). Queries all three and reports which backend actually holds leases.

raw_get

GET any allowlisted OPNsense API path. The same read-only rules apply (prefix allowlist, verb denylist, no traversal), so this cannot change firewall state. Args: path: API path beginning with /api/, e.g. /api/core/firmware/info

ParameterTypeDescription
path *string

policy_show

What this server is allowed to change: mode, interfaces, networks, limits. Read this before planning a change so you know the limits.

security_audit

Quick security review of the ruleset and IDS. Flags any->any pass rules, inbound pass on WAN, pass rules without logging, and an IDS that is not running.