]> git.proxmox.com Git - pve-storage.git/commit
fix #5254: api: allow usage of download-url with Sys.AccessNetwork
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 19 Feb 2024 16:13:41 +0000 (17:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Feb 2024 14:48:44 +0000 (15:48 +0100)
commit17e0b01b7fcf1ee6070cb05b81bcdcf939147fed
tree44bb5b07277187ed14312495c9cdbf4d91560ab5
parent4abb327843b65ef5eec3b679230b5c08fd8ef972
fix #5254: api: allow usage of download-url with Sys.AccessNetwork

The download-url API endpoint has some implications that admins are
unaware of, namely that it basically allow to scan the whole network
via HTTP URLs, and potentially even download some image that the user
should not have access to and adding to a VM that the user controls.

That's why in addition to the Datastore.AllocateTemplate privilege on
the storage, the Sys.Modify on the whole Cluster was required to use
the API call. That design was chosen as we were not fully sure if a
separate privilege is warranted, but user feedback has shown that the
(not so big) cost of adding such a new privilege is justified.

Change the permission check to allow the combination of
Datastore.AllocateTemplate on the storage and either 'Sys.Modify' on
/, for backwards compatibility, or the newer 'Sys.AccessNetwork' on
the node that handles the download.
Using a node-specific ACL path allows admins to e.g. prepare one
specific node's firewall so that pveproxy can access only a safe set
of hosts via outgoing HTTP (not stemming from valid connection
tracking to the PVE API), and thus even further limit the privileges
of users or tools that are trusted to download images to a storage.

Buglink: https://bugzilla.proxmox.com/show_bug.cgi?id=5254
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/API2/Storage/Status.pm