CIS pfSense Benchmark

Security configuration recommendations for pfSense firewall/router

v1.0.0 01-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for pfSense firewall and router deployments. It covers system updates, authentication, WebGUI hardening, firewall rules, VPN configuration, DNS security, and OS-level hardening using pfctl, sysctl, config.xml, PHP shell, and WebGUI administration.

18Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1System & Package ManagementVersion updates and removal of unnecessary packages
2AuthenticationAdmin credentials, external LDAP/RADIUS authentication
3WebGUI HardeningHTTPS-only, HSTS, security headers, and brute-force protection
4Firewall RulesDefault deny, bogon blocking, anti-spoofing, and rule logging
5VPN SecurityOpenVPN tls-crypt/AES-256-GCM and IPsec IKEv2 hardening
6DNS SecurityDNS over TLS and DNSSEC via Unbound resolver
7System HardeningSSH hardening, security sysctls, and NTP configuration

Profile Definitions

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

1 — System & Package Management

▶

1.1 Updates & Packages

▶
1.1.1 Ensure pfSense is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that pfSense is running the latest stable version on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check pfSense version (SSH or console):
uname -a
cat /etc/version

# Via PHP shell:
php -r "require_once('globals.inc'); echo g_get('product_version');"
Remediation
# Update pfSense:
pfSsh.php playback upgrade

# Or via WebGUI:
# System > Update > Check for updates
# Install available update
1.1.2 Ensure only necessary packages are installed (Automated)
L1 Auto
Description

This recommendation verifies that only necessary packages are installed on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check installed packages:
pkg info | grep pfSense-pkg

# Via PHP:
php -r "require_once('pkg-utils.inc'); print_r(get_pkg_info('installed_only'));"
Remediation
# Remove unnecessary packages:
pkg delete pfSense-pkg-<name>

# Or via WebGUI:
# System > Package Manager > Installed Packages
# Remove packages not in use

2 — Authentication

▶

2.1 User Management

▶
2.1.1 Ensure default admin credentials are changed (Automated)
L1 Auto
Description

This recommendation verifies that default admin credentials are changed on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check admin account configuration:
grep -c '<admin>' /conf/config.xml

# List all users:
php -r "
require_once('auth.inc');
\$config = parse_config(true);
foreach(\$config['system']['user'] as \$u) {
  echo \$u['name'] . ' - ' . \$u['scope'] . PHP_EOL;
}
"
Remediation
# Change default admin password via CLI:
php -r "
require_once('auth.inc');
local_user_set_password(\$config['system']['user'][0], 'N3wS3cur3P@ss!');
write_config('Password updated');
"

# Create non-default admin account via WebGUI:
# System > User Manager > Add user with admin privileges
# Then disable or rename default 'admin'
2.1.2 Ensure external authentication is configured (Automated)
L1 Auto
Description

This recommendation verifies that external authentication is configured on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check authentication servers:
grep -A5 '<authserver>' /conf/config.xml | head -20

# Check LDAP/RADIUS config:
php -r "
require_once('auth.inc');
foreach(\$config['system']['authserver'] ?? [] as \$s) {
  echo \$s['name'] . ': ' . \$s['type'] . PHP_EOL;
}
"
Remediation
# Configure LDAP authentication via WebGUI:
# System > User Manager > Authentication Servers > Add
# Type: LDAP
# Hostname: ldap.company.com
# Transport: SSL/TLS
# Search scope: Entire Subtree
# Base DN: DC=company,DC=com

# Set as primary auth:
# System > User Manager > Settings
# Authentication Server: LDAP-Server

3 — WebGUI Hardening

▶

3.1 Web Interface Security

▶
3.1.1 Ensure HTTPS-only access with custom certificate (Automated)
L1 Auto
Description

This recommendation verifies that HTTPS-only access with custom certificate on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check WebGUI protocol:
grep '<webgui>' /conf/config.xml -A10 | grep protocol

# Check TLS cert:
openssl s_client -connect 127.0.0.1:443 -brief 2>/dev/null | head -5

