Commit Graph

413 Commits

Author SHA1 Message Date
Thomas Lamprecht
50b26582c8 bump version to 6.4-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-17 13:57:49 +02:00
Alexandre Derumier
d1734c0883 check_path : add sdn zone path
This was missing in commit20c60513b2a6b2d7c7aae0dcc0391889b9cb7ecf,
so user can't assign permisson on a zone currently

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 0a06acb128)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-17 13:56:26 +02:00
Thomas Lamprecht
5e6c2d4c09 bump version to 6.4-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-16 17:19:45 +02:00
Dominik Csapak
5af0a4739b add missing paths in check_path
* /access/realm/<realm>
* /access/groups/<group>

were overlooked when fixing #1500

see: https://forum.proxmox.com/threads/are-group-acls-broken-in-v6-4.91000/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 8737ff3718)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-16 16:24:24 +02:00
Thomas Lamprecht
3470fad8c1 pveum: work around unavailable API2:Pools module
commit 42ade84744 added the pool
subcommands, reusing the PVE::API2::Pool module. But that module has
to live in pve-manager and is not available here, most of the time
not a real issue (but always ugly), on bootstrapping this becomes a
blocker though...

So, for now add a hack and do not hard depend on the modules
availability...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 19:48:50 +02:00
Thomas Lamprecht
d4c9a54e35 d/control: update standards version
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 19:48:50 +02:00
Thomas Lamprecht
ce4b5d6066 d/control: drop perl dependency, added by ${perl:Depends}
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 19:48:50 +02:00
Thomas Lamprecht
197d1016fd buildsys: split packaging and source build-systems
Much nicer to handle and work with than entangling all together in a
single spaghetti pile.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 19:48:50 +02:00
Thomas Lamprecht
08eb54c9dc d/control: bump debhelper compat to >= 12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 18:16:38 +02:00
Thomas Lamprecht
ebcefa86d4 d/rules: fix dh_missing override
note, with compat level >= 13 we can drop that override finally

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-09 18:16:04 +02:00
Thomas Lamprecht
2942ba4139 bump version to 6.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-24 19:48:25 +02:00
Dylan Whyte
42ade84744 resource pools: add resource pool cli commands
Add commands for creating, modifying, listing, and deleting resource
pools.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2021-04-22 21:53:09 +02:00
Lorenz Stechauner
b89cd20528 fix typo in oathkeygen: randon -> random
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-04-20 18:13:51 +02:00
Thomas Lamprecht
ad1ef9fc1c acl: check path: further resdtrict VMID values
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-19 11:50:16 +02:00
Thomas Lamprecht
91c30089a7 acl: check path: spell param out
we normally use shift only in closures, to keep them short, as a
module method this should rather use our standard style.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-19 11:48:52 +02:00
Lorenz Stechauner
20c60513b2 fix #1500: permission path syntax check for access control
Syntax for permission paths is now checked on API calls for
creation or update on permissions.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-04-19 10:13:45 +02:00
Wolfgang Bumiller
01f191c8c4 fix #1670: change PAM service name to project specific name
Instead of 'common-auth' use 'proxmox-ve-auth', this way
users can override PAM authentication settings via
`/etc/pam.d/proxmox-ve-auth`.

If the file does not exist, pam will use `/etc/pam.d/other`
which by default behaves like `common-auth`.

Note that this *can* be different from directly using
`common-auth` *if* a user has actually modified
`/etc/pam.d/other` for some reason.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-11-20 14:51:29 +01:00
Thomas Lamprecht
54d312f350 bump version to 6.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-29 08:55:56 +02:00
Thomas Lamprecht
f335d265b8 api/users: catch existing user also on case insensitive realm
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-29 08:51:36 +02:00
Thomas Lamprecht
2dd1e1d41e api/users: indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-29 06:19:07 +02:00
Wolfgang Link
eb41d20051 fix #2947 login name for the LDAP/AD realm can be case-insensitive
This is an optional for LDAP and AD realm.
The default behavior is case-sensitive.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-09-29 06:14:53 +02:00
Thomas Lamprecht
9de25de807 partially fix #2825: authkey: rotate if it was generated in the future
Can happen if the RTC is in the future during installation and first
boot, when during key generation the clock is in the future and then,
after the key was already generated, jumps back in time.

Allow a fuzz of $auth_graceperiod, which is currently 5 minutes, as
that fuzz allows some minor, not really problematic, time sync
disparity in clusters.

If an old authkey exists, meaning we rotated at least once, check it's
time too. Only rotate if it'd not be valid for any tickets in the
cluster anymore, i.e., if it difference between the current key is >
$ticket_lifetime (2 hours)..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-04 18:22:51 +02:00
Thomas Lamprecht
8304b226d6 authkey: use variable instead of hard coded grace period value
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-03 15:18:45 +02:00
Thomas Lamprecht
6a9be12f55 bump version to 6.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-30 13:06:59 +02:00
Mira Limbeck
cb381abc6b introduce VM.Config.Cloudinit permission
It is added to PVEVMUser by default.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-06-26 09:39:54 +02:00
Alexandre Derumier
b920d59c7a api2: AccessControl: add sdn permissions.modify
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-15 15:35:03 +02:00
Thomas Lamprecht
a1281512d0 comput coarse UI permissions: also check SDN ones
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-09 11:43:51 +02:00
Thomas Lamprecht
e6624f504b bump version to 6.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-08 17:47:50 +02:00
Dominik Csapak
de8c5e6ceb LDAP: skip anonymous bind when clientcert/key is given
It seems that servers associate the client-cert/key with an account, so
doing an explicit anonymous bind then 'logs out' the already verified
user, limiting the search results in some cases

