opnborg

package module
v0.1.227 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: BSD-3-Clause Imports: 51 Imported by: 0

README ΒΆ

OPNBORG

βš™οΈ OPNBORG

Resistance is futile. Your OPNsense will be assimilated. πŸ––

One binary. Your whole firewall fleet. Backed up, monitored, audited.

Self-hosted daemon for OPNsense config management β€” with an embedded WebUI, AI-assisted security audit, git-tracked archive, and optional Unifi integration.

Go Reference Go Report Card SemVer License built with nix

πŸš€ Quick Start Β· ✨ Features Β· πŸ“Έ Screenshots Β· πŸ”§ Config Β· ❓ FAQ


TL;DR

OPN_TARGETS='opn01.lan:8443,opn02.lan:8443' \
OPN_APIKEY='...' OPN_APISECRET='...' \
go run paepcke.de/opnborg/cmd/opnborg@main
# β–Έ WebUI live at http://localhost:6464

✨ Features

πŸ–₯️ Hive dashboard β€” live version, status & compliance per firewall, animated SVG, zero JS frameworks πŸ’Ύ Smart backups β€” SHA-256 deduplicated, timestamped archive, symlink rotation, rapid restore πŸ” Fleet sync β€” replicate plugins & syslog config from a master host to every target πŸ€– AI security audit β€” local LLM (Ollama / OpenAI-compatible) writes commit messages with a tag: <severity> line 🧟 BorgAUDIT β€” commit history review: full diffs, threat dashboard, change performer, approval ledger πŸŽ›οΈ Unifi β€” .unf backups, autoBackup folder watch, inventory export (CSV/JSON) πŸ“œ Syslog collector β€” built-in RFC5424 server, rotated retention πŸ” Two-mode WebUI β€” monitoring-only by default; Argon2id-gated admin sessions for sensitive actions πŸ“¦ One static binary β€” CGO_ENABLED=0, no runtime deps Β· Linux Β· BSD Β· Windows Β· amd64/arm64/armv7 ☁️ Git native β€” go-git repo management, aggressive repack, SSH upstream push with host-key pinning


πŸ“Έ Screenshots

OPNBORG Sample Screenshot 01 OPNBORG Sample Screenshot 02


πŸš€ Quick Start

Run the latest release straight from source β€” no build step:

OPN_PATH='/tmp/opn' \
OPN_TARGETS='opn01.lan:8443,opn02.lan:8443' \
OPN_APIKEY='...' \
OPN_APISECRET='...' \
go run paepcke.de/opnborg/cmd/opnborg@main

Prebuilt binaries: Releases Β· go install paepcke.de/opnborg/cmd/opnborg@main Add OPN_NODAEMON=1 for a single pass instead of the daemon.

🐳 Docker / Docker Compose β€” distroless, linux/amd64 + linux/arm64

Published from every v* tag to ghcr.io/paepckehh/opnborg β€” tags: latest, edge, v0, v0.1, exact release.

services:
  opnborg:
    image: ghcr.io/paepckehh/opnborg:latest
    restart: unless-stopped
    ports: ["6464:6464"]
    volumes: [opnborg-data:/var/opnborg]
    environment:
      OPN_TARGETS: "opn01.lan:443,opn02.lan:443"
      OPN_APIKEY: "+RIb6YWNdcDWMMM7W5ZY..."
      OPN_APISECRET: "8VbjM3HKKqQW2ozO..."

volumes:
  opnborg-data:

πŸ” Expose 6464 to trusted networks only β€” and arm OPN_AUTH_HASH / OPN_AUTH_SALT for admin mode.

❄️ NixOS / Nix

Available as a Nix package. Ready-made modules in this repo:

opnborg-docker.nix Β· opnborg-docker-complex.nix Β· opnborg-prometheus-grafana.nix (Prometheus + Grafana; Wazuh/Influx/Graylog WIP)


πŸ”§ Configuration

Everything is environment variables β€” the binary accepts only -v / -h. A local .env file is auto-loaded. Ready-to-use examples: example.sh, example-env-config-simple.sh, example-env-config-complex.sh, example-env-config-unifi.sh, example-env-config-dev.sh.

⚠️ Booleans are presence-based. OPN_DEBUG=0 and OPN_DEBUG=false are both true β€” unset the var to disable. OPN_GIT_ENABLE is opt-in.

🎯 Basics
Variable Default Description
OPN_APIKEY / OPN_APISECRET β€” OPNsense backup user API credentials (required)
OPN_TARGETS β€” Comma-separated targets, optional #<asset-tag> (opn01.lan:8443#RACK-PROD01)
OPN_TARGETS_<GROUP> β€” Named groups: OPN_TARGETS_INTRANET='opn01.lan:8443,...'
OPN_TARGETS_DESC_<GROUP> β€” WebUI group description
OPN_TARGETS_IMGURL_<GROUP> β€” WebUI group image URL (description becomes the tooltip)
OPN_PATH . Backup store path
OPN_TLSKEYPIN β€” SPKI SHA-256 keypin β€” MitM-proofing for the OPNsense API
OPN_SLEEP 3600 Poll interval in seconds (min 10)
OPN_MASTER β€” Master host β€” replicate its config across the hive
OPN_SYNC_PKG β€” Sync installed plugins from master to all targets
OPN_EMAIL git@opnborg Git commit author email
OPN_NODAEMON β€” One-shot mode: single pass, then exit
OPN_DEBUG β€” Verbose debug logging
☁️ Git store

OPN_PATH is managed as a git repo (native go-git, no external git binary): auto-init, .gitignore upkeep, commit per backup pass, aggressive repack (delta window=250) after each commit.

Variable Description
OPN_GIT_ENABLE Auto commit each backup pass β€” opt-in
OPN_GIT_UPSTREAM SSH remote to push to; unset = local-only
OPN_GIT_SSH_KEY PEM private key for upstream auth (required with upstream)
OPN_GIT_SSH_HOSTKEY SHA256:<base64> host-key pin; unset skips verification
πŸ€– AI security audit β€” Ollama first, OpenAI-compatible fallback

The LLM reads an enriched diff and writes the commit message β€” headline, security summary, trailing tag: low|medium|high|critical[, needs-review] β€” surfaced on the BorgAUDIT page. Needs OPN_GIT_ENABLE.

export OLLAMA_DESC_URL='http://localhost:11434'
export OLLAMA_DESC_MODEL='llama3'
# or/and (automatic fallback):
export OPENAPI_DESC_URL='http://192.168.6.222:11434/v1'   # model: gpt-4o-mini (default)
# export OPENAPI_DESC_MODEL='...' OPENAPI_DESC_TOKEN='...'
πŸ” WebUI auth β€” monitoring by default, admin opt-in

Monitoring mode is always open (green badge): dashboards, audit page, progress. Sensitive actions β€” config downloads, audit diffs, forced backup, approvals β€” need an admin session (red/yellow badge): Argon2id (time=8, 64 MiB) credentials, HttpOnly SameSite=Strict cookies, 12 h sliding TTL, exponential global lockout on failed logins.

Generate OPN_AUTH_HASH + OPN_AUTH_SALT from a password on the /auth-hash page β€” nothing is ever logged. Without valid credentials, login is impossible and sensitive paths return 403.

