CIS OPNsense Firewall Benchmark

Security configuration recommendations for OPNsense open-source firewall

v1.0.0 01-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for OPNsense firewall deployments. It covers administrative access hardening, authentication and two-factor enforcement, firewall rule design, anti-spoofing, intrusion detection and prevention, centralized logging, DNS security, firmware management, and high-availability configurations.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Access ManagementAdmin credential hardening and two-factor authentication
2Administrative InterfacesHTTPS enforcement and key-based SSH access
3Firewall RulesDeny-all policy and anti-spoofing configuration
4Intrusion Detection & LoggingSuricata IPS and centralized TLS syslog
5Network ServicesSecure NTP and DNS over TLS with DNSSEC
6System MaintenanceFirmware updates and service minimization
7Backup & High AvailabilityEncrypted backups and CARP failover

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all OPNsense deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Access Management

▶

1.1 Authentication

▶
1.1.1 Ensure default admin credentials are changed and separate accounts created (Manual)
L1 Manual
Description

This recommendation verifies that default admin credentials are changed and separate accounts created on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check admin account settings:
curl -s -k -u 'root:opnsense' https://localhost/api/auth/user | python3 -m json.tool

# Verify default password changed:
# Attempt login with default credentials (should fail)
curl -s -o /dev/null -w '%{http_code}' -k -u 'root:opnsense' https://localhost/api/core/firmware/status
Remediation
# Change default admin password via console menu option 3
# Or via API:
curl -k -u 'root:CURRENT_PASS' -X POST \
  https://localhost/api/auth/user/setPassword/0 \
  -d '{"password":"<STRONG_NEW_PASSWORD>"}'

# Create separate admin account:
curl -k -u 'root:CURRENT_PASS' -X POST \
  https://localhost/api/auth/user \
  -d '{"user":{"name":"secadmin","password":"<PASS>","groups":["admins"]}}'
1.1.2 Ensure external authentication with two-factor is configured (Manual)
L2 Manual
Description

This recommendation verifies that external authentication with two-factor is configured on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check authentication servers:
curl -s -k -u admin:$PASS https://localhost/api/auth/server | python3 -m json.tool

# Check TOTP status:
curl -s -k -u admin:$PASS https://localhost/api/auth/settings | grep totp
Remediation
# Configure LDAP/RADIUS authentication:
# System > Access > Servers > Add
# Type: LDAP, Hostname: ldap.example.com
# Transport: SSL/TLS, Port: 636
# Search Scope: Entire Subtree

# Enable TOTP two-factor authentication:
# System > Access > Tester > Enable TOTP
# System > Settings > Administration > Authentication > Enable 2FA

2 — Administrative Interfaces

▶

2.1 Web & SSH

▶
2.1.1 Ensure web GUI is HTTPS-only and restricted to management interfaces (Automated)
L1 Auto
Description

This setting ensures that web GUI is HTTPS-only and restricted to management interfaces on the OPNsense firewall appliance. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the OPNsense firewall appliance is essential for defense in depth.

Audit
# Check HTTPS admin access:
curl -s -k -o /dev/null -w '%{http_code}' https://localhost/

# Verify HTTP redirect:
curl -s -o /dev/null -w '%{http_code}' http://localhost/

# Check web GUI settings:
curl -s -k -u admin:$PASS https://localhost/api/core/system/general | grep -i protocol
Remediation
# System > Settings > Administration:
# Protocol: HTTPS
# SSL Certificate: Select valid certificate
# HTTP Redirect: Disable (force HTTPS only)
# Listen Interfaces: LAN only

# Via config.xml:
# <webgui>
#   <protocol>https</protocol>
#   <ssl-certref>CERT_REF</ssl-certref>
#   <noantilockout>0</noantilockout>
# </webgui>
2.1.2 Ensure SSH uses key-based authentication with root login disabled (Automated)
L1 Auto
Description

This recommendation verifies that SSH uses key-based authentication with root login disabled on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check SSH configuration:
curl -s -k -u admin:$PASS https://localhost/api/core/system/ssh | python3 -m json.tool

