|
879 | 879 | listen: ":1984" # default ":1984", HTTP API port ("" - disabled) |
880 | 880 | username: "admin" # default "", Basic auth for WebUI |
881 | 881 | password: "pass" # default "", Basic auth for WebUI |
| 882 | + local_auth: true # default false, Enable auth check for localhost requests |
882 | 883 | base_path: "/rtc" # default "", API prefix for serving on suburl (/api => /rtc/api) |
883 | 884 | static_dir: "www" # default "", folder for static files (custom web interface) |
884 | 885 | origin: "*" # default "", allow CORS requests (only * supported) |
@@ -1201,6 +1202,27 @@ log: |
1201 | 1202 |
|
1202 | 1203 | ## Security |
1203 | 1204 |
|
| 1205 | +> [!IMPORTANT] |
| 1206 | +> If an attacker gains access to the API, you are in danger. Through the API, an attacker can use insecure sources such as echo and exec. And get full access to your server. |
| 1207 | + |
| 1208 | +For maximum (paranoid) security, go2rtc has special settings: |
| 1209 | + |
| 1210 | +```yaml |
| 1211 | +app: |
| 1212 | + # use only allowed modules |
| 1213 | + modules: [api, rtsp, webrtc, exec, ffmpeg, mjpeg] |
| 1214 | +
|
| 1215 | +api: |
| 1216 | + # use only allowed API paths |
| 1217 | + allow_paths: [/api, /api/streams, /api/webrtc, /api/frame.jpeg] |
| 1218 | + # enable auth for localhost (used together with username and password) |
| 1219 | + local_auth: true |
| 1220 | +
|
| 1221 | +exec: |
| 1222 | + # use only allowed exec paths |
| 1223 | + allow_paths: [ffmpeg] |
| 1224 | +``` |
| 1225 | + |
1204 | 1226 | By default, `go2rtc` starts the Web interface on port `1984` and RTSP on port `8554`, as well as uses port `8555` for WebRTC connections. The three ports are accessible from your local network. So anyone on your local network can watch video from your cameras without authorization. The same rule applies to the Home Assistant Add-on. |
1205 | 1227 |
|
1206 | 1228 | This is not a problem if you trust your local network as much as I do. But you can change this behaviour with a `go2rtc.yaml` config: |
|
0 commit comments