- Run cargo fmt across opnsense-api, opnsense-config, opnsense-codegen (fixes formatting in generated files and hand-written modules) - Update examples/opnsense/README.md: replace stale VirtualBox docs with current API key + cargo run instructions - Update examples/opnsense_vm_integration/README.md: document idempotency test (run twice, assert zero duplicates), add build/opnsense-e2e.sh usage instructions
838 B
838 B
OPNsense Basic Example
Demonstrates connecting to an existing OPNsense firewall and running Harmony Scores against it.
Prerequisites
- An OPNsense firewall accessible via SSH and REST API
- API key + secret created in OPNsense (System > Access > Users > API keys)
Usage
# Set credentials (or use env.sh)
export OPNSENSE_API_KEY=your_key
export OPNSENSE_API_SECRET=your_secret
# Run against a specific OPNsense host
cargo run -p example-opnsense -- 192.168.1.1
Scores applied
| Score | What it configures |
|---|---|
DhcpScore |
DHCP range and static host bindings via dnsmasq |
For automated VM-based testing
See examples/opnsense_vm_integration/ which boots a fresh OPNsense VM via KVM, runs 11 Scores, and verifies idempotency automatically.