You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(config): add security considerations for rpc (#10739)
* docs(config): add security considerations for rpc
we already had big red box at
https://docs.ipfs.tech/reference/kubo/rpc/,
however users reading kubo docs could miss it.
this ensures it is not possible to miss these basic notes.
Copy file name to clipboardexpand all lines: docs/config.md
+26-1
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,19 @@ Supported Transports:
225
225
* tcp/ip{4,6} - `/ipN/.../tcp/...`
226
226
* unix - `/unix/path/to/socket`
227
227
228
+
> [!CAUTION]
229
+
> **NEVER EXPOSE UNPROTECTED ADMIN RPC TO LAN OR THE PUBLIC INTERNET**
230
+
>
231
+
> The RPC API grants admin-level access to your Kubo IPFS node, including
232
+
> configuration and secret key management.
233
+
>
234
+
> By default, it is bound to localhost for security reasons. Exposing it to LAN
235
+
> or the public internet is highly risky—similar to exposing a SQL database or
236
+
> backend service without authentication middleware
237
+
>
238
+
> - If you need secure access to a subset of RPC, secure it with [`API.Authorizations`](#apiauthorizations) or custom auth middleware running in front of the localhost-only RPC port defined here.
239
+
> - If you are looking for an interface designed for browsers and public internet, use [`Addresses.Gateway`](#addressesgateway) port instead.
240
+
228
241
Default: `/ip4/127.0.0.1/tcp/5001`
229
242
230
243
Type: `strings` ([multiaddrs][multiaddr])
@@ -255,6 +268,9 @@ Supported Transports:
255
268
* quicv1 (RFC9000) - `/ipN/.../udp/.../quic-v1` - can share the same two tuple with `/quic-v1/webtransport`
256
269
* webtransport `/ipN/.../udp/.../quic-v1/webtransport` - can share the same two tuple with `/quic-v1`
257
270
271
+
> [!IMPORTANT]
272
+
> Make sure your firewall rules allow incoming connections on both TCP and UDP ports defined here.
273
+
258
274
Note that quic (Draft-29) used to be supported with the format `/ipN/.../udp/.../quic`, but has since been [removed](https://github.com/libp2p/go-libp2p/releases/tag/v0.30.0).
259
275
260
276
Default:
@@ -329,7 +345,7 @@ The `API.Authorizations` field defines user-based access restrictions for the
329
345
[Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/), which is located at
330
346
`Addresses.API` under `/api/v0` paths.
331
347
332
-
By default, the RPC API is accessible without restrictions as it is only
348
+
By default, the admin-level RPC API is accessible without restrictions as it is only
333
349
exposed on `127.0.0.1` and safeguarded with Origin check and implicit
334
350
[CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) headers that
335
351
block random websites from accessing the RPC.
@@ -339,6 +355,15 @@ unless a corresponding secret is present in the HTTP [`Authorization` header](ht
339
355
and the requested path is included in the `AllowedPaths` list for that specific
340
356
secret.
341
357
358
+
> [!CAUTION]
359
+
> **NEVER EXPOSE UNPROTECTED ADMIN RPC TO LAN OR THE PUBLIC INTERNET**
360
+
>
361
+
> The RPC API is vast. It grants admin-level access to your Kubo IPFS node, including
362
+
> configuration and secret key management.
363
+
>
364
+
> - If you need secure access to a subset of RPC, make sure you understand the risk, block everything by default and and allow basic auth access with [`API.Authorizations`](#apiauthorizations) or custom auth middleware running in front of the localhost-only port defined in [`Addresses.API`](#addressesapi).
365
+
> - If you are looking for an interface designed for browsers and public internet, use [`Addresses.Gateway`](#addressesgateway) port instead.
366
+
342
367
Default: `null`
343
368
344
369
Type: `object[string -> object]` (user name -> authorization object, see below)
Copy file name to clipboardexpand all lines: docs/experimental-features.md
+30
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,14 @@ Experimental.
65
65
66
66
### How to enable
67
67
68
+
> [!WARNING]
69
+
> **SECURITY CONSIDERATION**
70
+
>
71
+
> This feature provides the IPFS [`add` command](https://docs.ipfs.tech/reference/kubo/cli/#ipfs-add) with access to
72
+
> the local filesystem. Consequently, any user with access to CLI or the HTTP [`/v0/add` RPC API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add) can read
73
+
> files from the local filesystem with the same permissions as the Kubo daemon.
74
+
> If you enable this, secure your RPC API using [`API.Authorizations`](https://github.com/ipfs/kubo/blob/master/docs/config.md#apiauthorizations) or custom auth middleware.
> This feature provides the IPFS [`add` CLI command](https://docs.ipfs.tech/reference/kubo/cli/#ipfs-add) with access to
111
+
> the local filesystem. Consequently, any user with access to the CLI or HTTP [`/v0/add` RPC API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add) can read
112
+
> files from the local filesystem with the same permissions as the Kubo daemon.
113
+
> If you enable this, secure your RPC API using [`API.Authorizations`](https://github.com/ipfs/kubo/blob/master/docs/config.md#apiauthorizations) or custom auth middleware.
0 commit comments