# Check listening ports:
sockstat -4 -l | grep -E 'nginx|php'
Remediation
# Configure HTTPS-only WebGUI:
# System > Advanced > Admin Access
# Protocol: HTTPS
# SSL/TLS Certificate: Use ACME or custom CA cert
# TCP port: 8443 (non-default)
# WebGUI redirect: Disable HTTP redirect

# Via config.xml:
# <protocol>https</protocol>
# <port>8443</port>
3.1.2 Ensure HSTS and security headers are enabled (Automated)
L1 Auto
Description

This recommendation verifies that HSTS and security headers are enabled on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check HSTS and security headers:
fetch -qo - https://127.0.0.1/diag_command.php 2>/dev/null | head -20

# Check NGINX config for headers:
grep -E 'Strict-Transport|X-Frame|X-Content' /var/etc/nginx-webConfigurator*.conf 2>/dev/null
Remediation
# Enable HSTS in Advanced Admin:
# System > Advanced > Admin Access
# HTTP Strict Transport Security: Enable

# Add custom security headers via System Tunables or
# System > Advanced > Admin Access > Browser security headers
3.1.3 Ensure login brute-force protection is configured (Automated)
L1 Auto
Description

This recommendation verifies that login brute-force protection is configured on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check login protection / anti-brute-force:
grep '<webgui>' /conf/config.xml -A20 | grep -E 'lockout|loginban'

# Check sshlockout:
ps aux | grep sshlockout
Remediation
# Configure login protection:
# System > Advanced > Admin Access > Login Protection
# Threshold: 5 failed attempts
# Blockout Time: 1800 seconds
# Detection Time: 300 seconds
# Whitelist: management subnet only

# Ensure sshlockout is running:
/usr/local/sbin/sshlockout_pf &

4 — Firewall Rules

▶

4.1 Rule Configuration

▶
4.1.1 Ensure WAN default deny and bogon blocking are enabled (Automated)
L1 Auto
Description

This recommendation verifies that WAN default deny and bogon blocking are enabled on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check firewall rules:
pfctl -sr

# Check rules per interface:
pfctl -sr | head -40

# Check rule count:
pfctl -si | grep -E 'current entries|searches'
Remediation
# Ensure WAN default deny:
# Firewall > Rules > WAN
# Default: Block all inbound
# Add specific allow rules as needed

# Ensure bogon/RFC1918 blocking on WAN:
# Interfaces > WAN
# Block private networks: checked
# Block bogon networks: checked
4.1.2 Ensure anti-spoofing is enabled on internal interfaces (Automated)
L1 Auto
Description

This recommendation verifies that anti-spoofing is enabled on internal interfaces on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check anti-spoofing (uRPF):
pfctl -sr | grep 'antispoof'

# Check interface anti-spoof settings:
grep 'antispoof' /tmp/rules.debug
Remediation
# Enable anti-spoofing:
# System > Advanced > Firewall & NAT
# Antispoof: Enable on all internal interfaces

# Via config:
# Ensure antispoof rules are generated for internal interfaces
4.1.3 Ensure firewall logging is configured (Automated)
L1 Auto
Description

This recommendation verifies that firewall logging is configured on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check logging settings:
grep 'logdefaultblock\|logdefaultpass' /conf/config.xml

# Check pflog interface:
ifconfig pflog0
tcpdump -i pflog0 -c 5 2>/dev/null
Remediation
# Enable logging on default block rules:
# Status > System Logs > Settings
# Log packets matched from the default block rule: checked
# Log packets matched from the default pass rule: unchecked

# Configure remote syslog:
# Status > System Logs > Settings > Remote Logging Options
# Remote log servers: 10.1.1.200
# Remote Syslog Contents: Firewall Events

5 — VPN Security

▶

5.1 VPN Hardening

▶
5.1.1 Ensure OpenVPN uses strong encryption and tls-crypt (Automated)
L1 Auto
Description

This recommendation verifies that OpenVPN uses strong encryption and tls-crypt on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check OpenVPN server configuration:
grep -A30 '<openvpn-server>' /conf/config.xml | head -40

# Check running VPN tunnels:
ps aux | grep openvpn
sockstat -4 -l | grep openvpn
Remediation
# Harden OpenVPN configuration via WebGUI:
# VPN > OpenVPN > Servers > Edit
# TLS Configuration: Use a TLS Key (tls-crypt)
# Peer Certificate Authority: Custom CA
# DH Parameter Length: 4096
# Encryption Algorithm: AES-256-GCM
# Auth Digest Algorithm: SHA512
# Certificate Depth: One (Client+Server)
5.1.2 Ensure IPsec uses IKEv2 with strong algorithms (Automated)
L1 Auto
Description

This recommendation verifies that IPsec uses IKEv2 with strong algorithms on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check IPsec configuration:
ipsec statusall

# Check phase 1 proposals:
grep -A20 '<phase1>' /conf/config.xml | grep -E 'encryption|hash|dhgroup'
Remediation
# Harden IPsec Phase 1:
# VPN > IPsec > Tunnels > Edit Phase 1
# Key Exchange: IKEv2
# Encryption Algorithm: AES-256-GCM
# Hash Algorithm: SHA256
# DH Group: 14 (2048 bit) minimum, prefer 20/21
# Lifetime: 28800

# Phase 2:
# Encryption: AES-256-GCM
# Hash: SHA256
# PFS key group: 14 minimum

6 — DNS Security

▶

6.1 DNS Configuration

▶
6.1.1 Ensure DNS over TLS and DNSSEC are enabled (Automated)
L1 Auto
Description

This recommendation verifies that DNS over TLS and DNSSEC are enabled on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check DNS resolver settings:
grep -A10 '<unbound>' /conf/config.xml | head -15

# Check if DNS over TLS is configured:
grep 'forward-tls-upstream' /var/unbound/unbound.conf

# Check DNSSEC:
grep 'module-config\|val-permissive' /var/unbound/unbound.conf
Remediation
# Configure DNS over TLS:
# Services > DNS Resolver > General
# Enable DNSSEC: checked
# DNS Query Forwarding: Enable
# Use SSL/TLS for DNS Queries: checked

# Add upstream DNS over TLS servers:
# Services > DNS Resolver > General > DNS over TLS
# 1.1.1.1@853#cloudflare-dns.com
# 8.8.8.8@853#dns.google

7 — System Hardening

▶

7.1 OS-Level Security

▶
7.1.1 Ensure SSH is hardened or disabled (Automated)
L1 Auto
Description

This recommendation verifies that SSH is hardened or disabled on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check SSH access:
sockstat -4 -l | grep sshd
grep '<enablesshd>' /conf/config.xml

# Check SSH configuration:
grep -E 'PermitRootLogin|PasswordAuth' /etc/ssh/sshd_config
Remediation
# Harden SSH:
# System > Advanced > Admin Access > Secure Shell
# Enable: Only if necessary
# SSHd Key Only: Public Key Only
# Allow Agent Forwarding: unchecked
# SSH Port: 2222 (non-default)

# Restrict SSH to management IP:
# Firewall > Rules > add rule allowing SSH from mgmt subnet only
7.1.2 Ensure security-related sysctl tunables are set (Automated)
L1 Auto
Description

This recommendation verifies that security-related sysctl tunables are set on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check system tunables:
sysctl net.inet.tcp.blackhole
sysctl net.inet.udp.blackhole
sysctl net.inet.icmp.drop_redirect
sysctl net.inet6.icmp6.rediraccept
Remediation
# Set security-related sysctls:
# System > Advanced > System Tunables
# net.inet.tcp.blackhole = 2
# net.inet.udp.blackhole = 1
# net.inet.icmp.drop_redirect = 1
# net.inet6.icmp6.rediraccept = 0
# net.inet.tcp.path_mtu_discovery = 0
# security.bsd.see_other_uids = 0
7.1.3 Ensure NTP is configured (Automated)
L1 Auto
Description

This recommendation verifies that NTP is configured on the pfSense firewall/router. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
# Check NTP configuration:
grep '<timeservers>' /conf/config.xml
ntpq -p 2>/dev/null

# Check NTP daemon:
ps aux | grep ntpd
Remediation
# Configure NTP:
# Services > NTP > Settings
# NTP Servers: 0.pool.ntp.org, 1.pool.ntp.org
# Interface: LAN / Management only
# Orphan Mode: 12
# Enable NTP Server for LAN clients