Arquitectura para recolección de logs y métricas con autenticación centralizada (Keycloak)

Fecha publicación
Dificultad
Avanzado
#
7
3 more properties
Publicado
tags
IoT, Gateways, logs, métricas, plataforma, Grafana, Alloy, Docker, sistema, Mimir, Loki, MinIO, almacenamiento, AWS, S3, visualización, monitoreo, captura, servidores, integración, DB, BBDD, servers, integration, metrics, systems, logs, autenticacion, keycloak, Oauth2, reverse proxy, autenticacion centralizada,SSO

Descripción

Se describe la arquitectura de Observabilidad securizada con Keycloak. En primera instancia Grafana se configura para gestionar accesos usando OpenID. Por otro lado Grafana MIMIR y LOKI usarán OAuth2 con Authorization Code para web interfaces y OAuth2 con Client Credentials para APIs.
architecture_keycloak.png


OAuth2 - Authorization Code (WUI)

image.png
original
Mermaid
sequenceDiagram
  autonumber
  participant Browser as Browser
  participant Server as Service
  participant IdP as IdP (Keycloak)
	Browser->>Server: GET /my-data
	Server->>Browser: Can you authn w/IdP?
	Browser->>IdP: Redirect to IdP,<br/> authenticate and return an<br/> Authorization Code
	IdP->>Browser: Authenticated,<br/>this is your Authorization Code
	Browser->>Server: GET /my-data<br/>using Authorization Code in headers
	Server->>IdP: Is this Authorization Code valid?<br/>If yes, then return an Access Token
	IdP->>Server: Sent an Access Token
	Server->>IdP: Given this Access Token,<br />return user profile info
	IdP->>Server: User Profile info
	Server->>Browser: response of GET /my-data
	

OAuth2 - Client Credentials (API)

image.png
original
Mermaid
sequenceDiagram
  autonumber
  participant ClientApp as Client App
  participant Server as Service
  participant IdP as IdP (Keycloak)
	ClientApp->>IdP: Authenticate<br />Client ID + Client Secret
	IdP->>ClientApp: ID + Secret are valid<br />Return Access Token
	ClientApp->>Server: GET /api/resource<br />using Access Token in headers
	Server->>IdP: Access Token valid?
	IdP->>Server: Yes, is valid
	Server->>ClientApp: response GET /api/resource