# Verify SSH is key-only:
grep -E 'PasswordAuthentication|PermitRootLogin' /usr/local/etc/ssh/sshd_config
Remediation
# System > Settings > Administration > Secure Shell:
# Enable Secure Shell: Yes (only if needed)
# Permit root user login: No
# Permit password login: No (key-only)
# SSH Port: Change from 22
# Listen Interfaces: LAN only

# Add authorized keys:
# System > Access > Users > Edit > Authorized keys

3 — Firewall Rules

▶

3.1 Rule Design

▶
3.1.1 Ensure firewall rules follow least-privilege deny-all default policy (Manual)
L1 Manual
Description

This recommendation verifies that firewall rules follow least-privilege deny-all default policy on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# List firewall rules:
curl -s -k -u admin:$PASS https://localhost/api/firewall/filter/searchRule | python3 -m json.tool | head -50

# Check for overly permissive rules:
curl -s -k -u admin:$PASS https://localhost/api/firewall/filter/searchRule | grep -i 'any.*any.*pass'
Remediation
# Firewall > Rules > WAN:
# Default: Block all inbound
# Add specific allow rules for required services only

# Firewall > Rules > LAN:
# Remove default 'allow all' rule
# Add explicit allow rules:
# - DNS to firewall only
# - HTTPS outbound
# - Required internal services
# Add final deny-all rule with logging
3.1.2 Ensure anti-spoofing and bogon network blocking are enabled on WAN (Automated)
L1 Auto
Description

This recommendation verifies that anti-spoofing and bogon network blocking are enabled on WAN on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check anti-spoofing:
curl -s -k -u admin:$PASS https://localhost/api/firewall/filter/searchRule | grep -i bogon

# Verify bogon/RFC1918 blocking on WAN:
curl -s -k -u admin:$PASS https://localhost/api/interfaces/wan | grep -i 'block.*bogon'
Remediation
# Interfaces > WAN:
# Block private networks: Checked
# Block bogon networks: Checked

# Firewall > Settings > Advanced:
# Enable anti-spoofing (pf antispoof)

# Update bogon networks regularly:
# Firewall > Aliases > Update bogons frequency: Weekly

4 — Intrusion Detection & Logging

▶

4.1 IDS/IPS & Syslog

▶
4.1.1 Ensure Suricata IDS/IPS is enabled in inline mode with updated rulesets (Automated)
L1 Auto
Description

This recommendation verifies that Suricata IDS/IPS is enabled in inline mode with updated rulesets on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check IDS/IPS status:
curl -s -k -u admin:$PASS https://localhost/api/ids/settings/get | python3 -m json.tool | head -30

# Verify Suricata is running:
service suricata status
Remediation
# Services > Intrusion Detection > Administration:
# Enabled: Yes
# IPS Mode: Yes (Inline)
# Pattern Matcher: Hyperscan
# Interfaces: WAN, LAN

# Download Rulesets:
# ET Open, Abuse.ch, Feodo Tracker
# Enable auto-update: Daily

# Set alert/block policies per ruleset
4.1.2 Ensure centralized remote syslog with TLS is configured (Automated)
L1 Auto
Description

This recommendation verifies that centralized remote syslog with TLS is configured on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check logging configuration:
curl -s -k -u admin:$PASS https://localhost/api/syslog/settings | python3 -m json.tool

# Verify remote syslog:
grep -r 'syslog' /usr/local/etc/syslog.d/
Remediation
# System > Settings > Logging > Targets:
# Add remote syslog target
# Transport: TLS
# Hostname: siem.example.com
# Port: 6514
# Facility: All
# Log Level: Informational

# System > Settings > Logging > Local:
# Preserve logs: 90 days
# Enable firewall log: Yes
# Log default blocks: Yes

5 — Network Services

▶

5.1 NTP & DNS

▶
5.1.1 Ensure NTP synchronization is configured and restricted to LAN (Automated)
L1 Auto
Description

This setting ensures that NTP synchronization is configured and restricted to LAN on the OPNsense firewall appliance. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the OPNsense firewall appliance is essential for defense in depth.

Audit
# Check NTP configuration:
curl -s -k -u admin:$PASS https://localhost/api/ntpd/settings | python3 -m json.tool

# Verify NTP sync:
ntpq -p 2>/dev/null || chronyc sources
Remediation
# Services > Network Time > General:
# Enable: Yes
# Prefer IPv4: Yes
# NTP Servers: 0.pool.ntp.org, 1.pool.ntp.org
# Interface: LAN
# Orphan Mode: 12

