Skip to content
Export guide · Firewalls and network

How to export your OPNsense configuration, and what we check in it

Where you run it: OPNsense web interface, or the OPNsense API with curl in a bash terminal (macOS, Linux or WSL; in Windows PowerShell 5.1, curl is a different command).

In short

OPNsense configuration export: the file OPNsense writes of its own settings, which a configuration review reads setting by setting without connecting to OPNsense.

How to export the OPNsense configuration, step by step, what the review checks in the file (27 checks run), and what it does not read.

The fileXML, one config-<host>-<date>.xml (config.xml from the API): the whole configuration inside one <opnsense> element
Checks run on it27
Highest grade its findings reachOBSERVED
Feeds attack pathsNo
Not read from this export3 areas, listed below

Sources: OPNsense documentation (1); OPNsense documentation (2); OPNsense documentation (3); the vendor table.

How to export it

Who can pull it
A user who holds the "Diagnostics: Configuration History" privilege
Time
About 5 minutes; about 10 with the API, to create the key and delete it afterwards.
The file
XML, one config-<host>-<date>.xml (config.xml from the API): the whole configuration inside one <opnsense> element

In the OPNsense console

  1. System → Configuration → Backups → Download: leave "Do not backup RRD data." ticked and "Encrypt this configuration file." unticked → Download configuration, and upload the config-<host>-<date>.xml it saves

    The vendor's page, checked 2026-11-11
  2. Or, with a smaller privilege: System → Configuration → History → under "Backups (compare)", leave the newest saved configuration selected in the left list → the download icon ("Download this backup"), and upload the config-<host>-<time>.xml it saves. The list fills once OPNsense holds two or more saved configurations

    The vendor's page, checked 2026-11-11

Or from the command line

  1. For the API way, an admin creates an API key for your user: System → Access → Users → in your user’s row, the ticket icon "Create and download API key for this user" → Yes. It downloads <host>_<user>_apikey.txt with a key= line and a secret= line. OPNsense does not keep the secret, so save this file: it cannot be downloaded again. The admin needs the "System: Access: Management" privilege (OPNsense 26.7) or "System: Access: Users" (25.1 to 26.1). Before OPNsense 25.1: edit the user → API keys → +.

    The vendor's page, checked 2026-11-11
  2. curl -sS -u "<key>:<secret>" "https://<opnsense>/api/core/backup/download/this" -o config.xml(downloads the newest saved configuration: OPNsense keeps a copy under /conf/backup each time the configuration is saved; upload config.xml)

    The vendor's page, checked 2026-11-11
  3. After the upload has gone through, an admin deletes the API key: System → Access → Users → the "ApiKeys" tab → in the row with your user name, the trash icon (Delete) → confirm "Remove selected item(s)?". OPNsense: "The assigned keys can be found in the “ApiKeys” tab, where you can remove keys that are no longer used."

    The vendor's page, checked 2026-11-11

What the file looks like

XML, one config-<host>-<date>.xml (config.xml from the API): the whole configuration inside one <opnsense> element. It varies with the firewall: the file grows with its rules, aliases and certificates, and RRD data, if included, makes it much larger. The upload takes files up to 10 MB.

What it holds: Firewall rules, NAT, aliases, interfaces, VPNs, users and the system settings, in one config.xml.

The file holds private keys and virtual private network (VPN) keys in usable form, and password hashes: treat it like a set of private keys.

Afterwards

If an API key was created, an admin deletes it: System → Access → Users → the "ApiKeys" tab → the row with your user name → trash icon. Then delete <host>_<user>_apikey.txt and the downloaded configuration file from your computer. After a web interface download there is just the downloaded file to delete.

If the export goes wrong

What you seeThe fix
The file starts with ---- BEGIN config.xml ---- and the upload says it does not match any expected formatThat download is encrypted: download again with "Encrypt this configuration file." unticked, and upload the new file.
The API answers 403 (Forbidden)Your user lacks the "Diagnostics: Configuration History" privilege: an admin adds it to your group (System → Access → Groups). Or use the Backups page download, which needs "System: Configuration: Backups" ("Diagnostics: Backup / Restore" in OPNsense 25.1 and 25.7).
The file is very large and holds an <rrddata> sectionDownload again with "Do not backup RRD data." ticked: the graphs’ history is not read, and it just makes the file bigger.
curl prints curl: (60) SSL certificate problem: self signed certificate (or self-signed certificate), and config.xml is not writtenOPNsense’s web interface uses its own self-signed certificate unless you installed another. Add -k to the curl line, just for your own OPNsense address, or select a certificate your computer trusts under System → Settings → Administration → SSL Certificate, and run it again.

What we read from it

Checks run
27 + 3 guidance items, not counted
Formats read
config.xml backup
Releases
23.7 to 24.x

Checks run is the number of checks that reached a result on this system's own export in our tests, as the vendor table shows it.

The areas checked

  • Firewall rules (any-to-any passes) and NAT port forwards
  • Web GUI and SSH access: HTTP, password sign-in, root login, console password
  • IDS (Suricata), DNSSEC, remote syslog and SNMP
  • VPN settings: OpenVPN ciphers and tls-auth, IPsec Diffie-Hellman groups and aggressive mode, WireGuard peers
  • Admin group size, LDAP over TLS and the firmware version

The grade its findings reach

Observed Findings from this file are OBSERVED: read from the system's own export and cited to the setting.

Its findings stay in the review and its reports. OPNsense does not feed attack paths.

Attack paths, the one change and dollar figures are MODELED. How each grade is worked out is on the method page.

What we do not read from this export

  • Hit counts, so unused rules are not found
  • Alias contents: a rule that uses an alias is not expanded
  • Logs and live states: this is the configuration and nothing else
  • Whether the rules end with a logged deny: not checked yet

Limits of the reader

  • If your export leaves a section out, the review does not flag it as partial.
  • Findings stay in the review. They do not feed attack paths.
  • Some checks of this system are in the code and not counted: no test shows them firing on a file in the layout the vendor documents.

A finding never comes from what the file does not hold: live traffic, running hosts and logs are not in a configuration export.

Questions

Who can export the OPNsense configuration?

A user who holds the "Diagnostics: Configuration History" privilege: it opens the History page and the API path api/core/backup/*, where the download is. The Backups page needs "System: Configuration: Backups" (named "Diagnostics: Backup / Restore" in OPNsense 25.1 and 25.7); that page also holds the restore form, so History is the narrower way. Add "System: Deny config write", so that OPNsense refuses this user’s configuration saves, such as reverting to a saved configuration or removing one. An admin assigns privileges to a group under System → Access → Groups, or to the user. Creating the API (application programming interface) key needs an admin with "System: Access: Management" (OPNsense 26.7) or "System: Access: Users" (25.1 to 26.1).

Does the export change anything?

A web interface download writes nothing to the firewall’s configuration. The API way adds an API key to your user and saves config.xml, so System → Configuration → History shows a new entry; deleting the key afterwards saves config.xml once more.

Does the file hold passwords or keys?

Stored in usable form (clear text or base64): private keys of certificates and certificate authorities, WireGuard private and pre-shared keys, IPsec pre-shared keys, OpenVPN static keys, the passwords and shared secrets of authentication servers, and one-time-password seeds. Stored as hashes: user passwords and API key secrets. OPNsense’s manual calls the configuration data sensitive. With redaction on (the default), the passwords, keys and tokens the review recognises are replaced with a placeholder before anything is stored; the check before upload shows how many it found.