docs: finalize Keycloak hardening and validate updated Realm config
Documented the completed Keycloak hardening steps, including PKCE S256 support, CORS security improvements, strengthened password policy, and logout redirect URI configurations. Verified and updated the `meldestelle-realm.json` and roadmap to reflect these changes. Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Journal - 2026-03-09
|
||||
|
||||
## 📝 Zusammenfassung
|
||||
|
||||
Keycloak-Härtung der Realm-Konfiguration (`meldestelle-realm.json`). Aufbauend auf dem Infrastruktur-Fix vom
|
||||
2026-03-06 (korrektes `start --optimized`, Healthcheck) wurden nun die Client-Konfigurationen und
|
||||
Sicherheitseinstellungen auf einen produktionsreifen Stand gebracht.
|
||||
|
||||
## 🛠️ Änderungen
|
||||
|
||||
### 1. `config/docker/keycloak/meldestelle-realm.json`
|
||||
|
||||
#### Wildcard aus `webOrigins` entfernt
|
||||
|
||||
- **Vorher:** `api-gateway` und `web-app` hatten `"*"` in `webOrigins` (CORS-Sicherheitslücke).
|
||||
- **Nachher:** Nur explizit erlaubte Origins (`localhost:*`, `app.meldestelle.at`).
|
||||
|
||||
#### Neuer Client: `frontend-client` (KMP Desktop & Mobile)
|
||||
|
||||
- **Public Client** mit **PKCE S256** (kein Client-Secret nötig, sicher für native Apps).
|
||||
- **Redirect URIs:** `meldestelle://callback` (Custom URI Scheme für Desktop), `http://localhost:*` (Dev),
|
||||
`https://app.meldestelle.at/*` (Prod).
|
||||
- **Kein `directAccessGrantsEnabled`** — verhindert Password-Grant-Flow (unsicher für native Apps).
|
||||
|
||||
#### Password-Policy gestärkt
|
||||
|
||||
- **Vorher:** `length(8)` — zu schwach.
|
||||
- **Nachher:** `length(10) and digits(1) and upperCase(1) and specialChars(1) and notUsername(undefined)`.
|
||||
|
||||
#### `post.logout.redirect.uris` konfiguriert
|
||||
|
||||
- Alle relevanten Clients (`api-gateway`, `web-app`, `frontend-client`) haben nun korrekte Logout-Redirect-URIs gemäß
|
||||
OIDC Back-Channel Logout Standard.
|
||||
|
||||
## 📚 Gelerntes / Entscheidungen
|
||||
|
||||
- **`meldestelle://callback`** als Custom URI Scheme: Für KMP Compose Desktop ist ein eigenes URI-Schema der sichere
|
||||
Standard (kein offener HTTP-Port nötig). Muss im OS registriert werden.
|
||||
- **PKCE S256 ist Pflicht für Public Clients:** Verhindert Authorization Code Interception Attacks. Keycloak `26.x`
|
||||
unterstützt dies nativ.
|
||||
- **`frontend-client` vs. `web-app`:** Klare Trennung: `web-app` für Browser-basierte Web-App, `frontend-client` für
|
||||
native KMP Desktop/Mobile-App.
|
||||
|
||||
## 🔜 Nächste Schritte
|
||||
|
||||
- **Micrometer Upgrade** (`1.16.1`) — Quick-Win in `libs.versions.toml`.
|
||||
- **Zipkin Integration** — Tracing vom Gateway bis zur DB aktivieren.
|
||||
- **OIDC Client im Frontend** — Login-Flow mit `ktor-client-auth` und `frontend-client` implementieren.
|
||||
- **TLS/HTTPS** — Langfristig: `KC_HOSTNAME_STRICT_HTTPS=true` setzen, sobald TLS eingerichtet ist.
|
||||
Reference in New Issue
Block a user