Commit Graph

64 Commits

Author SHA1 Message Date
Wolfgang Bumiller
f25628d3ef verify_ticket: allow general non-challenge tfa to be run as two step call
This allows for doing OTP TFA in two steps, first login with normal
credentials and get the half-logged-in ticket, then send the OTP
verification for full login, same as with u2f was already possible.

This allows for a nicer UI, as OTP fields can be shown on demand, and
do not need to be visible by default.

The old way of sending the OTP code immediately with the initial
credentials request still works for backward compatibility and as
some API user may prefer it.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-08 14:48:13 +02:00
Wolfgang Bumiller
47d731c731 allow users to change their totp settings
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Wolfgang Bumiller
18f8ba1803 u2f authentication
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Wolfgang Bumiller
9536c4dcd4 delete TFA entries when deleting a user
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Wolfgang Bumiller
2b4c98ab01 u2f api endpoints
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Thomas Lamprecht
b27ae8aa44 api/ticket: move getting cluster name into an eval
to avoid a failed login if a broken corosync config is setup

Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-26 15:49:53 +01:00
Dominik Csapak
0fea3f1677 fix #1998: correct return properties for read_role
we have each privilege as property of the return object,
so we generate it from $valid_privs

this has the advantage that all privileges are well documented
with that api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-23 14:21:03 +01:00
Thomas Lamprecht
e842fec5e0 fix #233: return cluster name on successful login
If a cluster is configured then return the cluster name on successful
login - if the user has Sys.Audit privileges on the '/' path (same
as for returning cluster info, like the join info path uses)

This is more for the reason that some admins do not want to expose
this to lesser privileged (API) users. While yes, you can
theoretically launch a (DDOS resembling) attack which stresses the
corosync network if you know the cluster_name (it's still encrypted
but you can back-calculate the multicast group membership info) you
need to be able to send multicast traffic on the corosync LAN -
which can be seen as a pretty big privilege anyway.

But, for now reduce permissions - we can more easily loosen them than
tighten without causing issues anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-13 11:58:05 +01:00
Dietmar Maurer
af5d7da7f1 Revert "Add title and print_width fields to properties"
This reverts commit bcf4eb3d49.
I think those titles does not add any value.
2018-08-03 10:45:13 +02:00
Stoiko Ivanov
bcf4eb3d49 Add title and print_width fields to properties
Used for printing in pveum

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-27 16:40:55 +02:00
Stoiko Ivanov
3a5ae7a0e6 refactor API using get/register_standard_option
Pull out duplicated property definitions in the API into
register_standard_option/get_standard_option calls.
(All parameters, which are thus added to the API calls were optional).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-27 16:40:55 +02:00
Dominik Csapak
765305e210 fix typo in change_passsword
s/passsword/password/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-12 15:07:27 +02:00
Thomas Lamprecht
f584808972 compute_api_permissions: a storage has also permissions
Fixes a problem where a non root@pam system administrator does not
sees the 'Permissions' tab for a storage in our WebUI.

Fixes commit a2c18811d3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-18 13:32:11 +01:00
Wolfgang Bumiller
186a4e15b6 style fix 2017-09-22 08:53:30 +02:00
Wolfgang Bumiller
e41cc73c52 api: check for special roles before locking the usercfg 2017-09-22 08:52:55 +02:00
Philip Abernethy
0a6e09fd47 Whitespace fixes
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-22 08:38:50 +02:00
Philip Abernethy
5654af83fa Remove unused Dumper uses
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-22 08:38:48 +02:00
Philip Abernethy
894e6f0c4b fix #1501: pveum: die when deleting special role
Die with a helpful error message instead of silently ignoring the user
when trying to delete a special role.
Also add a property to the API answer for possible later use by the
WebUI.

Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-22 08:38:21 +02:00
Wolfgang Bumiller
36dd9dbdb3 fix another typo 2017-09-21 10:19:27 +02:00
Thomas Lamprecht
14658ad8ba api: fix typo in 'GET ticket' description
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-21 09:13:34 +02:00
Thomas Lamprecht
a2c18811d3 API/ticket: rework coarse grained permission computation
We accessed methods from PVE::Storage here but did not define a
"use PVE::Storage". This thus only worked if modules if the
PVE::Storage module got pulled in by something else, by luck.
Simply including said use statement is not an option because
pve-storage is already dependent from pve-access-control, and we want
to avoid cyclic dependencies, especially on the perl module level.

