Skip to content

Commit cb22ae7

Browse files
committed
Add security notes to readme
1 parent c98b0a8 commit cb22ae7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ api:
879879
listen: ":1984" # default ":1984", HTTP API port ("" - disabled)
880880
username: "admin" # default "", Basic auth for WebUI
881881
password: "pass" # default "", Basic auth for WebUI
882+
local_auth: true # default false, Enable auth check for localhost requests
882883
base_path: "/rtc" # default "", API prefix for serving on suburl (/api => /rtc/api)
883884
static_dir: "www" # default "", folder for static files (custom web interface)
884885
origin: "*" # default "", allow CORS requests (only * supported)
@@ -1201,6 +1202,27 @@ log:
12011202

12021203
## Security
12031204

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+
12041226
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.
12051227

12061228
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

Comments
 (0)