Part of NetOrk/netork#662 (NIS2 Art. 21(2)(j): MFA on the managed systems). The OPNsense step was NetOrk/netork#2827; this is the reader for Proxmox VE and PBS.
What it adds
get_web_login_auth() on both drivers, in napalm-device-types' WebLoginAuthDict (4.50.0):
One source per realm with someone who can log in, by realm name (name = realm, kind = realm type).
password_otp when the PVE realm's own tfa is set (oath/yubico; PVE then refuses a user without a second factor, "missing required 2nd keys"), or when every enabled, unexpired user of the realm has an enabled second factor in /access/tfa (TOTP, WebAuthn, U2F, Yubico, recovery keys).
password when one such user has none -- often root@pam.
external for OpenID (its provider decides), unknown for a realm type the driver does not know.
Disabled or expired accounts do not count; a password realm without anyone who can log in is no source. API tokens skip TFA by design and are not web logins.
Privilege check
Neither server refuses /access/users or /access/tfa to a login that may not see other users: both answer with the caller alone. A reading from such a token would judge the server by one account and could pass. So the driver checks /access/permissions first and raises PermissionError without:
PVE: Sys.Audit or User.Modify on /access/groups (PVEAuditor on / has it),
PBS: Sys.Audit on /access/users (Audit on / has it).
Also
Version 0.20.0 (0.19.0 is #81), needs napalm-device-types >= 4.50.0.
tests/pbs_fake.py: the fake's path argument is positional-only, so a query parameter named path (/access/permissions?path=...) reaches the fake as proxmoxer passes it.
Tests: tests/test_web_login.py, answers shaped after the API schema of pve-access-control and proxmox-backup; full suite 797 passed locally, ruff and mypy clean.
Part of NetOrk/netork#662 (NIS2 Art. 21(2)(j): MFA on the managed systems). The OPNsense step was NetOrk/netork#2827; this is the reader for Proxmox VE and PBS.
## What it adds
`get_web_login_auth()` on both drivers, in napalm-device-types' `WebLoginAuthDict` (4.50.0):
- One source per realm with someone who can log in, by realm name (`name` = realm, `kind` = realm type).
- `password_otp` when the PVE realm's own `tfa` is set (`oath`/`yubico`; PVE then refuses a user without a second factor, "missing required 2nd keys"), or when every enabled, unexpired user of the realm has an enabled second factor in `/access/tfa` (TOTP, WebAuthn, U2F, Yubico, recovery keys).
- `password` when one such user has none -- often `root@pam`.
- `external` for OpenID (its provider decides), `unknown` for a realm type the driver does not know.
- Disabled or expired accounts do not count; a password realm without anyone who can log in is no source. API tokens skip TFA by design and are not web logins.
## Privilege check
Neither server refuses `/access/users` or `/access/tfa` to a login that may not see other users: both answer with the caller alone. A reading from such a token would judge the server by one account and could pass. So the driver checks `/access/permissions` first and raises `PermissionError` without:
- PVE: `Sys.Audit` or `User.Modify` on `/access/groups` (`PVEAuditor` on `/` has it),
- PBS: `Sys.Audit` on `/access/users` (`Audit` on `/` has it).
## Also
- Version 0.20.0 (0.19.0 is #81), needs napalm-device-types >= 4.50.0.
- `tests/pbs_fake.py`: the fake's `path` argument is positional-only, so a query parameter named `path` (`/access/permissions?path=...`) reaches the fake as proxmoxer passes it.
- Tests: `tests/test_web_login.py`, answers shaped after the API schema of pve-access-control and proxmox-backup; full suite 797 passed locally, ruff and mypy clean.
A Proxmox login names its realm, so each realm with someone who can log in
is a source of napalm-device-types' WebLoginAuthDict. It asks for a password
and a one-time code when the PVE realm's own tfa is set, or when every
enabled, unexpired user of it has an enabled second factor (/access/tfa);
a password alone when one user has none; OpenID is external.
Both servers list only the caller in /access/users and /access/tfa when the
login may not see the others, so the driver checks /access/permissions
first: Sys.Audit or User.Modify on /access/groups on PVE, Sys.Audit on
/access/users on PBS. Without it the read raises PermissionError rather
than judge the server by one account.
Needs napalm-device-types 4.50.0.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of NetOrk/netork#662 (NIS2 Art. 21(2)(j): MFA on the managed systems). The OPNsense step was NetOrk/netork#2827; this is the reader for Proxmox VE and PBS.
What it adds
get_web_login_auth()on both drivers, in napalm-device-types'WebLoginAuthDict(4.50.0):name= realm,kind= realm type).password_otpwhen the PVE realm's owntfais set (oath/yubico; PVE then refuses a user without a second factor, "missing required 2nd keys"), or when every enabled, unexpired user of the realm has an enabled second factor in/access/tfa(TOTP, WebAuthn, U2F, Yubico, recovery keys).passwordwhen one such user has none -- oftenroot@pam.externalfor OpenID (its provider decides),unknownfor a realm type the driver does not know.Privilege check
Neither server refuses
/access/usersor/access/tfato a login that may not see other users: both answer with the caller alone. A reading from such a token would judge the server by one account and could pass. So the driver checks/access/permissionsfirst and raisesPermissionErrorwithout:Sys.AuditorUser.Modifyon/access/groups(PVEAuditoron/has it),Sys.Auditon/access/users(Auditon/has it).Also
tests/pbs_fake.py: the fake'spathargument is positional-only, so a query parameter namedpath(/access/permissions?path=...) reaches the fake as proxmoxer passes it.tests/test_web_login.py, answers shaped after the API schema of pve-access-control and proxmox-backup; full suite 797 passed locally, ruff and mypy clean.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.