The reason the offending module was used in the first place here
stems from the way how this coarse grained permissions are
calculated.
We check all permission object paths for privileges for an user.
So we got all vmids and all storage ids and computed paths from them.
This works, but is overkill and led to this "illegal" module use.

Instead I opt to not generating all possible paths, but just check
the ones configured plus a small required static set of top level
paths - this allows to generalize handling of the special root@pam
and "normal" users.

It has to be noted that this method is in general just intended for a
coarse capability check to allow hiding a few UI elements which are
not generated by backend calls (which are already permission aware).
The real checks get done by each backend call, automatically for
simple ones and semi-automatically for complex ones.
2017-09-20 09:33:39 +02:00
Dietmar Maurer
52b2eff3c5 PVE/API2/Domains.pm: fix property description 2017-01-11 12:11:01 +01:00
Dietmar Maurer
3e5bfdf60f pveum: implement bash completion hooks 2015-10-01 17:22:09 +02:00
Dietmar Maurer
30be0de97a allow to write builtin auth domains
So that we can set tfa, comment, default with the GUI.
2014-07-18 11:30:19 +02:00
Dietmar Maurer
1abc2c0aee add oath two factor auth, bump version to 3.0-14 2014-07-17 14:04:13 +02:00
Dietmar Maurer
96f8ebd625 add basic support for two factor auth 2014-06-23 11:42:44 +02:00
Dietmar Maurer
39e4e36348 add dummy API for login page 2014-04-30 14:45:57 +02:00
Dietmar Maurer
fe2defd9d5 return correct 401 status code for unauthorized calls
New HTTP::Server will delay the call by 3 seconds.
2013-11-18 11:25:32 +01:00
Dietmar Maurer
6126ab75a0 prevent user enumeration attacks 2013-11-18 09:05:04 +01:00
Dietmar Maurer
437be042c2 correctly compute GUI capabilities (consider pools) 2012-05-30 08:47:43 +02:00
Dietmar Maurer
5bb4e06a64 new plugin architecture for Auth modules 2012-05-22 10:43:30 +02:00
Dietmar Maurer
dd2cfee072 return set of privileges on login - can be used to adopt GUI 2012-04-17 10:26:48 +02:00
Dietmar Maurer
e2993b66c3 set propagate flag by default 2012-03-01 12:38:46 +01:00
Dietmar Maurer
4384e19e9b fix return value for empty ACL list 2012-02-10 11:25:23 +01:00
Dietmar Maurer
59321f2682 do not allow to change system user passwords 2012-02-09 11:26:37 +01:00
Dietmar Maurer
f3957883eb moved Pool.pm to pve-manager package 2012-01-27 08:44:22 +01:00
Dietmar Maurer
82b63965eb cleanup permission checks
Added new Real.AllocateUser priviledge
2012-01-27 08:34:12 +01:00
Dietmar Maurer
8de1fb5ae3 code cleanup 2012-01-26 14:02:25 +01:00
Dietmar Maurer
9a53427a8e fix return format 2012-01-26 13:47:07 +01:00
Dietmar Maurer
cab28ea50b code cleanup 2012-01-26 13:35:33 +01:00
Dietmar Maurer
399932c682 return array instead of hash 2012-01-26 13:02:07 +01:00
Dietmar Maurer
39c85db819 add pool API 2012-01-26 12:42:01 +01:00
Dietmar Maurer
7b6f1fd306 remove debug message 2012-01-26 09:54:56 +01:00
Dietmar Maurer
fc21a5c220 add description 2012-01-26 08:31:27 +01:00
Dietmar Maurer
19f60b5e3c use User.Allocate instead of User.Add/User.Delete 2012-01-26 08:26:31 +01:00
Dietmar Maurer
e3a3a0d746 implement helper to check if we can modify permission 2012-01-26 08:25:16 +01:00
Dietmar Maurer
4bc17477d8 start pool support, return NoAccess role, fix acl cache 2012-01-25 14:32:12 +01:00
Dietmar Maurer
9691923469 fix access control 2012-01-24 11:50:41 +01:00
Dietmar Maurer
12683df7c4 use new syntax for permission checks
And use better names for user priviledges.
2012-01-23 12:14:45 +01:00
Dietmar Maurer
b9180ed235 simplify filter_groups 2012-01-23 09:58:03 +01:00