Commit Graph

129 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
Ilia Ross
0f71dac9cf Fix one-time login session keys
This patch fixes a regression from [42850e579](https://github.com/webmin/webmin/commit/42850e579).

That commit stopped miniserv from accepting raw session keys, but these helpers still stored them that way. They now store hashed keys, so one-time login links work again.
2026-10-11 15:16:04 +02:00
Ilia Ross
94436938d0 Fix newline injection in Webmin user records 2026-10-02 03:21:58 +02:00
Ilia Ross
eadd47e886 Fix to replace with block eval 2026-07-07 23:45:03 +02:00
Ilia Ross
c8fb79016c Fix ACL session lookups for HMAC session keys
ⓘ Load Miniserv’s session HMAC key in ACL session helpers so session listing, lookup, and user switching continue to work with HMAC-hashed session DB keys.

https://forum.virtualmin.com/t/usermin-2-550-login-from-the-virtualmin-edit-users-page-stopped-working/137491/37?u=ilia
2026-07-07 23:33:18 +02:00
Ilia Ross
de57c42f4a Fix to update nested group module access in parent order
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
2026-06-14 16:14:21 +02:00
Ilia Ross
ce998ac478 Add module access helpers 2026-06-14 16:00:41 +02:00
Joe Cooper
308cb0c71d perlcritic test and fixes 2026-05-19 19:53:15 -05:00
Joe Cooper
8c2541fdc8 s/return undef/return/ 2026-05-19 15:43:45 -05:00
Joe Cooper
ef49236f6a Fixes minor bugs surfaced by tests 2026-05-19 15:13:33 -05: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
Ilia Ross
c85128bb4d Fix to fit in width 2025-05-26 19:50:48 +03:00
Ilia Ross
5d83d4040f Add support for showing gender-neutral translations
https://github.com/webmin/webmin/discussions/2482
https://forum.virtualmin.com/t/on-the-rejection-of-gender-neutral-language/133527

833292c0d1

fe064dd57d

4a19a6460b
2025-05-26 16:46:09 +03:00
Jamie Cameron
c126e9f93e Allow sessions to have a max lifetime 2025-05-19 22:17:59 -07:00
Jamie Cameron
d0f31831b6 Extract out functions for re-use 2025-05-04 15:39:37 -07:00
Ilia Ross
b2626ca9c1 Fix to default to useradmin module even for anon user 2025-04-24 10:24:17 +03:00
Jamie Cameron
c191caf04b Add a Webmin user field for email address 2025-04-08 20:58:28 -07:00
Ilia Ross
45419c38b5 Fix not to show link if nothing to do 2025-02-27 00:14:12 +02:00
Jamie Cameron
764533a6e5 Don't add hashed password to the old password list if it's already in there https://github.com/virtualmin/virtualmin-pro/issues/35 2023-03-29 17:27:01 -07:00
iliajie
809458e82a Add support to select locale in Change Language and Theme Webmin module 2023-02-05 00:40:10 +02:00
iliajie
29354389f4 Fix to test if anonymous user actually exists 2022-12-26 12:51:10 +02:00
iliajie
c3bd222492 Fix wording 2022-12-26 12:22:20 +02:00
Jamie Cameron
459a5ee6b8 Fix bug in granting anonymous access if the anonymous user doesn't exist yet 2022-12-23 15:49:53 -08:00
iliajie
d0ed6f944e Fix pointless warnings flooding error log 2022-06-30 13:08:38 +03:00
Jamie Cameron
6be052cdc9 Merge pull request #1654 from webmin/dev/set-webmin-to-use-system-default-hashing
Add Webmin to support system default hashing format
2022-06-03 16:26:40 -07:00
Ilia
d598c43371 Disable subroutine redefined warnings to prevent log polution 2022-06-02 15:28:14 +03:00
Ilia
56660dc4f2 Fix flag type 2022-05-31 23:18:35 +03:00
Ilia
4028399d4c Fix to force system detection hashing format 2022-05-29 14:32:05 +03:00
Ilia
3b850af7c0 Add Webmin to support system default hashing format 2022-05-29 12:58:16 +03:00
Jamie Cameron
5ca4ed73b2 Password never contains newlines 2022-01-11 20:36:19 -08:00
Ilia Rostovtsev
3ac1cfec61 Fix an error use of uninitialized value $user in concatenation 2021-12-01 12:48:14 +03:00
Jamie Cameron
58b5844765 Add documentation URL and fix locking 2021-08-05 12:13:01 -07:00
Jamie Cameron
5b0bc3c30f UI to enable password change API 2021-08-01 13:04:33 -07:00
Jamie Cameron
3233d9264a Fix perl warning 2021-07-02 18:27:49 -07:00
Jamie Cameron
383b26c28a Support for session login redirect in miniserv 2021-05-28 20:50:26 -07:00
Jamie Cameron
1152c6b792 Function to create a miniserv session 2021-05-28 13:34:03 -07:00
Jamie Cameron
db1106ec73 Respect salt format if one was given 2020-11-12 22:24:21 -08:00
Jamie Cameron
ef4b35f7ee Fix perl warning 2020-05-07 23:21:35 -07:00
Ilia Rostovtsev
75ed5b1466 Add an option to include ".auto" files 2020-03-17 18:10:43 +03:00
Jamie Cameron
2075fffe70 Work on safe-mode user creation 2019-12-07 08:03:34 -08:00
Jamie Cameron
98dd2c0a11 Don't record old passwords which are locks 2019-12-03 00:19:24 -08:00
Jamie Cameron
ce196d6b8b Extra protection against creating a user called 'webmin' https://www.virtualmin.com/node/65058 2019-03-17 18:39:49 -07:00
Jamie Cameron
02bf68c182 Fix perl warning 00~http/www.virtualmin.com/node/58643 2018-09-04 20:27:18 -07:00
Jamie Cameron
9eef590d0f Remove un-necessary MD5 check https://github.com/webmin/webmin/issues/942#issuecomment-406822456 2018-07-22 12:13:52 -07:00
Jamie Cameron
bfaa5ba983 More gracefully handle missing MD5 module 2018-05-25 16:11:03 -07:00
Jamie Cameron
19f8f74d85 Use consistent API to check for dictionary words, rather than the ispell command 2018-03-07 15:24:19 -08:00
Jamie Cameron
38732d0297 Fix perl warning https://www.virtualmin.com/node/55982 2018-02-20 21:22:33 -08:00
Jamie Cameron
c651160844 Added support for SHA512 passwords https://github.com/webmin/webmin/issues/798 2018-02-04 14:17:48 -08:00
yangfl
0f9fb77369 Fix typo 2017-11-08 16:43:37 +08:00
Jamie Cameron
bdb22b37dc Fix perl warnings https://sourceforge.net/p/webadmin/bugs/4907/ 2017-02-26 14:11:32 -08:00