Commit Graph

15 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
Joe Cooper
308cb0c71d perlcritic test and fixes 2026-05-19 19:53:15 -05:00
iliajie
d0ed6f944e Fix pointless warnings flooding error log 2022-06-30 13:08:38 +03:00
Jamie Cameron
9aab0547d0 Fix unitialized warning 2014-02-17 17:59:32 -08:00
Jamie Cameron
de136393c9 strict conversion 2013-12-17 23:25:05 -08:00
Joe Cooper
eb1cc6842d ui_link conversion 2013-12-15 16:54:10 -06:00
Jamie Cameron
367b2657cc Fetch specific user / group from LDAP where needed 2010-09-19 22:13:15 -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
faa9438689 User DB user modification 2010-09-11 19:57:03 -07:00
Jamie Cameron
35cb7a2c96 More work on user DB support 2010-09-09 21:56:22 -07:00
Jamie Cameron
ab14bf5e15 Fix group ACL editing 2009-04-08 17:09:45 +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
30ba7bb540 Fixed global ACL editing for groups 2007-12-03 22:59:36 +00:00
Jamie Cameron
bd219c7b01 Finished off password quality and expiry options 2007-09-13 21:40:09 +00:00
Jamie Cameron
fc1c1b243f Initial checkin of Webmin 2007-04-12 20:24:50 +00:00