Skip to content

dns/bind: add HTTPS record type support#5425

Open
mbedworth wants to merge 2 commits into
opnsense:masterfrom
mbedworth:bind-https-record-type
Open

dns/bind: add HTTPS record type support#5425
mbedworth wants to merge 2 commits into
opnsense:masterfrom
mbedworth:bind-https-record-type

Conversation

@mbedworth
Copy link
Copy Markdown
Contributor

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used: n/a
  • Extent of AI involvement: AI assistance was used for code review and testing.

Describe the problem

The BIND record model (Record.xml) does not include HTTPS as a valid record type, making it impossible to add HTTPS/SVCB resource records (RFC 9460) through the plugin GUI or API. BIND 9.18+ supports HTTPS records natively in zone files, but the OPNsense validation layer rejects the type before it reaches named.


Describe the proposed solution

Add HTTPS to the OptionValues list in models/OPNsense/Bind/Record.xml. This is a one-line change that follows the same pattern as the existing record types (SRV, TLSA, etc.).

HTTPS records (RFC 9460) are used for service binding and parameter discovery. A common use case is advertising DoH endpoints with their path and ALPN parameters so RFC 9460-aware clients can discover them automatically, for example:

doh.example.com.  IN HTTPS  1 .  alpn="h2"  dohpath="/dns-query{?dns}"

The zone file template already emits records generically as name type value, so no template changes are required — only the model validation needs updating.

Testing

Tested on OPNsense 26.1 with BIND 9.20:

  • GUI: HTTPS type appears in the record type dropdown after the model is deployed
  • API: addRecord with "type": "HTTPS" returns {"result":"saved"} and the record is written to config.xml
  • Zone file: template correctly renders name HTTPS value in the zone file
  • Resolution: dig TYPE65 returns NOERROR with the correct SvcParams after a zone reload

Fix critical syntax error in opnsense-fw active response script that prevents IPs from being added to the __wazuh_agent_drop alias.

## Problem
The script contains invalid Python syntax - a variable assignment inside a dictionary literal:
```python
"parameters":{
   unique_key = "%s-%s" % (...)  # Invalid Python syntax
   "keys": [unique_key]
}
```

This causes the script to fail with a SyntaxError on all 'add' commands, meaning attacking IPs are never blocked.

## Changes
- Move unique_key assignment outside dictionary literal (fixes SyntaxError)
- Fix typo: 'even' -> 'event' in error message
- Add debug logging for easier troubleshooting

## Testing
- Verified syntax with `python3 -m py_compile`
- Tested active response add/delete operations on OPNsense 26.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant