all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Thomas Ellmenreich" <t.ellmenreich@proxmox.com>
To: "Shan Shaji" <s.shaji@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint
Date: Fri, 28 Aug 2026 11:56:30 +0200	[thread overview]
Message-ID: <DL0HJU4OSDCN.1S6OX5MI12A1O@proxmox.com> (raw)
In-Reply-To: <20260827130033.131872-1-s.shaji@proxmox.com>

I tested it before and after, and it works as expected.

Since the commit message didn't make it clear which exact rrddata path it is,
I tried a few others and noticed that this one also returns 'permission
check failed':

`/api2/json/remotes/remote/cluster1/rrddata`

In any case:

Reviewed-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Tested-by Thomas Ellmenreich <t.ellmenreich@proxmox.com>

On Thu Aug 27, 2026 at 3:00 PM CEST, Shan Shaji wrote:
> The /rrddata endpoint did not have the access parameter defined inside
> the API macro. This resulted in a "403: permission check failed" error
> in the UI even though the user was assigned the Administrator role on
> the / ACL path. This issue was raised in the forum [0].
>
> Fix this by adding the explicit permission check.
>
> - [0] https://forum.proxmox.com/threads/185992/
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>  server/src/api/nodes/rrddata.rs | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/server/src/api/nodes/rrddata.rs b/server/src/api/nodes/rrddata.rs
> index b6e55b48..0bb8b374 100644
> --- a/server/src/api/nodes/rrddata.rs
> +++ b/server/src/api/nodes/rrddata.rs
> @@ -1,11 +1,11 @@
>  use anyhow::Error;
>  use proxmox_rrd_api_types::{RrdMode, RrdTimeframe};
>  
> -use proxmox_router::{Router, http_bail};
> +use proxmox_router::{Permission, Router, http_bail};
>  use proxmox_schema::api;
>  
> -use pdm_api_types::NODE_SCHEMA;
>  use pdm_api_types::rrddata::PdmNodeDatapoint;
> +use pdm_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT};
>  
>  use crate::api::rrd_common::{self, DataPoint};
>  
> @@ -97,7 +97,11 @@ impl DataPoint for PdmNodeDatapoint {
>          items: {
>              type: PdmNodeDatapoint,
>          }
> -    }
> +    },
> +    access: {
> +        permission: &Permission::Privilege(&["system", "status"], PRIV_SYS_AUDIT, false),
> +        description: "Requires `Sys.Audit` privilege on `/system/status`."
> +    },
>  )]
>  /// Read RRD data for this PDM node.
>  fn get_node_rrddata(





  reply	other threads:[~2026-08-28  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 13:00 [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint Shan Shaji
2026-08-28  9:56 ` Thomas Ellmenreich [this message]
2026-08-28 10:59 ` applied: " Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DL0HJU4OSDCN.1S6OX5MI12A1O@proxmox.com \
    --to=t.ellmenreich@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=s.shaji@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal