Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

OPNsense Firewall Automation (Official Overview)

Posted on 2025-11-112025-11-11 by Rico

🧭 Overview

Firewall Automation is the new-generation framework in OPNsense
for managing firewall and source NAT rules through both the web UI and REST API.

It is designed to eventually replace the classic Firewall → Rules pages,
offering modern, API-driven rule management.

“The automation component offers API access to firewall and source NAT rules.
It only manages rules created within its own interface, not traditional firewall rules.”


⚙️ Architecture & Core Principles

ConceptDescription
Automation ComponentMVC-based backend for managing API-accessible rules.
API + UI ConsistencyEvery rule created via UI is immediately accessible via API.
Scope LimitationOnly rules created inside Automation are visible to this API.
Future IntegrationIntended as the next-generation rule management interface.

🧩 Key Capabilities

1️⃣ Centralized Rule Management
Define and manage Firewall + Source NAT rules directly from one place.

2️⃣ Full REST API Control
Automation rules can be created, updated, or deleted via API calls.

3️⃣ Modern MVC Framework
Better integration with other OPNsense modules and external systems.

4️⃣ Preview Feature
Currently marked as a preview, showcasing future rule management direction.


⚡ Use Cases

Use CaseExampleNote
Automated DeploymentUse API to auto-create rules during provisioningIdeal for DevOps setups
Centralized NAT ConfigurationProgrammatically manage Source NAT across subnetsSimplifies large-scale routing
External System IntegrationIntegrate SOC or monitoring tools to push rulesCommon in enterprise environments
Testing Next-gen Rule EngineExperiment with Automation API before migrationPreview of future firewall UI

🧰 API Examples

Create a rule:

curl -X POST -u "apiuser:apitoken" \
https://<firewall-ip>/api/firewall/automation/add \
-H "Content-Type: application/json" \
-d '{
  "interface": "lan",
  "protocol": "tcp",
  "source": "any",
  "destination": "192.168.1.10",
  "dstport": "22",
  "action": "pass",
  "description": "Allow SSH via Automation API"
}'

List all rules:

curl -u "apiuser:apitoken" \
https://<firewall-ip>/api/firewall/automation/search

🔒 Limitations

ItemDescription
ScopeOnly manages rules created inside the Automation module
Event TriggersDoes not support dynamic or event-driven rule activation
StatusPreview / experimental feature
Recommended UseFor testing API integration and automated provisioning

✅ Summary

Firewall Automation is not an event-driven engine —
it is the new API-based rule management layer for OPNsense.

Key Advantages:

  • Native REST API support
  • Unified management for firewall + NAT rules
  • Foundation for the next-generation rule editor

💡 Think of it as a “Firewall-as-Code” foundation —
structured, API-accessible, and automation-friendly.

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme