Skip to content

Commit 63b3598

Browse files
added security considerations page with single section on max upload sizes (#3399)
1 parent c0b4ac4 commit 63b3598

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Nuts documentation
3434
pages/deployment/key-rotation.rst
3535
pages/deployment/audit-logging.rst
3636
pages/deployment/oauth.rst
37+
pages/deployment/security-considerations.rst
3738

3839
.. toctree::
3940
:maxdepth: 1

docs/pages/deployment/recommended-deployment.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ Below is a list of items that should be addressed when running a node in product
181181
- Reverse proxy
182182
- Use a proxy in front of the node which terminates TLS
183183
- Make sure the reverse proxy sends the ``X-Forwarded-For`` header to log correct IP addresses
184-
- Key Management
185-
- Have a scheduled key rotation procedure
186184
- Backup Management
187185
- Make sure data is backed up (data stored in SQL and private keys)
188186
- Have a tested backup/restore procedure
@@ -192,10 +190,7 @@ Below is a list of items that should be addressed when running a node in product
192190
- If not using ``did:nuts``, prevent access to:
193191
- The gRPC endpoint (e.g. by not mapping it in Docker).
194192
- The public ``/n2n`` and ``/public`` endpoints on HTTP ``:8080``. See the v5 documentation for deployments still using ``did:nuts``.
195-
- Make sure internal HTTP endpoints (``:8081``) are not available from the outside.
196-
- Consider protecting ``/internal`` with API authentication.
197-
- Availability
198-
- Consider (D)DoS detection and protection for the ``/oauth2`` HTTP endpoints.
193+
- consult general security considerations in the :ref:`security-considerations` section.
199194

200195
Resource Requirements
201196
*********************
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _security-considerations:
2+
3+
Security Considerations
4+
#######################
5+
6+
Please consult the topics below for various security considerations.
7+
8+
Endpoint Security
9+
*****************
10+
11+
It's important to prevent outside access to the internal API's. By default these are available from ``127.0.0.1:8081`` and are not protected with API security.
12+
When exposing the external APIs to your internal network, take the appropriate measures to secure the API's (SSH, API security, etc).
13+
14+
In addition to securing the internal APIs, it's recommended to limit access to the public APIs using a reverse proxy.
15+
This will allow you to control access to the public APIs, do TLS termination and add additional security measures.
16+
Block any path that's not used by the Nuts node.
17+
18+
D(D)oS Protection
19+
*****************
20+
21+
Consider implementing (D)DoS protection on the application layer for all public endpoints.
22+
23+
Maximum client body size for public-facing POST APIs
24+
****************************************************
25+
26+
Various parts of the Nuts Node API allow for POST requests. To prevent abuse, you should limit the size of the request body.
27+
The following public APIs accept POST requests:
28+
29+
- ``/discovery/{service}``
30+
- ``/oauth2/{subjectID}/token``
31+
- ``/oauth2/{subjectID}/request.jwt/{id}``
32+
- ``/oauth2/{subjectID}/response``
33+
34+
To prevent malicious uploads, you MUST limit the size of the requests.
35+
36+
For example, Nginx has a configuration directive to limit the size of the request body:
37+
38+
.. code-block:: nginx
39+
40+
client_max_body_size 1M;
41+
42+
The actual limit depends on your use case. It should be large enough for Verifiable Presentations to be uploaded, but small enough to prevent abuse.
43+
44+
Key rotation
45+
************
46+
47+
It's important to have a key rotation policy in place. The Nuts node uses keys for various signing operations.
48+
These operations are numerous and therefore keys should be rotated regularly.

0 commit comments

Comments
 (0)