feat(login-auth): how people log in to the firewall, from config.xml (NetOrk/netork#662)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Failing after 18s
driver / types (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Failing after 2m21s
driver / publish (pull_request) Skipped

get_web_login_auth() names the auth servers <system><webgui><authmode> tries,
in order (the Local Database when it names none), each with what it asks for:
password for local, ldap and voucher, password_otp for totp and ldap-totp,
external for radius, unknown otherwise. A name no server has is skipped, as
OPNsense skips it. get_ssh_server_auth() reads <system><ssh> as
openssh_configure_do writes sshd_config: on only with enabled, password and
challenge-response login with passwordauth, root with permitrootlogin, a key
always. An SSH password goes through the same servers (password_sources).
Needs napalm-device-types 4.50.0.
This commit is contained in:
Christian Manivong committed 2026-11-28 08:03:18 +01:00
1 parent 6c1aaf1690
commit 6c612a427b
6 files changed
+405 -1

No files matched your search

+23
View File
@@ -85,6 +85,8 @@ arguments.
| `get_ntp_servers` | ✅ ⁵ | `GET /api/core/backup/download/this`: `<system><timeservers>` of config.xml |
| `get_time_sync` | ✅ ⁵ | `GET /api/core/backup/download/this` (servers, zone) + `GET /api/ntpd/service/status` (system peer) |
| `get_config` | ✅ | `GET /api/core/backup/download/this` (XML) |
| `get_web_login_auth` | ✅ | `GET /api/core/backup/download/this`: the auth servers `<system><webgui><authmode>` names, in order |
| `get_ssh_server_auth` | ✅ | `GET /api/core/backup/download/this`: `<system><ssh>` (on, password, root login) and the same auth servers for an SSH password |
| `get_config_revisions()` | ✅ ⁶ | `GET /api/core/backup/backups/this` |
| `get_config_revision(revision_id)` | ✅ ⁶ | `GET /api/core/backup/download/this/<id>` (XML) |
| `revert_config_revision(revision_id)` | ✅ ⁶ | `POST /api/core/backup/revert_backup/<id>` |
@@ -167,6 +169,27 @@ algorithm lists instead: `SSH_SETTINGS_MENU` is the page's menu path and
OpenSSH's defaults. In an HA pair the configuration sync carries the section to
the backup when its "OpenSSH" item (`ssh`) is ticked.
### How people log in
`get_web_login_auth()` and `get_ssh_server_auth()` say how people log in to the
firewall, in napalm-device-types' shapes (`WebLoginAuthDict`, `SshServerAuthDict`).
NetOrk/netork#662 judges them for MFA. Both read config.xml, because no API controller
reads these settings.
- **Web interface.** `<system><webgui><authmode>` names the auth servers a login is
tried against, in order. Without it, the built-in "Local Database" is used alone. The
first server that accepts the login lets the person in. A name no server has is
skipped, as OPNsense skips it. Each source says what it asks for: `password` (`local`,
`ldap`, `voucher`), `password_otp` (`totp` and `ldap-totp`: the password and a code in
one field, and a user without an OTP seed is refused), `external` (`radius`), or
`unknown` for any other type.
- **SSH.** sshd runs only with `<system><ssh><enabled>` (`server_enabled`).
`passwordauth` switches password and challenge-response login on together, and
`permitrootlogin` lets root in. Each is tested for presence, as OPNsense tests it. A
key is always accepted, and sshd checks it itself. A password goes through the same
auth servers as the web interface (`password_sources`), because OPNsense's `System`
service runs that list for `sshd`, `login`, `su` and `sudo`.
### Time sync
OPNsense keeps the time servers and the zone in config.xml: `<system><timeservers>`,