SlideShare a Scribd company logo
1 of 32
Mickaël HUBERT - Ingénieur VoIP
Retour d’expérience sur la mise en
place d’un SSO open-source
SSO, c’est quoi ?
SSO, Single Sign-On
“Une seule connexion”
Mécanisme permettant d'accéder à de nombreuses
applications en ne s’identifiant qu’une seule fois
Méthodes pour se loguer
source: https://ja.confluence.atlassian.com
OpenID-Connect
Tokens retournés
{
"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ6
Szd2T1dZR0tNdkdNZFBWaEdieGJ6REN6VFR2aXRWekVESURQVWxad1gwIn0.eyJleHAiOjE2
NjMwODIyNTAsImlhdCI6MTY2MzA4MTk1MCwiYXV0aF90aW1lIjoxNjYzMDgxOTQ5LCJqdGki
OiI2Mjlm…",
"expires_in":300,
"refresh_expires_in":1800,
"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI
2Y2EwMjdlMS1lNzFhLTQyMTgtOTNkMy1kZDZlMDE5MDMwZDEifQ.eyJleHAiOjE2NjMwODM3
NTAsImlhdCI6MTY2MzA4MTk1MCwianRpIjoiM2Y3ZDQ4MzItNjZiMi00YjgxLWE0MTMtMzBk
ZjY4…",
"token_type":"Bearer",
"id_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ6Szd2
T1dZR0tNdkdNZFBWaEdieGJ6REN6VFR2aXRWekVESURQVWxad1gwIn0.eyJleHAiOjE2NjMw
ODIyNTAsImlhdCI6MTY2MzA4MTk1MCwiYXV0aF90aW1lIjoxNjYzMDgxOTQ5LCJqdGkiOiJl
ZjExNTQ3Mi1lNGRmLTQ4ZjktODc4MS1lYmMwZTI4Nzk1MTkiLCJpc3MiOiJodHRwczov…",
"session_state":"164cb0cf-d601-4cc7-8d9d-26afc159ea79",
"scope":"openid profile email"
}
JWT
source: https://research.securitum.com/jwt-json-web-token-
security/
Pour quoi faire ?
(chez Allo-Media)
L’existant
H2H H2B SFTP
VOIP
Ex|Intranets MRCP
L’internet
SIPREC
Besoins:
- Connexion à nos outils en passant par le SSO d’un de nos gros clients
- Centralisation des comptes utilisateurs (internes / externes)
- Standardiser tout en sécurisant l’accès à nos divers Extranets / API
- Ne pas maintenir une solution d’authentification "ad hoc" par API
- Eviter la redondance de code dans les appli
- Alléger le code
- Étude de solutions payantes SAAS (Auth0, Okta, Azure, etc…)
- Bien trop chères pour nos finances
- SLA uniquement sur les offres Enterprise (plus onéreuses)
- Manque de fonctionnalités sur les offres entrée de gamme
- Étude de solutions on premise
- Mise en place d’un proto de Keycloak, prise en main du produit
Comment ?
- Pas de frais de licence != gratuit !
- Souplesse du produit (ajout de endpoints, modification du fonctionnement)
- Communauté
- Intégration 100% interne (en France)
- Maîtrise 100% interne
Pourquoi l’open-source ?
Keycloak
- Realms
- Clients (applications)
- Scopes
- Roles
- Identity providers
- User federation (LDAP)
- Groups
- Brute force detection
- Users
- User registration
- Verify email
- Edit username
- Remember me
- Internationalization
- Theme
- Password policy
- OTP
Côté infra ?
- Faciliter le déploiement (Ansible)
- Sécurisation de l’outil (ouvert sur L’internet)
- Redondance (double data center)
- Faciliter l’exploitation des logs (Graylog)
- Faciliter l’exploitation des métriques (Prometheus + Grafana)
- Développement de script de monitoring (Icinga2)
Faciliter
le
déploiement
DEV
+
+
Faciliter
le
déploiement Staging /
Production
Sécurité # Extrait de configuration HaProxy
# Blocage de certains endpoints
acl acl_1 path_beg /js/ /realms/ /resources/ /robots.txt
acl acl_2 path_beg /realms/master
acl acl_3 path_reg -i ^/realms/.*/health/check.*
acl acl_4 path_reg -i ^/realms/.*/metrics
http-request deny if acl_2
http-request deny if acl_3
http-request deny if acl_4
http-request allow if acl_1
http-request deny
https://id.monsso.fr/js/keycloak.js
https://id.monsso.fr/realms/master
https://id.monsso.fr/realms/client1/protocol/
http://id.monsso.fr/realms/client1/metrics/
Redondance
Faciliter
l’exploitation
des
logs
– (quarkus-logging-gelf) →
Faciliter
l’exploitation
des
métriques
– (keycloak-metrics-spi) → +
Développement
de
script
de
monitoring
– (keycloak-health-checks) →
{
"name": "keycloak",
"state": "UP",
"details": {
"database": {
"connection": "established",
"state": "UP"
},
"filesystem": {
"freebytes": 37773889536,
"state": "UP"
},
"infinispan": {
"hostInfo": {
"numberOfCpus": 2,
"totalMemoryKb": 197632,
"freeMemoryInKb": 61581
},
"clusterName": "allocluster",
"healthStatus": "HEALTHY",
"numberOfNodes": 2,
"nodeNames": [
"keycloak-1-2120",
"keycloak-2-28633"
],
"cacheDetails": [
{
"cacheName": "realms",
"healthStatus": "HEALTHY"
},
{
"cacheName": "authenticationSessions",
"healthStatus": "HEALTHY"
},
…
Côté appli ?
- H2H (Humain 2 Humain)
- Websocket
- Elixir
- Temps réel
- Client type confidential (client_id / client_secret)
- Utilisation de JWKS (mise en cache des clés publiques)
- Réception d’audio long / transcription / enrichissement / retourne le texte en json
- H2B (Humain to bot) ⇒ == MRCP
- Websocket
- Rust
- Temps réel
- Client type confidential (client_id / client_secret)
- Utilisation de JWKS (mise en cache des clés publiques)
- Réception d’audio très court / transcription / builtin / retourne le texte en json
Côté appli ?
- Extranets (front)
- Vue JS
- Client type public (username / password)
- Utilisation de JWKS (mise en cache des clés publiques)
- problèmes actuels
- Multi realm → demande de l’email dès le départ, afin de router la demande
d’authentification au bon ID provider
- Problème dans la lib JS de Keycloak avec la dernière version de Firefox
Côté appli ?
- API Back
- Python (django)
- Client type confidential (client_id / client_secret)
- Utilisation de JWKS (mise en cache des clés publiques)
- Echange d’informations avec le front (transcriptions, tags, audio, etc …)
Benchmark
- Outil dédié: https://github.com/keycloak/keycloak-benchmark
- Déjà beaucoup de scénarios de tests
exemples :
- keycloak.scenario.authentication.ClientSecret
- keycloak.scenario.authentication.LoginUserPassword
- keycloak.scenario.admin.CreateUsers
- keycloak.scenario.authentication.AuthorizationCode
Benchmark
- Résultats CLI avec 300 users simultanés et en moyenne 407 requêtes / s:
Simulation keycloak.scenario.authentication.ClientSecret completed in 36 seconds
Parsing log file(s)...
Parsing log file(s) done
Generating reports...
================================================================================
---- Global Information --------------------------------------------------------
> request count 15092 (OK=15092 KO=0 )
> min response time 67 (OK=67 KO=- )
> max response time 5902 (OK=5902 KO=- )
> mean response time 663 (OK=663 KO=- )
> std deviation 214 (OK=214 KO=- )
> response time 50th percentile 685 (OK=685 KO=- )
> response time 75th percentile 745 (OK=745 KO=- )
> response time 95th percentile 844 (OK=844 KO=- )
> response time 99th percentile 935 (OK=935 KO=- )
> mean requests/sec 407.892 (OK=407.892 KO=- )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms 13426 ( 89%)
> 800 ms < t < 1200 ms 1635 ( 11%)
> t > 1200 ms 31 ( 0%)
> failed 0 ( 0%)
================================================================================
Reports generated in 0s.
Please open the following file: /home/mhubert/…/keycloak-benchmark/keycloak-benchmark-0.8-SNAPSHOT/results/clientsecret-
20220916135435056/index.html
Global: percentage of failed events is less than or equal to 0.0 : true
Global: mean of response time is less than or equal to 300.0 : false
Benchmark
- Résultats GUI:
Benchmark
- Résultats GUI:
Benchmark
- Résultats GUI:
Au final
H2H H2B SFTP
VOIP
Ex|Intranets MRCP
L’internet
SIPREC
SSO possible LDAP ?
Ce qu’il reste à faire
A court terme:
- Mettre en prod
- Tester plus en profondeur la sécurité et la robustesse (par nous-même)
- https://research.securitum.com/jwt-json-web-token-security/
- 1 journée / mois bug bounty
A moyen terme:
- Intégrer LDAP
- Marque blanche / autonomie de nos clients (client_registration)
- Ex: s’inscrire et obtenir 1H de service gratuit (reco, enrich, etc …)
For more informations : uh.live
Thanks for watching
https://github.com/Mickaelh51
https://fr.linkedin.com/in/sipengineer
On recrute:
https://uh.live/fr/backend-job

More Related Content

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Présentation mise en place d'une solution SSO open source #Keycloak