> For the complete documentation index, see [llms.txt](https://www.nl-portal.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.nl-portal.nl/next/configuratie/basisconfiguratie/beveiliging.md). Agents can also search and read this documentation through its [MCP server](https://www.nl-portal.nl/~gitbook/mcp).

# Beveiliging

Beveiligingsinstellingen van de NL Portal backend, onder `nl-portal.security.*`. Het inloggen van inwoners staat bij [Keycloak configuratie](https://www.nl-portal.nl/next/configuratie/basisconfiguratie/keycloak.md).

| Onderdeel                                                                                        | Env-variabelen                                                       | Helm-waarden (`nl-portal-backend`)          |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | ------------------------------------------- |
| CORS                                                                                             | `NLPORTAL_SECURITY_CORS_0_PATH`, `NLPORTAL_SECURITY_CORS_0_CONFIG_*` | `settings.app.security.cors.*`              |
| Publieke endpoints                                                                               | `NLPORTAL_SECURITY_ENDPOINTS_UNSECURED`                              | `settings.app.security.endpoints.unsecured` |
| Security headers                                                                                 | `NLPORTAL_SECURITY_HEADERS_*`                                        | geen                                        |
| [Actuator](https://www.nl-portal.nl/next/configuratie/basisconfiguratie/beveiliging/actuator.md) | `NLPORTAL_SECURITY_ACTUATOR_*`                                       | `settings.app.security.actuator.*`          |

## Instellingen

| Property                                             | Env-variabele                                      | Standaard (app)  | Beschrijving                                                                                    |
| ---------------------------------------------------- | -------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------- |
| `nl-portal.security.cors[n].path`                    | `NLPORTAL_SECURITY_CORS_<n>_PATH`                  | `/**`            | Pad waarvoor de CORS-configuratie geldt.                                                        |
| `nl-portal.security.cors[n].config.allowed-origins`  | `NLPORTAL_SECURITY_CORS_<n>_CONFIG_ALLOWEDORIGINS` | `*`              | Toegestane origins, kommagescheiden. Zet dit in productie op de URL van de frontend.            |
| `nl-portal.security.cors[n].config.allowed-methods`  | `NLPORTAL_SECURITY_CORS_<n>_CONFIG_ALLOWEDMETHODS` | `*`              | Toegestane HTTP-methodes.                                                                       |
| `nl-portal.security.cors[n].config.allowed-headers`  | `NLPORTAL_SECURITY_CORS_<n>_CONFIG_ALLOWEDHEADERS` | `*`              | Toegestane headers.                                                                             |
| `nl-portal.security.endpoints.unsecured`             | `NLPORTAL_SECURITY_ENDPOINTS_UNSECURED`            | `/api/public/**` | Paden die zonder login bereikbaar zijn.                                                         |
| `nl-portal.security.headers.content-security-policy` | `NLPORTAL_SECURITY_HEADERS_CONTENTSECURITYPOLICY`  | geen             | Waarde van de header `Content-Security-Policy`. Zonder waarde wordt de header niet meegestuurd. |
| `nl-portal.security.headers.hsts-max-age-in-days`    | `NLPORTAL_SECURITY_HEADERS_HSTSMAXAGEINDAYS`       | `365`            | `max-age` van de header `Strict-Transport-Security` (met `includeSubDomains` en `preload`).     |
| `nl-portal.support.ping-endpoint.enabled`            | `NLPORTAL_SUPPORT_PINGENDPOINT_ENABLED`            | `false`          | Zet `GET /api/public/ping` aan voor monitoring; antwoordt met `pong`.                           |

De backend stuurt daarnaast altijd `X-Frame-Options: SAMEORIGIN` en `Referrer-Policy: same-origin` mee.

De actuator-instellingen staan op de pagina [Actuator](https://www.nl-portal.nl/next/configuratie/basisconfiguratie/beveiliging/actuator.md).
