Commit Graph

263 Commits

Author SHA1 Message Date
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
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
Wolfgang Bumiller
ec4141f4ed bump version to 5.0-6 2017-08-08 11:57:34 +02:00
Dominik Csapak
8bdbfd4ddf fix trailing whitespace
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-08 11:46:10 +02:00
Dominik Csapak
23e0cf85fd fix #1470: ad: server and client certificate support
as with ldap we now accept
the verify, capath, cert and certkey parameters for active directory

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-08 11:46:10 +02:00
Wolfgang Bumiller
e03c2aef17 ldap: server and client certificate support
This adds 4 more options to the ldap authentication method:

verify: boolean
  If enabled, the server certificate must be valid

capath: path to a file or directory
  The CA to use to verify the server certificate. Used only
  if 'verify' is true.

cert: path to a certificate
  Used as client certificate when connecting to a server,
  provided 'secure' is true. Requires 'certkey' to be set.

certkey: path to the certificate's key
  Required only used when 'cert' is used.
2017-08-08 11:46:10 +02:00
Dietmar Maurer
63134bd436 bump version to 5.0-5
In order to test new package built with dpkg-buildpackage.
2017-06-22 09:13:00 +02:00