Certificats dynamiques pas chargés au démarrage ? #6

Closed
opened 2023-05-17 09:22:17 +00:00 by quentin · 1 comment
Owner

Parfois Tricot renvoie des erreurs SSL, ça semble être le cas sur les sites webs auxquels on accède peu souvent. Des logs qui peuvent être intéressants :

$ nomad alloc logs -stderr bd8e36f4-d1b5-e371-c246-a4f3376eb1e9 server|grep example
 INFO  tricot::cert_store    > Added self-signed certificate for example.osuny.org
 DEBUG tricot::cert_store    > Checking cert for domain: example.osuny.org
 DEBUG tricot::https         > example.osuny.org/assets/css/extranet.min.css -> 10.83.1.1:3902 Pattern('*') 1 OURSELF SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
 INFO  tricot::https         > GET 200 https://example.osuny.org/assets/css/extranet.min.css
 DEBUG tricot::https         > example.osuny.org/assets/css/extranet.min.css -> 10.83.1.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
 DEBUG tricot::https         > example.osuny.org/js/extranet.js -> 10.83.1.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
 INFO  tricot::https         > GET 200 https://example.osuny.org/js/extranet.js

Cette alloc a été démarrée il y a ~3h (le 17 mai à 8h58).

$ nomad alloc logs -stderr 851d08f5-363a-fb78-c045-90d04d44087b server|grep example
INFO  tricot::cert_store   > Added self-signed certificate for example.osuny.org
INFO  tricot::cert_store   > Added self-signed certificate for example.osuny.org
DEBUG tricot::cert_store   > Checking cert for domain: example.osuny.org
DEBUG tricot::https        > example.osuny.org/ -> 10.83.2.1:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
INFO  tricot::https        > GET 200 https://example.osuny.org/
DEBUG tricot::https        > example.osuny.org/assets/css/main.min.84e40231b8023be59d58d1d7b5430d94219e1b7565a69189861760456469856a.css -> 10.83.2.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
DEBUG tricot::https        > example.osuny.org/assets/images/logo.svg -> 10.83.2.2:3902 Pattern('*') 1 OURSELF SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")]
...

Cette alloc a été démarrée il y a ~3h (le 17 mai à 8h08 - c'est pas une erreur, c'est bien 08 et pas 58).

Sur les autres allocations pas de référence à la génération d'un certificat self-signed. Les autres allocations ont été démarré il y a 7 jours.

Hypothèse : les certificats générés à la volée ne sont pas chargés au démarrage de tricot.
Remédiation possible : charger tous les certificats au démarrage de tricot et pas seulement ceux qui sont declare dans le service Consul

Parfois Tricot renvoie des erreurs SSL, ça semble être le cas sur les sites webs auxquels on accède peu souvent. Des logs qui peuvent être intéressants : ``` $ nomad alloc logs -stderr bd8e36f4-d1b5-e371-c246-a4f3376eb1e9 server|grep example INFO tricot::cert_store > Added self-signed certificate for example.osuny.org DEBUG tricot::cert_store > Checking cert for domain: example.osuny.org DEBUG tricot::https > example.osuny.org/assets/css/extranet.min.css -> 10.83.1.1:3902 Pattern('*') 1 OURSELF SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] INFO tricot::https > GET 200 https://example.osuny.org/assets/css/extranet.min.css DEBUG tricot::https > example.osuny.org/assets/css/extranet.min.css -> 10.83.1.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] DEBUG tricot::https > example.osuny.org/js/extranet.js -> 10.83.1.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] INFO tricot::https > GET 200 https://example.osuny.org/js/extranet.js ``` Cette alloc a été démarrée il y a ~3h (le 17 mai à 8h58). ``` $ nomad alloc logs -stderr 851d08f5-363a-fb78-c045-90d04d44087b server|grep example INFO tricot::cert_store > Added self-signed certificate for example.osuny.org INFO tricot::cert_store > Added self-signed certificate for example.osuny.org DEBUG tricot::cert_store > Checking cert for domain: example.osuny.org DEBUG tricot::https > example.osuny.org/ -> 10.83.2.1:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] INFO tricot::https > GET 200 https://example.osuny.org/ DEBUG tricot::https > example.osuny.org/assets/css/main.min.84e40231b8023be59d58d1d7b5430d94219e1b7565a69189861760456469856a.css -> 10.83.2.3:3902 Pattern('*') 1 SAME_SITE SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] DEBUG tricot::https > example.osuny.org/assets/images/logo.svg -> 10.83.2.2:3902 Pattern('*') 1 OURSELF SITE-LB +Headers: [("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload"), ("X-Frame-Options", "SAMEORIGIN"), ("X-XSS-Protection", "1; mode=block")] ... ``` Cette alloc a été démarrée il y a ~3h (le 17 mai à 8h08 - c'est pas une erreur, c'est bien 08 et pas 58). Sur les autres allocations pas de référence à la génération d'un certificat self-signed. Les autres allocations ont été démarré il y a 7 jours. Hypothèse : les certificats générés à la volée ne sont pas chargés au démarrage de tricot. Remédiation possible : charger tous les certificats au démarrage de tricot et pas seulement ceux qui sont declare dans le service Consul
quentin changed title from Erreur SSL de temps en temps to Certificats dynamiques pas chargés au démarrage ? 2023-05-17 09:36:29 +00:00
Author
Owner

Je pense que c'est bien ça, si on regarde les logs, on voit qu'en fait un certif auto-signé est généré pour tous les sites hosted sur Garage la première fois qu'ils sont requêtés au redémarrage du proxy :

$ nomad alloc logs -stderr bd8e36f4-d1b5-e371-c246-a4f3376eb1e9 server|grep 'Added self-signed certificate for'|wc -l
47
$ nomad alloc logs -stderr 851d08f5-363a-fb78-c045-90d04d44087b server|grep 'Added self-signed certificate for'|wc -l
68
Je pense que c'est bien ça, si on regarde les logs, on voit qu'en fait un certif auto-signé est généré pour tous les sites hosted sur Garage la première fois qu'ils sont requêtés au redémarrage du proxy : ``` $ nomad alloc logs -stderr bd8e36f4-d1b5-e371-c246-a4f3376eb1e9 server|grep 'Added self-signed certificate for'|wc -l 47 ``` ``` $ nomad alloc logs -stderr 851d08f5-363a-fb78-c045-90d04d44087b server|grep 'Added self-signed certificate for'|wc -l 68
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/tricot#6
No description provided.