Commit Graph

271 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
Thomas Lamprecht
a270d4e167 bump version to 5.1-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 13:41:20 +02:00
Thomas Lamprecht
0db7870be0 d/control: bump version dependency for pve-cluster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 13:37:57 +02:00
Thomas Lamprecht
49b15310ac followup: s/CUSTOM_TFA_TYPES/USER_CONTROLLED_TFA_TYPES/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 13:34:23 +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
9401be39cb use a property string for tfa config
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
Wolfgang Bumiller
cce4903b61 depend on libpve-u2f-server-perl
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Wolfgang Bumiller
fda8ca85d3 more general 2FA configuration via priv/tfa.cfg
Adds a priv/tfa.cfg file usable in place of user.cfg.
(Otherwise the user.cfg can potentially grow too big with
u2f keys.)

Also contains some preparation code for u2f and
user-opt-in totp.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 08:04:00 +02:00
Thomas Lamprecht
e235ae3903 buildsys: cleanup and add target to build DSC
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-02 11:36:13 +02:00
Thomas Lamprecht
374647e8cd bump version to 5.1-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-18 10:43:25 +01:00
Dominik Csapak
5efff6c196 fix vnc ticket verification without authkey lifetime
since $authkey_lifetime is currently set to 0, we have to check this,
else we always fail to verify the VNC ticket

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-18 10:40:51 +01:00
Thomas Lamprecht
7fb70c9421 bump version to 5.1-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-18 09:35:09 +01:00
Thomas Lamprecht
4b602eed28 d/control: bump version dependency to pve-cluster
to ensure that cfs_lock_authkey is available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-14 11:18:43 +01:00
Thomas Lamprecht
f7282aee6b fixup: touch date format does not understands abbreviations
this did not worked as touch did not worked with the abbreviated 'h'
for 'hour' or 'hours'

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-14 11:18:43 +01:00
Fabian Grünbichler
3a98190257 add postinst script
to reset auth key age until the first rotation has happened, otherwise
all currently existing tickets get invalidated immediately once the
rotation code gets enabled.

disabled until first PVE 6.0 package release

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-03-14 11:18:43 +01:00
Thomas Lamprecht
03593f3d01 fixup call to cfs_lock_authkey
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-14 11:18:43 +01:00
Fabian Grünbichler
21800a71a7 fix #2079: add periodic auth key rotation
and modify checks to accept still valid tickets generated using the
previous auth key.

the slightly complicated caching mechanism is needed for reading the key and
its modification timestamp in one go while only reading and parsing it again if
it has changed.

the +- 300 seconds fuzzing is kept for slightly out-of-sync clusters, since the
time encoded in the tickets is the result of time() on whichever node the
ticket API call got forwarded to.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-03-14 10:34:41 +01:00
Thomas Lamprecht
f23ecb7568 d/control: bump version dependency to pve-doc-generator
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-22 13:31:32 +01:00
Christian Ebner
f4f506b8b6 1891 Add zsh command completion for pveum
This generates the zsh command completion scripts for pveum.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-22 11:51:28 +01:00
Rhonda D'Vine
997bff9b90 Add missing Build-Depends
Also adjust debhelper dependency according to debian/compat content.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-12-17 09:39:38 +01:00
Thomas Lamprecht
6e010cde92 bump version to 5.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-29 13:00:18 +01: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
Thomas Lamprecht
f5a9380a6f bump version to 5.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-23 14:24:52 +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
b54b7474bb bump version to 5.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-15 10:36:16 +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
Stoiko Ivanov
ab7b19b58c PVE::AccessControl: register userid with completion
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-27 16:40:55 +02:00
Stoiko Ivanov
b7ba86d426 fix PVE::AccessControl::role_is_special
PVE::AccessControl::role_is_special now returns 0 instead of '' for false
(Schemavalidation did complain about '')

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-27 16:40:55 +02:00
Thomas Lamprecht
e53af3dbf6 d/control: update pve-common version dependency
as we use the new param_mapping functionallity from PVE::CLIHandler

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-27 13:30:00 +02:00
Dominik Csapak
b34d76e726 replace read_password with param_mapping
use the get_standar_mapping 'pve-password'
then we can get rid of the Term::ReadLine dependency

we use this change to only ask for the password once on
'pveum ticket'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 13:27:22 +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
Philip Abernethy
1e41cdc903 pveum: introduce sub-commands
use a sub-command structure instead of abbreviated words, where useful.
Keep old commands as aliases.

Signed-off-by: Philip Abernethy <p.abernethy@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-05 15:02:09 +02:00
Wolfgang Bumiller
52192dd4ca bump version to 5.0-8
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-18 13:39:48 +01: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
Dominik Csapak
f4e7fc7bab fix #1612: give authenticate_user_ldap the realm on second server
this was missing and lead to 'use of unitialized value $realm...'
and a not working second server if a bindpw was defined

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-11 11:39:08 +01:00
Philip Abernethy
16e50b59f9 properly register pve-poolid format
was erroneously registered as verify_groupname, overriding the previous
registration
2017-10-19 11:58:36 +02:00
Fabian Grünbichler
3dadf8cf6d bump version to 5.0-7 2017-10-05 11:28:36 +02:00
Fabian Grünbichler
fce00589c9 build: reformat debian/control
using wrap-and-sort -abt
2017-10-04 11:05:33 +02:00
Matthias Urban
aad513f6d1 VM.Snapshot.Rollback privilege added
VM.Snapshot.Rollback privilege added

Signed-off-by: Matthias Urban <matthias.urban@pure-systems.com>
2017-09-22 09:08:28 +02: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