before refactoring to PVE::LDAP, we did not do '$ldap->bind' at all when
there was no bind_dn, but it is not really clear if Net::LDAP does this
automatically when searching (other libraries do this), so leave the
anonymous bind (for compatibility with PMG) but skip it when a client
certificate and key is given.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-08 13:35:18 +02:00
Thomas Lamprecht
eeabad5a13 ldap_delete_credentials: don't complain if already deleted
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-08 09:38:34 +02:00
Tim Marx
30dd4869b5 whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2020-05-06 16:41:43 +02:00
Thomas Lamprecht
618d112b74 pveum: add 'tfa delete' subcommand for deleting user-TFA
Allows a user to straight forward delete TFS over CLI, easier as
telling them to edit some config files, and the API is already there.

Short circuit most params of that API call to undef, as they do not
make sense to expose.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 16:40:05 +02:00
Thomas Lamprecht
8f4a522f4f bump version to 6.0-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-25 19:35:20 +02:00
Thomas Lamprecht
417309d71c domains: dry-run: adapt log messages and improve variable name
keep variable names aligned with the params the relate to, "write"
was quite ambiguous too (write what?)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-25 19:06:24 +02:00
Thomas Lamprecht
6c42a1034b parse_sync_opts: code cleanup
avoid confusion between fmt default and cfg default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-25 18:54:46 +02:00
Dominik Csapak
38691d98c8 domain sync: add 'dry-run' parameter
this can be used to test the resulting config before actually changing
anything

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 18:31:35 +02:00
Dominik Csapak
72a9742b94 auth ldap/ad: introduce connection 'mode'
instead of having only a 'secure' flag which switches between
ldap/ldaps we now have a mode which also contains 'ldap+starttls'

our connection code in PVE::LDAP can handle this already (used in pmg)
so that is no problem

if we want to really remove the 'secure' flag, e.g. in 7.0
we'd either have to rewrite the config or have it as an error
in a pve6to7 script

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 18:31:35 +02:00
Dominik Csapak
055c54b5a2 domain sync: make options actually required
we want the api options to be optional, but only as long as there are
default values set in the realm config

since they are all marked as optional (else they would be required in
the api) this check did not work as intended

instead, set the result to the value of:
* the parameter
* the set default in the config
* the api default
in this order

if it is undef after this, raise a parameter exception

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 18:31:35 +02:00
Dominik Csapak
782b702dbb auth ldap/ad: make password a parameter for the api
Allows us to add it in the gui, until now the admin needed to create
the file themself.

Mirrored after credential handling from CIFS and PBS in their
pve-storage plugins

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[Thomas: don't differ from storage one unnecessarily, keep comments
 and behavior]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-18 18:48:28 +02:00
Thomas Lamprecht
89338e4d9c api/domain: add on add/update/delete hooks
Almost 1:1 taken from pve-storage ones

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-18 18:48:05 +02:00
Thomas Lamprecht
77bfb48e0d token create: return also full token id for convenience
makes creating a client for this slightly nicer, as it doesn't needs
to be as state full.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-15 20:41:39 +02:00
Thomas Lamprecht
067d625ab2 buildsys: fix getting the build commit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-15 20:04:54 +02:00
Thomas Lamprecht
856c101e97 token: avoid undef warning if no tokens are configured
Initially the config may not even exist, and so the first token
create would give one then a ugly warning like:
> Use of uninitialized value $raw in split at ..

Handle that case, empty config (where we get '') was fine already, so
explicitly check for definedness, not truthiness.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-15 17:14:01 +02:00
Dominik Csapak
0ae051a4d6 auth ad: add sync-defaults-options
this was missing for AD realms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-06 13:52:55 +02:00
Thomas Lamprecht
8d400e7ece d/control: bump versioned to libpve-common-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:51:06 +01:00
Thomas Lamprecht
b49abe2d25 split and sort some module use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
d29d2d4a11 realm: add default-sync-options to config
This allows us to have a convenient way to set the desired default
sync options, and thus not forcing users to pass always all options
when they want to trigger a sync.

We still die when an option is neither specified in the domains
(realm) config nor as API/CLI parameter.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
415179b03a api: realm sync: move out group and user update to separate methods
keep the api call way smaller and clearer

On moving out some minor adaptions where made, e.g., we do not print
"remove user X" if we know that we'd add it again, but just print a
single "update user X" for that. Same for groups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
6a2138e4d6 api: realm sync: use auth-realm-sync as worker id
we may potentially also sync something else over this in the future,
for example PAM users from a specific group, so use a more general
	name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:11:48 +01:00
Thomas Lamprecht
cf109814a8 api: realm sync: cleanup code and refactor
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:11:48 +01:00