User accoubt audit for grafana

Hi All,
I would like to check is there any function or api in grafana oss allow us to extract all the folders and its permission, as my organisations is doing some user auditing hence we need to provided all the folder permissions whereby we are able to view which user can access the folder or which user is able edit the dashboad in the folder. I have read the api document but there seen no way to extract all folders with its permisson at once. It seen need do one by one with folder id .

welcome

The above should give you some direction

Hi @yosiasz thaks for the resources, but the api i had read before as i said it required to extract folder id first then can extract the folder permission. I would like to check is there any way to extract all folder permissions without one by one, as we have quite alot of folders hence if one by one will be hard for us and we are not a technical people who can write script to automated

Maybe look into querying the grafana database itself. Either way it will require soke technical know how

1 Like

Alright, thanks @yosiasz. Is there any place i can see the schema of the database? As i have query the sqlite db in mysql but the database table seen to be alot.

Not sure I understand

Sorry for confusion i mean is there any documentation i can refer to for the grafana database structure.

I do not believe so, because it is not recommended to mess with it.

But it is pretty straight forward to query it and figure it out.

I use this tool

https://sqlitebrowser.org/dl/

1 Like

@yosiasz Thanks for the help i shall give it a try

1 Like

But dont do it on the live grafana.db, make a copy of it somewhere else @woshitommy2

1 Like
select d.slug, p.action, r.*
  from dashboard d, permission p, role r
 where p.role_id = r.id
   and p.scope like '%'||d.uid||'%'
   and p.action like 'folders%'

then maybe you can create a dashboard or export result to csv for an audit document

I’ve been using Grafana OSS for my organization’s monitoring and visualization needs. Recently, we’ve been tasked with conducting a user auditing process to ensure proper access and permissions for our Grafana folders. We need to extract all the folders along with their respective permissions, so we can determine which users have access to each folder and who can edit the dashboards within them. I’ve explored the Grafana API documentation, and so far, I haven’t found a biddingestimate straightforward way to extract all folders and their permissions at once. It seems that I need to retrieve the information for each folder individually by using their respective folder IDs. Regards

In Grafana OSS, there isn’t a built-in function or API to extract all folders and their permissions at once. As you mentioned, it seems you’d need to retrieve folder information one by one using the folder ID. However, you might explore alternative solutions. One option could be creating a custom script that utilizes Grafana’s API to loop through all folders, fetching their permissions and storing the data in a structured format for auditing purposes. Additionally, consider checking the Grafana community forums or plugins, as someone might have developed a solution for this specific requirement. Good luck with your user auditing efforts!

Currently, Grafana OSS doesn’t have a built-in function or API to extract all folders and permissions at once. It seems you’ll need to retrieve the information one by one using folder IDs for your user auditing process.