πŸ–₯️ WebUI routes & HTTP options
Route Access What
/ open Hive dashboard
/config open Auth, AI, git & store tiles
/audit open BorgAUDIT β€” commit history, threat dashboard
/progress open Live forced-backup progress
/force open Trigger a backup pass now
/files/ admin Config downloads
/approve, /approve-all admin Approval ledger actions (POST)
/auth/*, /auth-hash open Login/logout/state, credential generator
Variable Default Description
OPN_HTTPD_SERVER 127.0.0.1:6464 Listen address
OPN_HTTPD_DISABLE β€” Turn the WebUI off
OPN_HTTPD_CACERT / OPN_HTTPD_CAKEY β€” Enable HTTPS
OPN_HTTPD_CACLIENT β€” Enforce mTLS
OPN_HTTPD_COLOR_FG / OPN_HTTPD_COLOR_BG white / #333333 Theme colors
OPN_RSYSLOG_ENABLE + OPN_RSYSLOG_SERVER β€” Built-in RFC5424 collector (e.g. 192.168.0.1:5140)
πŸŽ›οΈ Unifi controller β€” backups, watch, inventory
export OPN_UNIFI_WEBUI='https://192.168.1.10:8443#RACK-PROD03'
export OPN_UNIFI_BACKUP_USER='backup'
export OPN_UNIFI_BACKUP_SECRET='start'
export OPN_UNIFI_VERSION='8.5.6'              # required
# optional:
export OPN_UNIFI_WATCH_PATH='/var/lib/unifi/data/backup/autobackup'  # watch-only deploy is valid
export OPN_UNIFI_EXPORT='1'; export OPN_UNIFI_FORMAT='csv'           # or 'json'
export OPN_UNIFI_MONGODB_URI='mongodb://127.0.0.1:27117'
export OPN_UNIFI_BACKUP_DESC='Network controller'   # (+_IMGURL) like target groups
πŸ“ˆ Observability links β€” Prometheus, Grafana, Wazuh

OPN_PROMETHEUS_WEBUI Β· OPN_WAZUH_WEBUI Β· OPN_GRAFANA_WEBUI Β· OPN_GRAFANA_DASHBOARD_FREEBSD Β· OPN_GRAFANA_DASHBOARD_HAPROXY Β· OPN_GRAFANA_DASHBOARD_UNIFI β€” deep links into your existing monitoring stack, rendered on the dashboard.

πŸ—„οΈ Storage layout
<OPN_PATH>/<server>/
  current.xml          # latest backup
  .archive/<Y>/<M>/<ts>-<server>.xml
  CONFIG-CURRENT/LAST # symlink rotation
  sha256.db           # dedup log
.db/
  approval.db          # security-approval ledger (SQLite, always gitignored, never committed)
  approval.db-wal
  approval.db-shm
.git/                  # when OPN_GIT_ENABLE is set

❓ FAQ

Create an OPNsense API key?

System β†’ Access β†’ Users β†’ add a backup user (scrambled password) β†’ grant Diagnostics: Configuration History (+ System: Firmware for plugin sync) β†’ API Keys β†’ Add.

Generate OPN_TLSKEYPIN?
go run paepcke.de/tlsinfo/cmd/tlsinfo@latest <your-opn-server-name>
# X509 Cert KeyPin [base64] : [FezOCC3qZFzBmD5xRKtDoLgK445Kr0DeJBj2TWVvR9M=]
export OPN_TLSKEYPIN='FezOCC3qZFzBmD5xRKtDoLgK445Kr0DeJBj2TWVvR9M='
Enable the AI audit?

Install Ollama, ollama pull llama3, set OLLAMA_DESC_URL + OLLAMA_DESC_MODEL, enable OPN_GIT_ENABLE, restart.

Arm admin mode?

/config β†’ Create Authentication Env Vars β†’ copy both OPN_AUTH_* lines into your env β†’ restart.

Operational notes
  • Targets need an explicit port unless :443; plain HTTP is unsupported.
  • OS trust-store verification is intentionally off β€” use OPN_TLSKEYPIN.
  • The .db/ ledger directory (approval.db + WAL sidecars, plus anything else inside) is always gitignored and hardwire-excluded from commit staging β€” never committed, not even by a manual git add .. A legacy root-level ledger is migrated into .db/ at startup.

🀝 Contributing

PRs welcome β€” see AGENTS.md for the workflow. BSD 3-Clause, see LICENSE.

πŸ’– Sponsors: pvz.digital Β· debitor.de πŸ§‘β€πŸŽ¨ UX Borg design: @Codebase-Torben & @Jones71190

πŸ“„ Citation
@misc{opnborg,
  author = {Michael Paepcke},
  title = {Selfhost-able OPNSense Appliance Configuration Management & Backup Portal},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://paepcke.de/opnborg}}
}

Made with βš™οΈ by Michael Paepcke β€” the hive thanks you for your compliance.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var SemVer = "v0.1.227"

SemVer is the single source of truth for the version string shown in the CLI banner and WebUI footer. It defaults to the manually maintained value below and is overridden at build time via `-ldflags "-X paepcke.de/opnborg.SemVer=<tag>"` by the Docker image build, goreleaser and `make build` so shipped artifacts always report their tag.

Functions ΒΆ

func Start ΒΆ added in v0.0.3

func Start(config *OPNCall) error

Start Application Server

Types ΒΆ

type OPNCall ΒΆ

type OPNCall struct {
	Enable    bool       // enable OPNsense Backup mode
	Targets   string     // list of OPNSense Appliances, csv comma seperated
	TGroups   []OPNGroup // list of OPNSense Appliances Target Groups and Member
	Key       string     // OPNSense Backup User API Key (required)
	Secret    string     // OPNSense Backup User API Secret (required)
	Path      string     // OPNSense Backup Files Target Path, default:'.'
	TLSKeyPin string     // TLS Connection Server Certificate KeyPIN
	AppName   string     // Display and SysLog Application Name
	Email     string     // Git Commiter eMail Address (default: git@opnborg)
	Sleep     int64      // number of seconds to sleep between polls
	Daemon    bool       // daemonize (run in background), default: true
	Debug     bool       // verbose debug logs, defaults to false

	Httpd struct {
		Enable   bool   // enable internal web server
		Server   string // internal httpd server listen ip & port (string, default: 127.0.0.1:6464)
		CAcert   string // httpd server certificate (path to pem encoded x509 file - full certificate chain)
		CAkey    string // httpd server key (path to pem encoded tls server key file)
		CAClient string // httpd client CA (path to pem endcoded x509 file - if set, it will enforce mTLS-only mode)
		Color    struct {
			FG string // color theme background
			BG string // color theme foreground
		}
	}
	Git struct {
		Enable   bool   // manage the backup storage folder as a local git repo with auto commit (default: false)
		Upstream string // upstream SSH git URL to sync with (e.g. git@github.com:user/repo.git); empty disables push
		SSHKey   string // path to the PEM-encoded SSH private key used for upstream auth (required when Upstream is set)
		// SSHHostKey is the optional SHA-256 fingerprint of the upstream SSH
		// host public key (format "SHA256:base64...", matching the output of
		// `ssh-keyscan -t rsa,ed25519 <host>` / ssh's "Server host key"
		// banner). When set, the upstream connection refuses any host whose
		// presented fingerprint does not match. When unset, host key
		// verification is skipped entirely (insecure): opnborg never writes
		// or reads a known_hosts file, so in unattended container/CI
		// deployments where $HOME is undefined this avoids the go-git
		// "cannot create known hosts callback" fatal exit. Pin a fingerprint
		// whenever the upstream is reachable over an untrusted network.
		SSHHostKey string
	}
	Ollama struct {
		Enable bool   // enable Ollama-assisted git commit message generation (requires URL + Model)
		URL    string // Ollama REST API base URL (e.g. http://localhost:11434); appended with /api/generate
		Model  string // Ollama model name used to summarise each backup diff (e.g. llama3)
	}
	OpenAI struct {
		Enable bool   // enable OpenAI-compatible commit message generation (fallback when Ollama is unset/unreachable); requires URL
		URL    string // OpenAI-compatible REST API base URL (e.g. http://localhost:8080/v1); appended with /chat/completions
		Model  string // OpenAI model name (optional; defaults to _openaiDefaultModel when empty)
		Token  string // OpenAI API bearer token (optional; sent as Authorization: Bearer <token> when non-empty)
	}
	Unifi struct {
		WebUI   *url.URL
		Tag     string
		Version string
		Backup  struct {
			Enable bool
			User   string
			Secret string
		}
		Export struct {
			Enable bool
			Format string
			URI    *url.URL
		}
		Watch struct {
			Enable bool      // enable Unifi autoBackup folder watch & sync
			Path   string    // absolute path to the Unifi autoBackup source folder
			Meta   string    // absolute path to the autobackup_meta.json marker file
			LastTS time.Time // mtime of the marker file at the last successful sync (guarded by unifiWatchMutex)
			// runtime sync stats (guarded by unifiWatchMutex, see status.go)
			SetupErr     string    // setup-time error reason when the watcher could not be armed (empty when armed OK)
			LastSyncErr  string    // last runtime sync failure reason (cleared on the next successful sync)
			LastSyncTS   time.Time // wall-clock of the last sync pass
			LastFile     string    // newest .unf file synced on the last pass
			SyncedFiles  int       // number of new .unf files checked into the store on the last pass
			SkippedFiles int       // number of .unf files that were unchanged (sha256 matched current.unf)
			SourceFiles  int       // total number of .unf files observed in the source folder on the last pass
		}
	}
	Wazuh struct {
		WebUI *url.URL
	}
	Prometheus struct {
		WebUI *url.URL
	}
	Grafana struct {
		WebUI   *url.URL
		FreeBSD *url.URL
		HAProxy *url.URL
		Unifi   *url.URL
	}
	RSysLog struct {
		Enable bool   // enable RFC5424 compliant remote syslog store server (default: false)
		Server string // internal syslog listen ip and port [ example: 192.168.0.100:5140 ] (required)
	}
	Sync struct {
		Enable bool // enable Master Server

		Master string // Master Server Name
		PKG    struct {
			Enable   bool     // enable packages sync
			Packages []string // list of Packages to sync
		}
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

OPNCall

func Setup ΒΆ added in v0.0.3

func Setup() (*OPNCall, error)

Setup reads OPNBorgs configuration via env, sanitizes, sets sane defaults

type OPNGroup ΒΆ added in v0.0.28

type OPNGroup struct {
	Name   string   // group name
	OPN    bool     // is OPNsense Appliance
	Unifi  bool     // is Unifi Controller
	Desc   string   // group description (text, from env, shown when no ImgURL)
	ImgURL string   // group image url (from env, replaces text headline when set)
	Member []string // group member
}

OPNGroup Type

type Opnsense ΒΆ added in v0.0.3

type Opnsense struct {
	XMLName xml.Name `xml:"opnsense"`
	Text    string   `xml:",chardata"`
	Theme   string   `xml:"theme"`
	Sysctl  struct {
		Text string `xml:",chardata"`
		Item []struct {
			Text    string `xml:",chardata"`
			Descr   string `xml:"descr"`
			Tunable string `xml:"tunable"`
			Value   string `xml:"value"`
		} `xml:"item"`
	} `xml:"sysctl"`
	System struct {
		Text             string `xml:",chardata"`
		Optimization     string `xml:"optimization"`
		Hostname         string `xml:"hostname"`
		Domain           string `xml:"domain"`
		Dnsallowoverride string `xml:"dnsallowoverride"`
		Group            struct {
			Text        string `xml:",chardata"`
			Name        string `xml:"name"`
			Description string `xml:"description"`
			Scope       string `xml:"scope"`
			Gid         string `xml:"gid"`
			Member      string `xml:"member"`
			Priv        string `xml:"priv"`
		} `xml:"group"`
		User []struct {
			Text           string   `xml:",chardata"`
			Name           string   `xml:"name"`
			Descr          string   `xml:"descr"`
			Scope          string   `xml:"scope"`
			Groupname      string   `xml:"groupname"`
			Password       string   `xml:"password"`
			Uid            string   `xml:"uid"`
			Priv           []string `xml:"priv"`
			Expires        string   `xml:"expires"`
			Authorizedkeys string   `xml:"authorizedkeys"`
			OtpSeed        string   `xml:"otp_seed"`
			Apikeys        struct {
				Text string `xml:",chardata"`
				Item struct {
					Text   string `xml:",chardata"`
					Key    string `xml:"key"`
					Secret string `xml:"secret"`
				} `xml:"item"`
			} `xml:"apikeys"`
		} `xml:"user"`
		Nextuid     string `xml:"nextuid"`
		Nextgid     string `xml:"nextgid"`
		Timezone    string `xml:"timezone"`
		Timeservers string `xml:"timeservers"`
		Webgui      struct {
			Text       string `xml:",chardata"`
			Protocol   string `xml:"protocol"`
			SslCertref string `xml:"ssl-certref"`
		} `xml:"webgui"`
		Disablenatreflection          string `xml:"disablenatreflection"`
		Usevirtualterminal            string `xml:"usevirtualterminal"`
		Disableconsolemenu            string `xml:"disableconsolemenu"`
		Disablevlanhwfilter           string `xml:"disablevlanhwfilter"`
		Disablechecksumoffloading     string `xml:"disablechecksumoffloading"`
		Disablesegmentationoffloading string `xml:"disablesegmentationoffloading"`
		Disablelargereceiveoffloading string `xml:"disablelargereceiveoffloading"`
		Ipv6allow                     string `xml:"ipv6allow"`
		PowerdAcMode                  string `xml:"powerd_ac_mode"`
		PowerdBatteryMode             string `xml:"powerd_battery_mode"`
		PowerdNormalMode              string `xml:"powerd_normal_mode"`
		Bogons                        struct {
			Text     string `xml:",chardata"`
			Interval string `xml:"interval"`
		} `xml:"bogons"`
		PfShareForward string `xml:"pf_share_forward"`
		LbUseSticky    string `xml:"lb_use_sticky"`
		Ssh            struct {
			Text  string `xml:",chardata"`
			Group string `xml:"group"`
		} `xml:"ssh"`
		Rrdbackup     string `xml:"rrdbackup"`
		Netflowbackup string `xml:"netflowbackup"`
		Firmware      struct {
			Text         string `xml:",chardata"`
			Version      string `xml:"version,attr"`
			Mirror       string `xml:"mirror"`
			Flavour      string `xml:"flavour"`
			Plugins      string `xml:"plugins"`
			Type         string `xml:"type"`
			Subscription string `xml:"subscription"`
			Reboot       string `xml:"reboot"`
		} `xml:"firmware"`
		Dnsserver string `xml:"dnsserver"`
		Backup    struct {
			Text string `xml:",chardata"`
			Git  struct {
				Text     string `xml:",chardata"`
				Version  string `xml:"version,attr"`
				Enabled  string `xml:"enabled"`
				URL      string `xml:"url"`
				Branch   string `xml:"branch"`
				Privkey  string `xml:"privkey"`
				User     string `xml:"user"`
				Password string `xml:"password"`
			} `xml:"git"`
		} `xml:"backup"`
		Language                string `xml:"language"`
		DnsallowoverrideExclude string `xml:"dnsallowoverride_exclude"`
		Dns1gw                  string `xml:"dns1gw"`
		Dns2gw                  string `xml:"dns2gw"`
		Dns3gw                  string `xml:"dns3gw"`
		Dns4gw                  string `xml:"dns4gw"`
		Dns5gw                  string `xml:"dns5gw"`
		Dns6gw                  string `xml:"dns6gw"`
		Dns7gw                  string `xml:"dns7gw"`
		Dns8gw                  string `xml:"dns8gw"`
	} `xml:"system"`
	Interfaces struct {
		Text string `xml:",chardata"`
		Lan  struct {
			Text      string `xml:",chardata"`
			Enable    string `xml:"enable"`
			If        string `xml:"if"`
			Ipaddr    string `xml:"ipaddr"`
			Subnet    string `xml:"subnet"`
			Ipaddrv6  string `xml:"ipaddrv6"`
			Subnetv6  string `xml:"subnetv6"`
			Media     string `xml:"media"`
			Mediaopt  string `xml:"mediaopt"`
			Gateway   string `xml:"gateway"`
			Gatewayv6 string `xml:"gatewayv6"`
			Descr     string `xml:"descr"`
		} `xml:"lan"`
		Lo0 struct {
			Text            string `xml:",chardata"`
			InternalDynamic string `xml:"internal_dynamic"`
			Descr           string `xml:"descr"`
			Enable          string `xml:"enable"`
			If              string `xml:"if"`
			Ipaddr          string `xml:"ipaddr"`
			Ipaddrv6        string `xml:"ipaddrv6"`
			Subnet          string `xml:"subnet"`
			Subnetv6        string `xml:"subnetv6"`
			Type            string `xml:"type"`
			Virtual         string `xml:"virtual"`
		} `xml:"lo0"`
		Wireguard struct {
			Text            string `xml:",chardata"`
			InternalDynamic string `xml:"internal_dynamic"`
			Descr           string `xml:"descr"`
			If              string `xml:"if"`
			Virtual         string `xml:"virtual"`
			Enable          string `xml:"enable"`
			Type            string `xml:"type"`
			Networks        string `xml:"networks"`
		} `xml:"wireguard"`
		Opt1 struct {
			Text  string `xml:",chardata"`
			Descr string `xml:"descr"`
			If    string `xml:"if"`
		} `xml:"opt1"`
	} `xml:"interfaces"`
	Dhcpd struct {
		Text string `xml:",chardata"`
		Lan  struct {
			Text  string `xml:",chardata"`
			Range struct {
				Text string `xml:",chardata"`
				From string `xml:"from"`
				To   string `xml:"to"`
			} `xml:"range"`
		} `xml:"lan"`
	} `xml:"dhcpd"`
	Snmpd struct {
		Text        string `xml:",chardata"`
		Syslocation string `xml:"syslocation"`
		Syscontact  string `xml:"syscontact"`
		Rocommunity string `xml:"rocommunity"`
	} `xml:"snmpd"`
	Nat struct {
		Text     string `xml:",chardata"`
		Outbound struct {
			Text string `xml:",chardata"`
			Mode string `xml:"mode"`
		} `xml:"outbound"`
	} `xml:"nat"`
	Filter struct {
		Text string `xml:",chardata"`
		Rule []struct {
			Text       string `xml:",chardata"`
			Type       string `xml:"type"`
			Ipprotocol string `xml:"ipprotocol"`
			Descr      string `xml:"descr"`
			Interface  string `xml:"interface"`
			Source     struct {
				Text    string `xml:",chardata"`
				Network string `xml:"network"`
			} `xml:"source"`
			Destination struct {
				Text string `xml:",chardata"`
				Any  string `xml:"any"`
			} `xml:"destination"`
		} `xml:"rule"`
	} `xml:"filter"`
	Rrd struct {
		Text   string `xml:",chardata"`
		Enable string `xml:"enable"`
	} `xml:"rrd"`
	Ntpd struct {
		Text       string `xml:",chardata"`
		Prefer     string `xml:"prefer"`
		Logpeer    string `xml:"logpeer"`
		Logsys     string `xml:"logsys"`
		Statsgraph string `xml:"statsgraph"`
	} `xml:"ntpd"`
	Revision struct {
		Text        string `xml:",chardata"`
		Username    string `xml:"username"`
		Time        string `xml:"time"`
		Description string `xml:"description"`
	} `xml:"revision"`
	OPNsense struct {
		Text     string `xml:",chardata"`
		DHCRelay struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
		} `xml:"DHCRelay"`
		Proxy struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text       string `xml:",chardata"`
				Enabled    string `xml:"enabled"`
				ErrorPages string `xml:"error_pages"`
				IcpPort    string `xml:"icpPort"`
				Logging    struct {
					Text   string `xml:",chardata"`
					Enable struct {
						Text      string `xml:",chardata"`
						AccessLog string `xml:"accessLog"`
						StoreLog  string `xml:"storeLog"`
					} `xml:"enable"`
					IgnoreLogACL string `xml:"ignoreLogACL"`
					Target       string `xml:"target"`
				} `xml:"logging"`
				AlternateDNSservers   string `xml:"alternateDNSservers"`
				ForwardedForHandling  string `xml:"forwardedForHandling"`
				UriWhitespaceHandling string `xml:"uriWhitespaceHandling"`
				EnablePinger          string `xml:"enablePinger"`
				UseViaHeader          string `xml:"useViaHeader"`
				SuppressVersion       string `xml:"suppressVersion"`
				Connecttimeout        string `xml:"connecttimeout"`
				VisibleEmail          string `xml:"VisibleEmail"`
				VisibleHostname       string `xml:"VisibleHostname"`
				Cache                 struct {
					Text  string `xml:",chardata"`
					Local struct {
						Text                      string `xml:",chardata"`
						Enabled                   string `xml:"enabled"`
						Directory                 string `xml:"directory"`
						CacheMem                  string `xml:"cache_mem"`
						MaximumObjectSize         string `xml:"maximum_object_size"`
						MaximumObjectSizeInMemory string `xml:"maximum_object_size_in_memory"`
						MemoryCacheMode           string `xml:"memory_cache_mode"`
						Size                      string `xml:"size"`
						L1                        string `xml:"l1"`
						L2                        string `xml:"l2"`
						CacheLinuxPackages        string `xml:"cache_linux_packages"`
						CacheWindowsUpdates       string `xml:"cache_windows_updates"`
					} `xml:"local"`
				} `xml:"cache"`
				Traffic struct {
					Text                       string `xml:",chardata"`
					Enabled                    string `xml:"enabled"`
					MaxDownloadSize            string `xml:"maxDownloadSize"`
					MaxUploadSize              string `xml:"maxUploadSize"`
					OverallBandwidthTrotteling string `xml:"OverallBandwidthTrotteling"`
					PerHostTrotteling          string `xml:"perHostTrotteling"`
				} `xml:"traffic"`
				Parentproxy struct {
					Text         string `xml:",chardata"`
					Enabled      string `xml:"enabled"`
					Host         string `xml:"host"`
					Enableauth   string `xml:"enableauth"`
					User         string `xml:"user"`
					Password     string `xml:"password"`
					Port         string `xml:"port"`
					Localdomains string `xml:"localdomains"`
					Localips     string `xml:"localips"`
				} `xml:"parentproxy"`
			} `xml:"general"`
			Forward struct {
				Text                      string `xml:",chardata"`
				Interfaces                string `xml:"interfaces"`
				Port                      string `xml:"port"`
				Sslbumpport               string `xml:"sslbumpport"`
				Sslbump                   string `xml:"sslbump"`
				Sslurlonly                string `xml:"sslurlonly"`
				Sslcertificate            string `xml:"sslcertificate"`
				Sslnobumpsites            string `xml:"sslnobumpsites"`
				SslCrtdStorageMaxSize     string `xml:"ssl_crtd_storage_max_size"`
				SslcrtdChildren           string `xml:"sslcrtd_children"`
				SnmpEnable                string `xml:"snmp_enable"`
				SnmpPort                  string `xml:"snmp_port"`
				SnmpPassword              string `xml:"snmp_password"`
				FtpInterfaces             string `xml:"ftpInterfaces"`
				FtpPort                   string `xml:"ftpPort"`
				FtpTransparentMode        string `xml:"ftpTransparentMode"`
				AddACLforInterfaceSubnets string `xml:"addACLforInterfaceSubnets"`
				TransparentMode           string `xml:"transparentMode"`
				Acl                       struct {
					Text           string `xml:",chardata"`
					AllowedSubnets string `xml:"allowedSubnets"`
					Unrestricted   string `xml:"unrestricted"`
					BannedHosts    string `xml:"bannedHosts"`
					WhiteList      string `xml:"whiteList"`
					BlackList      string `xml:"blackList"`
					Browser        string `xml:"browser"`
					MimeType       string `xml:"mimeType"`
					Googleapps     string `xml:"googleapps"`
					Youtube        string `xml:"youtube"`
					SafePorts      string `xml:"safePorts"`
					SslPorts       string `xml:"sslPorts"`
					RemoteACLs     struct {
						Text       string `xml:",chardata"`
						Blacklists string `xml:"blacklists"`
						UpdateCron string `xml:"UpdateCron"`
					} `xml:"remoteACLs"`
				} `xml:"acl"`
				Icap struct {
					Text           string `xml:",chardata"`
					Enable         string `xml:"enable"`
					RequestURL     string `xml:"RequestURL"`
					ResponseURL    string `xml:"ResponseURL"`
					SendClientIP   string `xml:"SendClientIP"`
					SendUsername   string `xml:"SendUsername"`
					EncodeUsername string `xml:"EncodeUsername"`
					UsernameHeader string `xml:"UsernameHeader"`
					EnablePreview  string `xml:"EnablePreview"`
					PreviewSize    string `xml:"PreviewSize"`
					OptionsTTL     string `xml:"OptionsTTL"`
					Exclude        string `xml:"exclude"`
				} `xml:"icap"`
				Authentication struct {
					Text             string `xml:",chardata"`
					Method           string `xml:"method"`
					AuthEnforceGroup string `xml:"authEnforceGroup"`
					Realm            string `xml:"realm"`
					Credentialsttl   string `xml:"credentialsttl"`
					Children         string `xml:"children"`
				} `xml:"authentication"`
			} `xml:"forward"`
			Pac        string `xml:"pac"`
			ErrorPages struct {
				Text     string `xml:",chardata"`
				Template string `xml:"template"`
			} `xml:"error_pages"`
		} `xml:"proxy"`
		Vnstat struct {
			Text    string `xml:",chardata"`
			General struct {
				Text      string `xml:",chardata"`
				Version   string `xml:"version,attr"`
				Enabled   string `xml:"enabled"`
				Interface string `xml:"interface"`
			} `xml:"general"`
		} `xml:"vnstat"`
		Bind struct {
			Text    string `xml:",chardata"`
			General struct {
				Text               string `xml:",chardata"`
				Version            string `xml:"version,attr"`
				Enabled            string `xml:"enabled"`
				Disablev6          string `xml:"disablev6"`
				Enablerpz          string `xml:"enablerpz"`
				Listenv4           string `xml:"listenv4"`
				Listenv6           string `xml:"listenv6"`
				Querysource        string `xml:"querysource"`
				Querysourcev6      string `xml:"querysourcev6"`
				Transfersource     string `xml:"transfersource"`
				Transfersourcev6   string `xml:"transfersourcev6"`
				Port               string `xml:"port"`
				Forwarders         string `xml:"forwarders"`
				Filteraaaav4       string `xml:"filteraaaav4"`
				Filteraaaav6       string `xml:"filteraaaav6"`
				Filteraaaaacl      string `xml:"filteraaaaacl"`
				Logsize            string `xml:"logsize"`
				GeneralLogLevel    string `xml:"general_log_level"`
				Maxcachesize       string `xml:"maxcachesize"`
				Recursion          string `xml:"recursion"`
				Allowtransfer      string `xml:"allowtransfer"`
				Allowquery         string `xml:"allowquery"`
				Dnssecvalidation   string `xml:"dnssecvalidation"`
				Hidehostname       string `xml:"hidehostname"`
				Hideversion        string `xml:"hideversion"`
				Disableprefetch    string `xml:"disableprefetch"`
				Enableratelimiting string `xml:"enableratelimiting"`
				Ratelimitcount     string `xml:"ratelimitcount"`
				Ratelimitexcept    string `xml:"ratelimitexcept"`
				Rndcalgo           string `xml:"rndcalgo"`
				Rndcsecret         string `xml:"rndcsecret"`
			} `xml:"general"`
			Dnsbl struct {
				Text                string `xml:",chardata"`
				Version             string `xml:"version,attr"`
				Enabled             string `xml:"enabled"`
				Type                string `xml:"type"`
				Whitelists          string `xml:"whitelists"`
				Forcesafegoogle     string `xml:"forcesafegoogle"`
				Forcesafeduckduckgo string `xml:"forcesafeduckduckgo"`
				Forcesafeyoutube    string `xml:"forcesafeyoutube"`
				Forcestrictbing     string `xml:"forcestrictbing"`
			} `xml:"dnsbl"`
			Domain struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Domains string `xml:"domains"`
			} `xml:"domain"`
			Record struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Records string `xml:"records"`
			} `xml:"record"`
			Acl struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Acls    string `xml:"acls"`
			} `xml:"acl"`
		} `xml:"bind"`
		HAProxy struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text            string `xml:",chardata"`
				Enabled         string `xml:"enabled"`
				GracefulStop    string `xml:"gracefulStop"`
				HardStopAfter   string `xml:"hardStopAfter"`
				CloseSpreadTime string `xml:"closeSpreadTime"`
				SeamlessReload  string `xml:"seamlessReload"`
				StoreOcsp       string `xml:"storeOcsp"`
				ShowIntro       string `xml:"showIntro"`
				Peers           struct {
					Text    string `xml:",chardata"`
					Enabled string `xml:"enabled"`
					Name1   string `xml:"name1"`
					Listen1 string `xml:"listen1"`
					Port1   string `xml:"port1"`
					Name2   string `xml:"name2"`
					Listen2 string `xml:"listen2"`
					Port2   string `xml:"port2"`
				} `xml:"peers"`
				Tuning struct {
					Text                           string `xml:",chardata"`
					Root                           string `xml:"root"`
					MaxConnections                 string `xml:"maxConnections"`
					Nbthread                       string `xml:"nbthread"`
					ResolversPrefer                string `xml:"resolversPrefer"`
					SslServerVerify                string `xml:"sslServerVerify"`
					MaxDHSize                      string `xml:"maxDHSize"`
					BufferSize                     string `xml:"bufferSize"`
					SpreadChecks                   string `xml:"spreadChecks"`
					BogusProxyEnabled              string `xml:"bogusProxyEnabled"`
					LuaMaxMem                      string `xml:"luaMaxMem"`
					CustomOptions                  string `xml:"customOptions"`
					OcspUpdateEnabled              string `xml:"ocspUpdateEnabled"`
					OcspUpdateMinDelay             string `xml:"ocspUpdateMinDelay"`
					OcspUpdateMaxDelay             string `xml:"ocspUpdateMaxDelay"`
					SslDefaultsEnabled             string `xml:"ssl_defaultsEnabled"`
					SslBindOptions                 string `xml:"ssl_bindOptions"`
					SslMinVersion                  string `xml:"ssl_minVersion"`
					SslMaxVersion                  string `xml:"ssl_maxVersion"`
					SslCipherList                  string `xml:"ssl_cipherList"`
					SslCipherSuites                string `xml:"ssl_cipherSuites"`
					H2InitialWindowSize            string `xml:"h2_initialWindowSize"`
					H2InitialWindowSizeOutgoing    string `xml:"h2_initialWindowSizeOutgoing"`
					H2InitialWindowSizeIncoming    string `xml:"h2_initialWindowSizeIncoming"`
					H2MaxConcurrentStreams         string `xml:"h2_maxConcurrentStreams"`
					H2MaxConcurrentStreamsOutgoing string `xml:"h2_maxConcurrentStreamsOutgoing"`
					H2MaxConcurrentStreamsIncoming string `xml:"h2_maxConcurrentStreamsIncoming"`
				} `xml:"tuning"`
				Defaults struct {
					Text                  string `xml:",chardata"`
					MaxConnections        string `xml:"maxConnections"`
					MaxConnectionsServers string `xml:"maxConnectionsServers"`
					TimeoutClient         string `xml:"timeoutClient"`
					TimeoutConnect        string `xml:"timeoutConnect"`
					TimeoutCheck          string `xml:"timeoutCheck"`
					TimeoutServer         string `xml:"timeoutServer"`
					Retries               string `xml:"retries"`
					Redispatch            string `xml:"redispatch"`
					InitAddr              string `xml:"init_addr"`
					CustomOptions         string `xml:"customOptions"`
				} `xml:"defaults"`
				Logging struct {
					Text     string `xml:",chardata"`
					Host     string `xml:"host"`
					Facility string `xml:"facility"`
					Level    string `xml:"level"`
					Length   string `xml:"length"`
				} `xml:"logging"`
				Stats struct {
					Text              string `xml:",chardata"`
					Enabled           string `xml:"enabled"`
					Port              string `xml:"port"`
					RemoteEnabled     string `xml:"remoteEnabled"`
					RemoteBind        string `xml:"remoteBind"`
					AuthEnabled       string `xml:"authEnabled"`
					Users             string `xml:"users"`
					AllowedUsers      string `xml:"allowedUsers"`
					AllowedGroups     string `xml:"allowedGroups"`
					CustomOptions     string `xml:"customOptions"`
					PrometheusEnabled string `xml:"prometheus_enabled"`
					PrometheusBind    string `xml:"prometheus_bind"`
					PrometheusPath    string `xml:"prometheus_path"`
				} `xml:"stats"`
				Cache struct {
					Text                string `xml:",chardata"`
					Enabled             string `xml:"enabled"`
					TotalMaxSize        string `xml:"totalMaxSize"`
					MaxAge              string `xml:"maxAge"`
					MaxObjectSize       string `xml:"maxObjectSize"`
					ProcessVary         string `xml:"processVary"`
					MaxSecondaryEntries string `xml:"maxSecondaryEntries"`
				} `xml:"cache"`
			} `xml:"general"`
			Frontends    string `xml:"frontends"`
			Backends     string `xml:"backends"`
			Servers      string `xml:"servers"`
			Healthchecks string `xml:"healthchecks"`
			Acls         string `xml:"acls"`
			Actions      string `xml:"actions"`
			Luas         string `xml:"luas"`
			Fcgis        string `xml:"fcgis"`
			Errorfiles   string `xml:"errorfiles"`
			Mapfiles     string `xml:"mapfiles"`
			Groups       string `xml:"groups"`
			Users        string `xml:"users"`
			Cpus         string `xml:"cpus"`
			Resolvers    string `xml:"resolvers"`
			Mailers      string `xml:"mailers"`
			Maintenance  struct {
				Text     string `xml:",chardata"`
				Cronjobs struct {
					Text               string `xml:",chardata"`
					SyncCerts          string `xml:"syncCerts"`
					SyncCertsCron      string `xml:"syncCertsCron"`
					UpdateOcsp         string `xml:"updateOcsp"`
					UpdateOcspCron     string `xml:"updateOcspCron"`
					ReloadService      string `xml:"reloadService"`
					ReloadServiceCron  string `xml:"reloadServiceCron"`
					RestartService     string `xml:"restartService"`
					RestartServiceCron string `xml:"restartServiceCron"`
				} `xml:"cronjobs"`
			} `xml:"maintenance"`
		} `xml:"HAProxy"`
		TrafficShaper struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			Pipes   string `xml:"pipes"`
			Queues  string `xml:"queues"`
			Rules   string `xml:"rules"`
		} `xml:"TrafficShaper"`
		Syslog struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text        string `xml:",chardata"`
				Enabled     string `xml:"enabled"`
				Loglocal    string `xml:"loglocal"`
				Maxpreserve string `xml:"maxpreserve"`
				Maxfilesize string `xml:"maxfilesize"`
			} `xml:"general"`
			Destinations struct {
				Text string `xml:",chardata"`
				// OPNsense stores every configured remote-syslog destination as
				// its own repeated <destination> child; a single struct field
				// would silently collapse them into a franken-entry.
				Destination []SyslogDestination `xml:"destination"`
			} `xml:"destinations"`
		} `xml:"Syslog"`
		OpenVPN struct {
			Text       string `xml:",chardata"`
			Version    string `xml:"version,attr"`
			Overwrites string `xml:"Overwrites"`
			Instances  string `xml:"Instances"`
			StaticKeys string `xml:"StaticKeys"`
		} `xml:"OpenVPN"`
		OpenVPNExport struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			Servers string `xml:"servers"`
		} `xml:"OpenVPNExport"`
		Unboundplus struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text              string `xml:",chardata"`
				Enabled           string `xml:"enabled"`
				Port              string `xml:"port"`
				Stats             string `xml:"stats"`
				ActiveInterface   string `xml:"active_interface"`
				Dnssec            string `xml:"dnssec"`
				Dns64             string `xml:"dns64"`
				Dns64prefix       string `xml:"dns64prefix"`
				Noarecords        string `xml:"noarecords"`
				Regdhcp           string `xml:"regdhcp"`
				Regdhcpdomain     string `xml:"regdhcpdomain"`
				Regdhcpstatic     string `xml:"regdhcpstatic"`
				Noreglladdr6      string `xml:"noreglladdr6"`
				Noregrecords      string `xml:"noregrecords"`
				Txtsupport        string `xml:"txtsupport"`
				Cacheflush        string `xml:"cacheflush"`
				LocalZoneType     string `xml:"local_zone_type"`
				OutgoingInterface string `xml:"outgoing_interface"`
				EnableWpad        string `xml:"enable_wpad"`
			} `xml:"general"`
			Advanced struct {
				Text                      string `xml:",chardata"`
				Hideidentity              string `xml:"hideidentity"`
				Hideversion               string `xml:"hideversion"`
				Prefetch                  string `xml:"prefetch"`
				Prefetchkey               string `xml:"prefetchkey"`
				Dnssecstripped            string `xml:"dnssecstripped"`
				Aggressivensec            string `xml:"aggressivensec"`
				Serveexpired              string `xml:"serveexpired"`
				Serveexpiredreplyttl      string `xml:"serveexpiredreplyttl"`
				Serveexpiredttl           string `xml:"serveexpiredttl"`
				Serveexpiredttlreset      string `xml:"serveexpiredttlreset"`
				Serveexpiredclienttimeout string `xml:"serveexpiredclienttimeout"`
				Qnameminstrict            string `xml:"qnameminstrict"`
				Extendedstatistics        string `xml:"extendedstatistics"`
				Logqueries                string `xml:"logqueries"`
				Logreplies                string `xml:"logreplies"`
				Logtagqueryreply          string `xml:"logtagqueryreply"`
				Logservfail               string `xml:"logservfail"`
				Loglocalactions           string `xml:"loglocalactions"`
				Logverbosity              string `xml:"logverbosity"`
				Valloglevel               string `xml:"valloglevel"`
				Privatedomain             string `xml:"privatedomain"`
				Privateaddress            string `xml:"privateaddress"`
				Insecuredomain            string `xml:"insecuredomain"`
				Msgcachesize              string `xml:"msgcachesize"`
				Rrsetcachesize            string `xml:"rrsetcachesize"`
				Outgoingnumtcp            string `xml:"outgoingnumtcp"`
				Incomingnumtcp            string `xml:"incomingnumtcp"`
				Numqueriesperthread       string `xml:"numqueriesperthread"`
				Outgoingrange             string `xml:"outgoingrange"`
				Jostletimeout             string `xml:"jostletimeout"`
				Discardtimeout            string `xml:"discardtimeout"`
				Cachemaxttl               string `xml:"cachemaxttl"`
				Cachemaxnegativettl       string `xml:"cachemaxnegativettl"`
				Cacheminttl               string `xml:"cacheminttl"`
				Infrahostttl              string `xml:"infrahostttl"`
				Infrakeepprobing          string `xml:"infrakeepprobing"`
				Infracachenumhosts        string `xml:"infracachenumhosts"`
				Unwantedreplythreshold    string `xml:"unwantedreplythreshold"`
			} `xml:"advanced"`
			Acls struct {
				Text          string `xml:",chardata"`
				DefaultAction string `xml:"default_action"`
			} `xml:"acls"`
			Dnsbl struct {
				Text       string `xml:",chardata"`
				Enabled    string `xml:"enabled"`
				Safesearch string `xml:"safesearch"`
				Type       string `xml:"type"`
				Lists      string `xml:"lists"`
				Whitelists string `xml:"whitelists"`
				Blocklists string `xml:"blocklists"`
				Wildcards  string `xml:"wildcards"`
				Address    string `xml:"address"`
				Nxdomain   string `xml:"nxdomain"`
			} `xml:"dnsbl"`
			Forwarding struct {
				Text    string `xml:",chardata"`
				Enabled string `xml:"enabled"`
			} `xml:"forwarding"`
			Dots    string `xml:"dots"`
			Hosts   string `xml:"hosts"`
			Aliases string `xml:"aliases"`
			Domains string `xml:"domains"`
		} `xml:"unboundplus"`
		Captiveportal struct {
			Text      string `xml:",chardata"`
			Version   string `xml:"version,attr"`
			Zones     string `xml:"zones"`
			Templates string `xml:"templates"`
		} `xml:"captiveportal"`
		Kea struct {
			Text  string `xml:",chardata"`
			Dhcp4 struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				General struct {
					Text          string `xml:",chardata"`
					Enabled       string `xml:"enabled"`
					Interfaces    string `xml:"interfaces"`
					ValidLifetime string `xml:"valid_lifetime"`
					Fwrules       string `xml:"fwrules"`
				} `xml:"general"`
				Ha struct {
					Text           string `xml:",chardata"`
					Enabled        string `xml:"enabled"`
					ThisServerName string `xml:"this_server_name"`
				} `xml:"ha"`
				Subnets      string `xml:"subnets"`
				Reservations string `xml:"reservations"`
				HaPeers      string `xml:"ha_peers"`
			} `xml:"dhcp4"`
			CtrlAgent struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				General struct {
					Text     string `xml:",chardata"`
					Enabled  string `xml:"enabled"`
					HTTPHost string `xml:"http_host"`
					HTTPPort string `xml:"http_port"`
				} `xml:"general"`
			} `xml:"ctrl_agent"`
		} `xml:"Kea"`
		IDS struct {
			Text             string `xml:",chardata"`
			Version          string `xml:"version,attr"`
			Rules            string `xml:"rules"`
			Policies         string `xml:"policies"`
			UserDefinedRules string `xml:"userDefinedRules"`
			Files            string `xml:"files"`
			FileTags         string `xml:"fileTags"`
			General          struct {
				Text              string `xml:",chardata"`
				Enabled           string `xml:"enabled"`
				Ips               string `xml:"ips"`
				Promisc           string `xml:"promisc"`
				Interfaces        string `xml:"interfaces"`
				Homenet           string `xml:"homenet"`
				DefaultPacketSize string `xml:"defaultPacketSize"`
				UpdateCron        string `xml:"UpdateCron"`
				AlertLogrotate    string `xml:"AlertLogrotate"`
				AlertSaveLogs     string `xml:"AlertSaveLogs"`
				MPMAlgo           string `xml:"MPMAlgo"`
				Detect            struct {
					Text           string `xml:",chardata"`
					Profile        string `xml:"Profile"`
					ToclientGroups string `xml:"toclient_groups"`
					ToserverGroups string `xml:"toserver_groups"`
				} `xml:"detect"`
				Syslog     string `xml:"syslog"`
				SyslogEve  string `xml:"syslog_eve"`
				LogPayload string `xml:"LogPayload"`
				Verbosity  string `xml:"verbosity"`
			} `xml:"general"`
		} `xml:"IDS"`
		IPsec struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text                string `xml:",chardata"`
				Enabled             string `xml:"enabled"`
				PreferredOldsa      string `xml:"preferred_oldsa"`
				Disablevpnrules     string `xml:"disablevpnrules"`
				PassthroughNetworks string `xml:"passthrough_networks"`
			} `xml:"general"`
			Charon struct {
				Text               string `xml:",chardata"`
				MaxIkev1Exchanges  string `xml:"max_ikev1_exchanges"`
				Threads            string `xml:"threads"`
				IkesaTableSize     string `xml:"ikesa_table_size"`
				IkesaTableSegments string `xml:"ikesa_table_segments"`
				InitLimitHalfOpen  string `xml:"init_limit_half_open"`
				IgnoreAcquireTs    string `xml:"ignore_acquire_ts"`
				RetransmitTries    string `xml:"retransmit_tries"`
				RetransmitTimeout  string `xml:"retransmit_timeout"`
				RetransmitBase     string `xml:"retransmit_base"`
				RetransmitJitter   string `xml:"retransmit_jitter"`
				RetransmitLimit    string `xml:"retransmit_limit"`
				Syslog             struct {
					Text   string `xml:",chardata"`
					Daemon struct {
						Text     string `xml:",chardata"`
						IkeName  string `xml:"ike_name"`
						LogLevel string `xml:"log_level"`
						App      string `xml:"app"`
						Asn      string `xml:"asn"`
						Cfg      string `xml:"cfg"`
						Chd      string `xml:"chd"`
						Dmn      string `xml:"dmn"`
						Enc      string `xml:"enc"`
						Esp      string `xml:"esp"`
						Ike      string `xml:"ike"`
						Imc      string `xml:"imc"`
						Imv      string `xml:"imv"`
						Job      string `xml:"job"`
						Knl      string `xml:"knl"`
						Lib      string `xml:"lib"`
						Mgr      string `xml:"mgr"`
						Net      string `xml:"net"`
						Pts      string `xml:"pts"`
						Tls      string `xml:"tls"`
						Tnc      string `xml:"tnc"`
					} `xml:"daemon"`
				} `xml:"syslog"`
			} `xml:"charon"`
			KeyPairs      string `xml:"keyPairs"`
			PreSharedKeys string `xml:"preSharedKeys"`
		} `xml:"IPsec"`
		Swanctl struct {
			Text        string `xml:",chardata"`
			Version     string `xml:"version,attr"`
			Connections string `xml:"Connections"`
			Locals      string `xml:"locals"`
			Remotes     string `xml:"remotes"`
			Children    string `xml:"children"`
			Pools       string `xml:"Pools"`
			VTIs        string `xml:"VTIs"`
			SPDs        string `xml:"SPDs"`
		} `xml:"Swanctl"`
		Firewall struct {
			Text       string `xml:",chardata"`
			Lvtemplate struct {
				Text      string `xml:",chardata"`
				Version   string `xml:"version,attr"`
				Templates string `xml:"templates"`
			} `xml:"Lvtemplate"`
			Category struct {
				Text       string `xml:",chardata"`
				Version    string `xml:"version,attr"`
				Categories string `xml:"categories"`
			} `xml:"Category"`
			Alias struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Geoip   struct {
					Text string `xml:",chardata"`
					URL  string `xml:"url"`
				} `xml:"geoip"`
				Aliases string `xml:"aliases"`
			} `xml:"Alias"`
			Filter struct {
				Text      string `xml:",chardata"`
				Version   string `xml:"version,attr"`
				Rules     string `xml:"rules"`
				Snatrules string `xml:"snatrules"`
				Npt       string `xml:"npt"`
				Onetoone  string `xml:"onetoone"`
			} `xml:"Filter"`
		} `xml:"Firewall"`
		Netflow struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			Capture struct {
				Text       string `xml:",chardata"`
				Interfaces string `xml:"interfaces"`
				EgressOnly string `xml:"egress_only"`
				Version    string `xml:"version"`
				Targets    string `xml:"targets"`
			} `xml:"capture"`
			Collect struct {
				Text   string `xml:",chardata"`
				Enable string `xml:"enable"`
			} `xml:"collect"`
			ActiveTimeout   string `xml:"activeTimeout"`
			InactiveTimeout string `xml:"inactiveTimeout"`
		} `xml:"Netflow"`
		Wireguard struct {
			Text   string `xml:",chardata"`
			Server struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Servers struct {
					Text   string `xml:",chardata"`
					Server struct {
						Text          string `xml:",chardata"`
						Uuid          string `xml:"uuid,attr"`
						Enabled       string `xml:"enabled"`
						Name          string `xml:"name"`
						Instance      string `xml:"instance"`
						Pubkey        string `xml:"pubkey"`
						Privkey       string `xml:"privkey"`
						Port          string `xml:"port"`
						Mtu           string `xml:"mtu"`
						Dns           string `xml:"dns"`
						Tunneladdress string `xml:"tunneladdress"`
						Disableroutes string `xml:"disableroutes"`
						Gateway       string `xml:"gateway"`
						CarpDependOn  string `xml:"carp_depend_on"`
						Peers         string `xml:"peers"`
						Endpoint      string `xml:"endpoint"`
						PeerDns       string `xml:"peer_dns"`
					} `xml:"server"`
				} `xml:"servers"`
			} `xml:"server"`
			General struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Enabled string `xml:"enabled"`
			} `xml:"general"`
			Client struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
				Clients string `xml:"clients"`
			} `xml:"client"`
		} `xml:"wireguard"`
		QemuGuestAgent struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text         string `xml:",chardata"`
				Enabled      string `xml:"Enabled"`
				LogDebug     string `xml:"LogDebug"`
				DisabledRPCs string `xml:"DisabledRPCs"`
			} `xml:"general"`
		} `xml:"QemuGuestAgent"`
		Cron struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			Jobs    string `xml:"jobs"`
		} `xml:"cron"`
		Interfaces struct {
			Text      string `xml:",chardata"`
			Loopbacks struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
			} `xml:"loopbacks"`
			Neighbors struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
			} `xml:"neighbors"`
			Vxlans struct {
				Text    string `xml:",chardata"`
				Version string `xml:"version,attr"`
			} `xml:"vxlans"`
		} `xml:"Interfaces"`
		Gateways struct {
			Text        string `xml:",chardata"`
			Version     string `xml:"version,attr"`
			GatewayItem struct {
				Text           string `xml:",chardata"`
				Uuid           string `xml:"uuid,attr"`
				Disabled       string `xml:"disabled"`
				Name           string `xml:"name"`
				Descr          string `xml:"descr"`
				Interface      string `xml:"interface"`
				Ipprotocol     string `xml:"ipprotocol"`
				Gateway        string `xml:"gateway"`
				Defaultgw      string `xml:"defaultgw"`
				Fargw          string `xml:"fargw"`
				MonitorDisable string `xml:"monitor_disable"`
				MonitorNoroute string `xml:"monitor_noroute"`
				Monitor        string `xml:"monitor"`
				ForceDown      string `xml:"force_down"`
				Priority       string `xml:"priority"`
				Weight         string `xml:"weight"`
				Latencylow     string `xml:"latencylow"`
				Latencyhigh    string `xml:"latencyhigh"`
				Losslow        string `xml:"losslow"`
				Losshigh       string `xml:"losshigh"`
				Interval       string `xml:"interval"`
				TimePeriod     string `xml:"time_period"`
				LossInterval   string `xml:"loss_interval"`
				DataLength     string `xml:"data_length"`
			} `xml:"gateway_item"`
		} `xml:"Gateways"`
		Nginx struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text    string `xml:",chardata"`
				Enabled string `xml:"enabled"`
				BanTtl  string `xml:"ban_ttl"`
			} `xml:"general"`
			Webgui struct {
				Text          string `xml:",chardata"`
				Limitnetworks string `xml:"limitnetworks"`
			} `xml:"webgui"`
			HTTP struct {
				Text                      string `xml:",chardata"`
				Workerprocesses           string `xml:"workerprocesses"`
				Workerconnections         string `xml:"workerconnections"`
				Sendfile                  string `xml:"sendfile"`
				KeepaliveTimeout          string `xml:"keepalive_timeout"`
				ResetTimedout             string `xml:"reset_timedout"`
				DefaultType               string `xml:"default_type"`
				ServerNamesHashBucketSize string `xml:"server_names_hash_bucket_size"`
				ServerNamesHashMaxSize    string `xml:"server_names_hash_max_size"`
				BanResponse               string `xml:"ban_response"`
				LogPermBan                string `xml:"log_perm_ban"`
				BotsUa                    string `xml:"bots_ua"`
				HeadersMoreEnable         string `xml:"headers_more_enable"`
			} `xml:"http"`
		} `xml:"Nginx"`
		Monit struct {
			Text    string `xml:",chardata"`
			Version string `xml:"version,attr"`
			General struct {
				Text                      string `xml:",chardata"`
				Enabled                   string `xml:"enabled"`
				Interval                  string `xml:"interval"`
				Startdelay                string `xml:"startdelay"`
				Mailserver                string `xml:"mailserver"`
				Port                      string `xml:"port"`
				Username                  string `xml:"username"`
				Password                  string `xml:"password"`
				Ssl                       string `xml:"ssl"`
				Sslversion                string `xml:"sslversion"`
				Sslverify                 string `xml:"sslverify"`
				Logfile                   string `xml:"logfile"`
				Statefile                 string `xml:"statefile"`
				EventqueuePath            string `xml:"eventqueuePath"`
				EventqueueSlots           string `xml:"eventqueueSlots"`
				HttpdEnabled              string `xml:"httpdEnabled"`
				HttpdUsername             string `xml:"httpdUsername"`
				HttpdPassword             string `xml:"httpdPassword"`
				HttpdPort                 string `xml:"httpdPort"`
				HttpdAllow                string `xml:"httpdAllow"`
				MmonitUrl                 string `xml:"mmonitUrl"`
				MmonitTimeout             string `xml:"mmonitTimeout"`
				MmonitRegisterCredentials string `xml:"mmonitRegisterCredentials"`
			} `xml:"general"`
			Alert struct {
				Text        string `xml:",chardata"`
				Uuid        string `xml:"uuid,attr"`
				Enabled     string `xml:"enabled"`
				Recipient   string `xml:"recipient"`
				Noton       string `xml:"noton"`
				Events      string `xml:"events"`
				Format      string `xml:"format"`
				Reminder    string `xml:"reminder"`
				Description string `xml:"description"`
			} `xml:"alert"`
			Service []struct {
				Text         string `xml:",chardata"`
				Uuid         string `xml:"uuid,attr"`
				Enabled      string `xml:"enabled"`
				Name         string `xml:"name"`
				Description  string `xml:"description"`
				Type         string `xml:"type"`
				Pidfile      string `xml:"pidfile"`
				Match        string `xml:"match"`
				Path         string `xml:"path"`
				Timeout      string `xml:"timeout"`
				Starttimeout string `xml:"starttimeout"`
				Address      string `xml:"address"`
				Interface    string `xml:"interface"`
				Start        string `xml:"start"`
				Stop         string `xml:"stop"`
				Tests        string `xml:"tests"`
				Depends      string `xml:"depends"`
				Polltime     string `xml:"polltime"`
			} `xml:"service"`
			Test []struct {
				Text      string `xml:",chardata"`
				Uuid      string `xml:"uuid,attr"`
				Name      string `xml:"name"`
				Type      string `xml:"type"`
				Condition string `xml:"condition"`
				Action    string `xml:"action"`
				Path      string `xml:"path"`
			} `xml:"test"`
		} `xml:"monit"`
	} `xml:"OPNsense"`
	Openvpn string `xml:"openvpn"`
	Wol     struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
	} `xml:"wol"`
	Ifgroups struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
	} `xml:"ifgroups"`
	Hasync struct {
		Text            string `xml:",chardata"`
		Version         string `xml:"version,attr"`
		Disablepreempt  string `xml:"disablepreempt"`
		Disconnectppps  string `xml:"disconnectppps"`
		Pfsyncinterface string `xml:"pfsyncinterface"`
		Pfsyncpeerip    string `xml:"pfsyncpeerip"`
		Pfsyncversion   string `xml:"pfsyncversion"`
		Synchronizetoip string `xml:"synchronizetoip"`
		Username        string `xml:"username"`
		Password        string `xml:"password"`
		Syncitems       string `xml:"syncitems"`
	} `xml:"hasync"`
	Laggs struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Lagg    string `xml:"lagg"`
	} `xml:"laggs"`
	Gifs struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Gif     string `xml:"gif"`
	} `xml:"gifs"`
	Vlans struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Vlan    string `xml:"vlan"`
	} `xml:"vlans"`
	Gres struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Gre     string `xml:"gre"`
	} `xml:"gres"`
	Virtualip struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Vip     string `xml:"vip"`
	} `xml:"virtualip"`
	Staticroutes struct {
		Text    string `xml:",chardata"`
		Version string `xml:"version,attr"`
		Route   string `xml:"route"`
	} `xml:"staticroutes"`
	Deciso struct {
		Text  string `xml:",chardata"`
		Proxy struct {
			Text string `xml:",chardata"`
			ACL  struct {
				Text           string `xml:",chardata"`
				Version        string `xml:"version,attr"`
				Policies       string `xml:"policies"`
				CustomPolicies string `xml:"custom_policies"`
			} `xml:"ACL"`
		} `xml:"Proxy"`
	} `xml:"Deciso"`
	Bridges struct {
		Text    string `xml:",chardata"`
		Bridged string `xml:"bridged"`
	} `xml:"bridges"`
	Ppps struct {
		Text string `xml:",chardata"`
		Ppp  string `xml:"ppp"`
	} `xml:"ppps"`
	Wireless struct {
		Text  string `xml:",chardata"`
		Clone string `xml:"clone"`
	} `xml:"wireless"`
	Ca      string `xml:"ca"`
	Dhcpdv6 string `xml:"dhcpdv6"`
	Cert    []struct {
		Text  string `xml:",chardata"`
		Uuid  string `xml:"uuid,attr"`
		Refid string `xml:"refid"`
		Descr string `xml:"descr"`
		Caref string `xml:"caref"`
		Crt   string `xml:"crt"`
		Csr   string `xml:"csr"`
		Prv   string `xml:"prv"`
	} `xml:"cert"`
}

Opnsense xml schema

type SyslogDestination ΒΆ added in v0.0.29

type SyslogDestination struct {
	Text        string `xml:",chardata"`
	Uuid        string `xml:"uuid,attr"`
	Enabled     string `xml:"enabled"`
	Transport   string `xml:"transport"`
	Program     string `xml:"program"`
	Level       string `xml:"level"`
	Facility    string `xml:"facility"`
	Hostname    string `xml:"hostname"`
	Certificate string `xml:"certificate"`
	Port        string `xml:"port"`
	Rfc5424     string `xml:"rfc5424"`
	Description string `xml:"description"`
}

SyslogDestination is a single remote-syslog destination entry as stored in the OPNsense <Syslog><destinations><destination> XML node. It is lifted into a named type so the rsyslog client-config logic and its tests can refer to the destination fields without redeclaring the anonymous struct.

Directories ΒΆ

Path Synopsis
cmd
opnborg command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL