The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Confirm support and maintenance ownership
      • Audit accounts and privilege paths
      • Inventory network exposure
      • Audit third-party packages
      • Preserve configuration evidence
      • Protect recovery
      • Review the baseline
      • Primary references

      Establish a FreeBSD security baseline

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      A security baseline is the smallest documented state that can be reviewed repeatedly. It is not a universal list of tunables. Begin with supported software, known accounts, intended listening services, explicit firewall policy, protected credentials, recoverable data, and logs that can show change.

      Add securelevels, file flags, MAC policies, or custom kernel settings only for a stated threat and an understood recovery path. Controls that prevent routine recovery can reduce availability without addressing the likely attack.

      Use Choose a MAC policy before introducing a mandatory access-control module, and Audit security-relevant activity before treating an audit trail as complete attribution. Both controls require deliberate event or policy scope, storage, review, and recovery.

      Confirm support and maintenance ownership #

      Record the installed release and package repositories:

      $ freebsd-version -kru
      $ pkg repositories
      

      Compare the release with Supported FreeBSD releases , which is maintained from the official support table . Define who reviews security advisories, who applies base-system and package updates, and how a failed update is recovered.

      The update decision guide separates base, package, and release operations. A ZFS-root host should also have a documented boot-environment recovery path before risky changes.

      Audit accounts and privilege paths #

      Review local accounts, groups, shells, and privilege-bearing memberships:

      $ pw usershow -a
      $ pw groupshow -a
      $ awk -F: '{print $1, $3, $7}' /etc/passwd
      

      Disable or remove accounts through their owning system or package procedure. Do not edit password hashes by hand. Record:

      • who can log in interactively;
      • who can become root and through which mechanism;
      • which SSH keys and multi-factor controls protect remote administration;
      • which service accounts own writable data;
      • where recovery credentials are stored.

      Inventory network exposure #

      List listening sockets and active firewall policy:

      $ sockstat -4 -6 -l
      # pfctl -sr
      # pfctl -sn
      

      Use the firewall command that matches the configured firewall; PF output is not evidence for an IPFW host. Every listening socket should have an owner, intended client network, authentication boundary, update path, and log location.

      Bind administrative services to a management interface or private network where practical. A firewall complements service configuration; it does not make an unnecessary daemon necessary.

      Audit third-party packages #

      Refresh the vulnerability database and inspect installed packages:

      # pkg audit -F
      

      Treat the result as input to a change decision. An affected package may need an upgrade, removal, service disablement, or documented mitigation. A clean package audit does not cover the FreeBSD base system; FreeBSD security advisories and errata remain separate sources.

      Preserve configuration evidence #

      Track intentional changes to /etc, /usr/local/etc, firewall rules, loader settings, jail definitions, and deployment scripts in protected version control or configuration management. Keep secrets out of the same repository unless it is explicitly designed and encrypted for them.

      FreeBSD supplies tools for comparing system files and supports file flags, ACLs, process accounting, and other controls. Introduce each only with an owner and review procedure. A control that nobody checks is not monitoring.

      Protect recovery #

      Security includes availability and integrity:

      • maintain independent backups;
      • test restoration under a non-production path;
      • retain console access before remote firewall or SSH changes;
      • protect encryption keys separately from encrypted data;
      • monitor pool, filesystem, and backup health;
      • record the order needed to restore identity, DNS, time, and applications.

      Ransomware-resistant or administrator-error-resistant retention requires a destination that compromised host credentials cannot freely rewrite.

      Review the baseline #

      Review after each release upgrade and whenever network exposure, administrators, or critical workloads change. Record exceptions with an expiry or review date rather than allowing temporary access to become invisible policy.

      Primary references #

      • FreeBSD Handbook: Security
      • FreeBSD security advisories and errata
      • pkg-audit(8)
      • sockstat(1)
      • pw(8)
      • security(7)

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Confirm support and maintenance ownership
      • Audit accounts and privilege paths
      • Inventory network exposure
      • Audit third-party packages
      • Preserve configuration evidence
      • Protect recovery
      • Review the baseline
      • Primary references