limit config, stream, stats, and metrics data for non-admin users

Non-admin users received data they never use in the UI: credentials embedded in camera paths, ffmpeg args, and go2rtc settings that the masking regex missed, process command lines over the websocket stats topic, every camera's metrics, and custom classification names for objects their cameras don't track.

- /config drops input paths, ffmpeg args, ffmpeg_cmds, webui_url, genai base_url and provider_options, and go2rtc sections other than stream names and webrtc for non-admins, and redacts profile notification emails
- /go2rtc/streams returns only producer medias to non-admins
- websocket and REST stats share one helper that strips cmdline and bandwidth_usages for non-admins
- /metrics requires admin
- custom classification categories only attach to labels the allowed cameras track
This commit is contained in:
Josh Hawkins
2026-11-23 09:08:27 -06:00
parent 8c88754664
commit f6eae237bf
11 changed files with 371 additions and 62 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import NavPath from "@site/src/components/NavPath";
# Metrics
Frigate exposes Prometheus metrics at the `/api/metrics` endpoint that can be used to monitor the performance and health of your Frigate instance.
Frigate exposes Prometheus metrics at the `/api/metrics` endpoint that can be used to monitor the performance and health of your Frigate instance. On the authenticated port (8971), the endpoint requires an admin user, so point scrapers at the internal port (5000) as shown below.
## Enabling Telemetry
+3 -3
View File
@@ -2546,7 +2546,7 @@ paths:
- App
summary: Metrics
description: |-
**Access:** Any authenticated user.
**Access:** Admin role required.
Expose Prometheus metrics endpoint and update metrics with latest stats
operationId: metrics_metrics_get
@@ -2557,8 +2557,8 @@ paths:
application/json:
schema: {}
security:
- frigateUserAuth: []
x-required-role: any
- frigateAdminAuth: []
x-required-role: admin
/genai/models:
get:
tags: