|
| 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