Commit Graph

14 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
c57711a3b5 Add missing ACL check
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-10-10 16:01:11 -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
iliajie
d0ed6f944e Fix pointless warnings flooding error log 2022-06-30 13:08:38 +03:00
Jamie Cameron
44a1e87d73 German translation updates from Raymond Vetter 2013-12-19 14:39:24 -08: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
71d3162895 Group modification support 2010-09-11 12:11:59 -07:00
Jamie Cameron
35cb7a2c96 More work on user DB support 2010-09-09 21:56:22 -07:00
Jamie Cameron
501668f18f Remove useless %in export 2009-03-06 19:11:34 +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
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