Commit Graph

43 Commits

Author SHA1 Message Date
Ilia Ross
04b47e5815 Add API-only access for Webmin accounts
This PR adds an `api_only` global permission that restricts a Webmin account to one supported API endpoint, such as virtual-server/remote.cgi.

External integrations need credentials that can call an API without also granting access to the Webmin interface or generic RPC. Existing module permissions do not provide this endpoint-level restriction. The new setting allows administrators to create dedicated integration accounts while Webmin continues performing authorized operations through its privileged backend.

The restriction is enforced in two places:
- MiniServ checks the authenticated account's policy before dispatching CGI, static-file, DAV, or WebSocket requests. Requests outside the configured endpoint receive HTTP 403.
- `init_config` requires the permitted CGI to explicitly opt in before initialization. This also protects Webmin-initializing CGIs hosted by another web server.

Generic RPC is denied for API-only accounts, even when an existing RPC permission would otherwise allow it. The endpoint's own module and operation permissions still apply. Selecting an endpoint does not grant permission to execute every API command.

Webmin Users gains an API-only setting for users and groups. Existing restrictions survive ordinary edits, resets, copies, cloning, renaming, group propagation, and cluster synchronization. Clearing a restriction requires an explicit permission edit. Group updates preserve restrictions already assigned to individual members.

MiniServ reads the policy on each request from the account's existing storage backend: local files, MySQL, PostgreSQL, or LDAP. Policy-read errors deny access instead of treating the account as unrestricted.

Validation passed with the four separately submitted supporting fixes (#2897, #2898, #2899, #2900) ,applied: 169 focused tests, syntax checks, and live Debian tests using file-backed and PostgreSQL accounts. Live checks covered account creation, lifecycle operations, both CGI modes, sessions, RPC, static files, DAV, and WebSockets.

The supporting fixes remain separate PRs. This API-only branch currently has seven lifecycle test failures that depend on the file-cache and group ACL cleanup fixes landing.
2026-10-23 22:06:12 +02:00
Jamie Cameron
616547c26f Protect against creation of root-capable RPC users 2026-10-11 19:05:06 -07:00
Jamie Cameron
d78dcb7625 Safer to match A-Z and a-z separately
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
2026-09-27 20:30:59 -07:00
Joe Cooper
844b5f8174 Exclude ProhibitLeadingZeros from perlcritic, use .perlcriticrc 2026-05-19 20:40:29 -05:00
Joe Cooper
308cb0c71d perlcritic test and fixes 2026-05-19 19:53:15 -05:00
Jamie Cameron
d41377983e Move the option that controls if a user can accept RPC calls out of the global ACL and into a more findable location in the Edit User page 2026-05-16 12:16:29 -07:00
Jamie Cameron
ccbe7369dd Delete all RBAC-related code from the Webmin Users module, since this is a niche unsupported feature 2026-05-16 12:02:58 -07:00
Jamie Cameron
dd4e3e22ef Allow global permissions to be set for new users 2026-05-15 16:43:29 -07:00
Jamie Cameron
ff742eddc1 Add ability for the master admin to send forgotten password reset links 2025-05-04 15:54:08 -07:00
Jamie Cameron
c191caf04b Add a Webmin user field for email address 2025-04-08 20:58:28 -07:00
iliajie
cc591c3e91 Add ability to set locale in Webmin Users module for consistency 2023-03-17 17:23:54 +02:00
iliajie
d0ed6f944e Fix pointless warnings flooding error log 2022-06-30 13:08:38 +03:00
Jamie Cameron
04b95f4dc8 Safe mode is for Unix users only 2019-12-15 07:17:15 -08:00
Jamie Cameron
192b3504ce Safe mode users cannot edit configs 2019-12-08 08:29:36 -08:00
Jamie Cameron
c1c9daa212 Fix perl warnings and add option to exit safe mode 2019-12-08 02:54:14 -08:00
Jamie Cameron
2075fffe70 Work on safe-mode user creation 2019-12-07 08:03:34 -08:00
Jamie Cameron
55ceda8b10 Refresh modules after changing 2018-10-10 19:13:10 +00:00
Jamie Cameron
c2d4a90639 escape some params 2017-06-12 14:12:39 -07:00
Jamie Cameron
be386e8840 Preserve twofactor settings when saving user https://github.com/webmin/webmin/issues/235 2015-10-23 16:03:45 -07:00
Jamie Cameron
393ea7fbb1 Fix check for denying access to self to this module https://sourceforge.net/p/webadmin/bugs/4438/ 2014-06-27 18:48:23 -07:00
Jamie Cameron
85c289cc1d Use simple function to get group 2014-02-22 21:19:33 -08:00
Jamie Cameron
b916a970a9 Remove ancient support for user 'risk levels' 2013-12-20 14:49:25 -08:00
Jamie Cameron
44bdca0273 strict conversion 2013-12-20 14:40:36 -08:00
Jamie Cameron
36da812f76 UI to setup twofactor for another user 2013-09-30 16:24:51 -07:00
Jamie Cameron
4ec798e1bc More work on two-factor support, including new API for provider UI 2013-09-29 12:25:20 -07:00
Jamie Cameron
7b95e948a3 Two-factor disenroll button, other fixes for authy support 2013-09-28 11:42:58 -07:00
Jamie Cameron
b91db8bcc4 Move check for force change support before actually updating the user 2010-10-24 11:55:59 -07:00
Jamie Cameron
367b2657cc Fetch specific user / group from LDAP where needed 2010-09-19 22:13:15 -07:00
Jamie Cameron
0feb834909 Use faster functions to get specific users and groups 2010-09-19 18:06:54 -07:00
Jamie Cameron
8fa35e76cd More work on editing ACLs for users and groups in the DB 2010-09-12 17:30:24 -07:00
Jamie Cameron
71d3162895 Group modification support 2010-09-11 12:11:59 -07:00
Jamie Cameron
5f67cd3637 Move password check before modifying group 2009-10-15 14:14:33 -07:00
Jamie Cameron
bc10057b6e Fail if password change prompt is checked but won't work 2009-08-24 21:13:39 -07:00
Jamie Cameron
501668f18f Remove useless %in export 2009-03-06 19:11:34 +00:00
Jamie Cameron
a7950968fc Don't log hashed password 2009-01-08 18:49:23 +00:00
Jamie Cameron
b431633c46 More work on overlay themes 2008-12-18 01:01:47 +00:00
Jamie Cameron
af4476ba01 Removing hiding buttons, move global acl settings to edit user / group pages 2008-12-10 01:30:47 +00:00
Jamie Cameron
ee997485ff Support for temporary passwords which must be changed at the next login 2008-03-20 17:51:05 +00:00
Jamie Cameron
21fbbd24e6 Allow users to be opted out of password expiry 2008-02-13 22:24:31 +00:00
Jamie Cameron
36382a3bfa Fixed min length 2008-01-10 20:09:56 +00:00
Jamie Cameron
139ecddb41 More work on password quality restrictions 2007-09-13 06:33:10 +00:00
Jamie Cameron
fc304d7f5b Converted user form to ui-lib.pl and added section, added more logging 2007-09-13 00:50:45 +00:00
Jamie Cameron
fc1c1b243f Initial checkin of Webmin 2007-04-12 20:24:50 +00:00