# Serve time to LAN clients only
5.1.2 Ensure Unbound DNS uses DNSSEC and DNS over TLS (Automated)
L1 Auto
Description

This recommendation verifies that Unbound DNS uses DNSSEC and DNS over TLS on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check DNS settings:
curl -s -k -u admin:$PASS https://localhost/api/unbound/settings | python3 -m json.tool | head -20

# Verify DNS over TLS:
grep -i 'forward' /usr/local/etc/unbound.opnsense.d/*.conf
Remediation
# Services > Unbound DNS > General:
# Enable: Yes
# DNSSEC: Enabled
# DNS over TLS: Enable forwarding with DoT

# Services > Unbound DNS > DNS over TLS:
# Add servers:
# 1.1.1.1:853 (Cloudflare)
# 9.9.9.9:853 (Quad9)
# Verify Domain: cloudflare-dns.com

6 — System Maintenance

▶

6.1 Firmware & Services

▶
6.1.1 Ensure firmware is current with automatic security update checks (Automated)
L1 Auto
Description

This recommendation verifies that firmware is current with automatic security update checks on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check firmware version:
curl -s -k -u admin:$PASS https://localhost/api/core/firmware/status | python3 -m json.tool | grep -E 'product|version'

# Check for updates:
curl -s -k -u admin:$PASS https://localhost/api/core/firmware/check
Remediation
# System > Firmware > Status:
# Check for updates regularly
# Enable automatic security updates

# System > Firmware > Settings:
# Update Mirror: closest mirror
# Firmware Flavor: OpenSSL
# Check schedule: Daily

# Apply updates:
curl -k -u admin:$PASS -X POST https://localhost/api/core/firmware/update
6.1.2 Ensure unnecessary plugins and services are removed or disabled (Manual)
L1 Manual
Description

This recommendation verifies that unnecessary plugins and services are removed or disabled on the OPNsense firewall appliance. Disabling or removing unnecessary components reduces the attack surface and limits potential vectors for exploitation.

Rationale

Running unnecessary components on the OPNsense firewall appliance increases the attack surface and the risk of exploitation. Disabling or removing them follows the principle of least functionality and reduces exposure to known vulnerabilities.

Audit
# Check installed plugins:
curl -s -k -u admin:$PASS https://localhost/api/core/firmware/info | python3 -m json.tool | grep -A2 'plugin'

# List enabled services:
service -e
Remediation
# Remove unnecessary plugins:
# System > Firmware > Plugins
# Review and remove unused plugins

# Disable unnecessary services:
# Services menu > review each service
# Disable UPnP, mDNS if not required
# Disable SNMP or restrict community string

7 — Backup & High Availability

▶

7.1 Recovery & Redundancy

▶
7.1.1 Ensure encrypted configuration backups are automated (Automated)
L1 Auto
Description

This recommendation verifies that encrypted configuration backups are automated on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check backup configuration:
curl -s -k -u admin:$PASS https://localhost/api/core/backup/providers | python3 -m json.tool

# List local backups:
ls -la /conf/backup/
Remediation
# System > Configuration > Backups:
# Enable Google Drive / Nextcloud backup
# Backup count: 100
# Encryption password: Set strong password

# Create backup via API:
curl -k -u admin:$PASS -X POST \
  https://localhost/api/core/backup/download/this \
  -o opnsense-backup-$(date +%Y%m%d).xml
7.1.2 Ensure CARP high-availability is configured for failover (Automated)
L2 Auto
Description

This recommendation verifies that CARP high-availability is configured for failover on the OPNsense firewall appliance. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the OPNsense firewall appliance vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check HA/CARP status:
curl -s -k -u admin:$PASS https://localhost/api/interfaces/vip_settings | python3 -m json.tool

# Verify CARP state:
ifconfig | grep carp
Remediation
# System > High Availability > Settings:
# Synchronize States: Enabled
# Synchronize Interface: Dedicated sync interface
# Remote System: Backup firewall IP

# Interfaces > Virtual IPs:
# Add CARP VIPs for LAN and WAN
# VHID: Unique per VIP
# Advertising Frequency: Base 1, Skew 0 (master)