Link to API
It's in the API since January 2025, but unfortunately not listed in their docs.
API endpoints: https://docs.opnsense.org/development/api/core/firewall.html
Model definition (source): https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.xml
Commit that added it: opnsense/core@8d26447
Description
Feature Request: Add authtype, username, password support to alias module
Since OPNsense 25.1 (commit 8d26447, January 24 2025), the Alias model supports optional
authentication for URL-type aliases (urltable and urljson). This is available in the GUI under Firewall → Aliases when creating/editing a URL Table alias.
Three fields were added to the Alias model:
| Field |
Type |
Values |
authtype |
OptionField |
Basic, Bearer, Header |
username |
TextField |
|
password |
TextField |
|
These fields are accessible through the OPNsense API at /api/firewall/alias/add_item and
/api/firewall/alias/set_item (the controller extends ApiMutableModelControllerBase, so all model fields are exposed automatically). However, the oxlorg.opnsense Ansible
collection does not yet expose them in the alias / alias_multi modules.
Request: Add support for authtype, username, and password parameters to the alias module.
Use case: We serve dynamically generated IP lists from a web application, protected with Bearer token authentication. We'd like to configure OPNsense URL Table aliases
pointing to these lists — including the auth header — entirely via Ansible, rather than having to manually set the auth fields in the GUI.
Link to API
It's in the API since January 2025, but unfortunately not listed in their docs.
API endpoints: https://docs.opnsense.org/development/api/core/firewall.html
Model definition (source): https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.xml
Commit that added it: opnsense/core@8d26447
Description
Feature Request: Add
authtype,username,passwordsupport to alias moduleSince OPNsense 25.1 (commit
8d26447, January 24 2025), the Alias model supports optionalauthentication for URL-type aliases (
urltableandurljson). This is available in the GUI under Firewall → Aliases when creating/editing a URL Table alias.Three fields were added to the Alias model:
authtypeBasic,Bearer,HeaderusernamepasswordThese fields are accessible through the OPNsense API at
/api/firewall/alias/add_itemand/api/firewall/alias/set_item(the controller extendsApiMutableModelControllerBase, so all model fields are exposed automatically). However, theoxlorg.opnsenseAnsiblecollection does not yet expose them in the
alias/alias_multimodules.Request: Add support for
authtype,username, andpasswordparameters to the alias module.Use case: We serve dynamically generated IP lists from a web application, protected with Bearer token authentication. We'd like to configure OPNsense URL Table aliases
pointing to these lists — including the auth header — entirely via Ansible, rather than having to manually set the auth fields in the GUI.