chkcert_V1R1M1.py
Certificate Information & Control Tool — Un outil, tous les formats de keystore Certificate Information & Control Tool — One tool, all keystore formats Certificate Information & Control Tool — Una herramienta, todos los formatos de almacén
Résumé exécutifExecutive SummaryResumen ejecutivo
chkcert_V1R1M1.py est un outil CLI Python mono-fichier destiné à l'inspection, l'audit et le reporting de certificats TLS/PKI dans des environnements d'infrastructure variés. Il couvre l'intégralité du spectre des keystores rencontrés en entreprise : IBM MQ/GSKit (.kdb), Java (.jks, .p12, .jceks), formats ouverts (.pem, .der, .p7b, .csr) et le truststore Java cacerts.
is a single-file Python CLI tool for the inspection, audit and reporting of TLS/PKI certificates across varied infrastructure environments. It covers the full spectrum of keystores found in the enterprise: IBM MQ/GSKit (.kdb), Java (.jks, .p12, .jceks), open formats (.pem, .der, .p7b, .csr) and the Java cacerts truststore.
es una herramienta CLI Python de un solo fichero para la inspección, auditoría e informe de certificados TLS/PKI en entornos de infraestructura variados. Cubre todo el espectro de almacenes de claves presentes en la empresa: IBM MQ/GSKit (.kdb), Java (.jks, .p12, .jceks), formatos abiertos (.pem, .der, .p7b, .csr) y el almacén de confianza Java cacerts.
Il fonctionne en mode local ou remote SSH/SFTP, génère des rapports HTML et JSON auto-contenus, et est conçu pour être compilé avec Nuitka en binaire standalone ou onefile pour déploiement sans Python sur les serveurs cibles. It runs in local or remote SSH/SFTP mode, generates self-contained HTML and JSON reports, and is designed to be compiled with Nuitka into a standalone or onefile binary for Python-free deployment on target servers. Funciona en modo local o remoto SSH/SFTP, genera informes HTML y JSON autónomos, y está diseñado para compilarse con Nuitka como binario standalone u onefile para un despliegue sin Python en los servidores destino.
Pourquoi cet outil ?Why this tool?¿Por qué esta herramienta? Dans les grandes infrastructures, les certificats sont répartis entre des dizaines de keystores hétérogènes, sur des plateformes différentes (Linux, Windows, AIX), gérés par des équipes distinctes. Aucun outil du marché ne couvre l'ensemble de ces formats en ligne de commande, sans agent, sans serveur central. chkcert comble ce manque avec une approche sans installation, sans dépendance sur le serveur cible. In large infrastructures, certificates are spread across dozens of heterogeneous keystores, on different platforms (Linux, Windows, AIX), managed by separate teams. No tool on the market covers this full set of formats from the command line, agentless, with no central server. chkcert fills this gap with an install-free approach, with no dependency on the target server. En las grandes infraestructuras, los certificados se reparten entre decenas de almacenes heterogéneos, en plataformas distintas (Linux, Windows, AIX), gestionados por equipos separados. Ninguna herramienta del mercado cubre todo este conjunto de formatos en línea de comandos, sin agente, sin servidor central. chkcert cubre este vacío con un enfoque sin instalación, sin dependencia en el servidor destino.
Contexte & enjeuxContext & ChallengesContexto y retos
Le problème des cycles courts des Autorités de CertificationThe problem of short CA certificate cyclesEl problema de los ciclos cortos de las Autoridades de Certificación
Depuis 2020, les grandes AC (DigiCert, Sectigo, GlobalSign, Let's Encrypt) ont progressivement réduit la durée de validité maximale des certificats TLS : Since 2020, the major CAs (DigiCert, Sectigo, GlobalSign, Let's Encrypt) have progressively shortened the maximum validity period of TLS certificates: Desde 2020, las grandes AC (DigiCert, Sectigo, GlobalSign, Let's Encrypt) han reducido progresivamente el período de validez máximo de los certificados TLS:
- Avant 2020 :Before 2020:Antes de 2020: certificats valables jusqu'à 3 ans (1095 jours)certificates valid for up to 3 years (1095 days)certificados válidos hasta 3 años (1095 días)
- 2020 : passage à 398 jours maximum (13 mois)shift to 398 days maximum (13 months)paso a 398 días máximo (13 meses)
- 2023 : Apple/Mozilla poussent vers 90 jours (Let's Encrypt)Apple/Mozilla push toward 90 days (Let's Encrypt)Apple/Mozilla empujan hacia 90 días (Let's Encrypt)
- 2026–2027 : Google Chrome impose 90 jours maximum pour les certificats DV/OV publics. CA/Browser Forum vote en faveur de 47 jours d'ici 2027.Google Chrome mandates 90 days maximum for public DV/OV certificates. CA/Browser Forum votes in favour of 47 days by 2027.Google Chrome impone 90 días máximo para los certificados DV/OV públicos. El CA/Browser Forum vota a favor de 47 días para 2027.
Cette réduction drastique rend le suivi manuel des expirations impossible à l'échelle — un parc de 50 keystores nécessite potentiellement 200+ renouvellements par an si les cycles passent à 47 jours. This drastic reduction makes manual expiry tracking impossible at scale — a fleet of 50 keystores potentially needs 200+ renewals per year once cycles drop to 47 days. Esta drástica reducción hace que el seguimiento manual de expiraciones sea imposible a escala — un parque de 50 almacenes necesitará potencialmente 200+ renovaciones al año si los ciclos bajan a 47 días.
L'hétérogénéité des formats : le défi des grandes infrastructuresFormat heterogeneity: the challenge of large infrastructuresLa heterogeneidad de formatos: el reto de las grandes infraestructuras
Une infrastructure financière ou industrielle typique mêle :A typical financial or industrial infrastructure mixes:Una infraestructura financiera o industrial típica combina:
Chaque format nécessite un outil différent. chkcert unifie l'analyse de tous ces formats sous une interface CLI commune et une sortie JSON homogène. Each format requires a different tool. chkcert unifies the analysis of all these formats under a common CLI interface and a homogeneous JSON output. Cada formato requiere una herramienta diferente. chkcert unifica el análisis de todos estos formatos bajo una interfaz CLI común y una salida JSON homogénea.
Incidents réels — le coût des certificats expirésReal incidents — the cost of expired certificatesIncidentes reales — el coste de los certificados caducados
Les expirations de certificats ne sont pas anodines. Voici des incidents documentés qui illustrent l'enjeu :Certificate expirations are not trivial. Here are documented incidents that illustrate the stakes:Las expiraciones de certificados no son triviales. Estos son incidentes documentados que ilustran lo que está en juego:
Microsoft Teams est devenu inaccessible dans le monde entier pendant environ 3 heures. La cause racine était l'expiration d'un certificat TLS utilisé pour l'authentification des services. Des millions de salariés se sont trouvés dans l'incapacité de communiquer, d'accéder aux fichiers partagés ou de rejoindre des réunions. L'incident est survenu un lundi matin, en pleine heure de pointe. Microsoft Teams became unreachable worldwide for about 3 hours. The root cause was the expiry of a TLS certificate used for service authentication. Millions of employees were unable to communicate, access shared files, or join meetings. The incident occurred on a Monday morning, at peak hours. Microsoft Teams quedó inaccesible en todo el mundo durante unas 3 horas. La causa raíz fue la expiración de un certificado TLS usado para la autenticación de servicios. Millones de empleados no pudieron comunicarse, acceder a ficheros compartidos ni unirse a reuniones. El incidente ocurrió un lunes por la mañana, en plena hora punta.
→ Coût estimé : plusieurs millions d'euros en perte de productivité (entreprises utilisant Teams comme outil principal).Estimated cost: several million euros in lost productivity (companies using Teams as their primary tool).Coste estimado: varios millones de euros en pérdida de productividad (empresas que usan Teams como herramienta principal).
Un certificat expiré dans le logiciel de gestion réseau d'Ericsson a provoqué la désactivation simultanée de réseaux 4G chez une douzaine d'opérateurs mondiaux. En Grande-Bretagne, O2 a perdu 32 millions d'abonnés pendant 11 heures. Les systèmes de paiement sans contact, les terminaux de point de vente et les applications de transport en commun ont été paralysés. An expired certificate in Ericsson's network management software caused the simultaneous shutdown of 4G networks at a dozen global operators. In Britain, O2 lost 32 million subscribers for 11 hours. Contactless payment systems, point-of-sale terminals and public transit apps were paralysed. Un certificado caducado en el software de gestión de red de Ericsson provocó la desactivación simultánea de redes 4G en una docena de operadores globales. En Gran Bretaña, O2 perdió 32 millones de abonados durante 11 horas. Los sistemas de pago sin contacto, los terminales de punto de venta y las aplicaciones de transporte público quedaron paralizados.
→ Coût Ericsson : ~95 millions d'euros en compensation + atteinte massive à la réputation.Ericsson's cost: ~€95 million in compensation + massive reputational damage.Coste de Ericsson: ~95 millones de euros en compensaciones + un daño reputacional masivo.
Spotify a subi une interruption de service sur son application mobile et web suite à l'expiration d'un certificat TLS sur un composant interne d'authentification. L'incident s'est produit en dehors des heures de bureau, retardant la détection. Spotify suffered a service outage on its mobile and web app following the expiry of a TLS certificate on an internal authentication component. The incident occurred outside office hours, delaying detection. Spotify sufrió una interrupción del servicio en su aplicación móvil y web tras la expiración de un certificado TLS en un componente interno de autenticación. El incidente ocurrió fuera del horario de oficina, retrasando su detección.
→ Perte estimée en abonnements + dommage image en période de forte concurrence (Apple Music, Amazon Music).Estimated subscription loss + brand damage amid fierce competition (Apple Music, Amazon Music).Pérdida estimada de suscripciones + daño de imagen en un período de fuerte competencia (Apple Music, Amazon Music).
L'expiration d'un certificat CA intermédiaire a rompu la chaîne de confiance SSL de LinkedIn, rendant le site inaccessible sur certains navigateurs et clients mobiles. Ce type d'incident illustre que le certificat leaf n'est pas le seul à surveiller — les CA intermédiaires ont également des dates d'expiration. The expiry of an intermediate CA certificate broke LinkedIn's SSL trust chain, making the site unreachable on some browsers and mobile clients. This type of incident shows that the leaf certificate isn't the only one to watch — intermediate CAs also have expiry dates. La expiración de un certificado de CA intermedia rompió la cadena de confianza SSL de LinkedIn, dejando el sitio inaccesible en algunos navegadores y clientes móviles. Este tipo de incidente muestra que el certificado leaf no es el único a vigilar — las CA intermedias también tienen fechas de expiración.
📌 Ce que chkcert apporte :What chkcert brings:Lo que aporta chkcert:
La simulation de date (--date 2038-12-31) permet de projeter dans le futur et de détecter les expirations avant qu'elles ne surviennent — y compris sur les CA intermédiaires et racines. Les fichiers JSON joints à ce rapport illustrent précisément ce cas : des certificats Sectigo analysés avec date de référence 2038-12-31 révèlent une expiration de 1014 jours.
Date simulation (--date 2038-12-31) lets you project into the future and detect expirations before they happen — including on intermediate and root CAs. The JSON files attached to this report illustrate exactly this case: Sectigo certificates analysed with a 2038-12-31 reference date reveal a 1014-day expiry.
La simulación de fecha (--date 2038-12-31) permite proyectarse al futuro y detectar expiraciones antes de que ocurran — incluso en CA intermedias y raíz. Los ficheros JSON adjuntos a este informe ilustran precisamente este caso: certificados Sectigo analizados con fecha de referencia 2038-12-31 revelan una expiración de 1014 días.
Métriques clésKey MetricsMétricas clave
| Dimension | Valeur | Détail |
|---|---|---|
| Dépendances tierces obligatoires | 1 | cryptography (paramiko optionnel — mode remote) |
| OS supportés | 4 | Windows, Linux, macOS, AIX (via binaire Nuitka) |
| Compatibilité compilateur | Nuitka | --onefile + --standalone, NUITKA_ONEFILE_PARENT géré |
| Encodage cible | UTF-8 | Avec reconfigure() pour Windows |
| Taille min RSA (défaut) | 2048 bits | Plancher absolu — surchargeable à la hausse via constantes_V1R1M1.properties |
| Taille RSA pour les CSR générés | 4096 bits | Surcharger via constantes_V1R1M1.properties |
| Taille min clé EC | 224 bits | MIN_EC_KEY_SIZE — P-256/P-384/P-521 tous valides |
| Profondeur max chaîne de cert | 20 | _CHAIN_MAX_DEPTH |
| Seuil clé faible/désactivée | ≤ 1024 bits | WEAK_KEY_THRESHOLD (fixe dans le code, RSA/DSA uniquement) |
| Dimension | Value | Detail |
|---|---|---|
| Mandatory third-party dependencies | 1 | cryptography (paramiko optional — remote mode) |
| Supported OS | 4 | Windows, Linux, macOS, AIX (via Nuitka binary) |
| Compiler compatibility | Nuitka | --onefile + --standalone, NUITKA_ONEFILE_PARENT handled |
| Target encoding | UTF-8 | With reconfigure() for Windows |
| Min RSA size (default) | 2048 bits | Absolute floor — overridable upward via constantes_V1R1M1.properties |
| RSA size for generated CSRs | 4096 bits | Override via constantes_V1R1M1.properties |
| Min EC key size | 224 bits | MIN_EC_KEY_SIZE — P-256/P-384/P-521 all valid |
| Max cert chain depth | 20 | _CHAIN_MAX_DEPTH |
| Weak/disabled key threshold | ≤ 1024 bits | WEAK_KEY_THRESHOLD (fixed in code, RSA/DSA only) |
| Dimensión | Valor | Detalle |
|---|---|---|
| Dependencias de terceros obligatorias | 1 | cryptography (paramiko opcional — modo remoto) |
| SO soportados | 4 | Windows, Linux, macOS, AIX (vía binario Nuitka) |
| Compatibilidad del compilador | Nuitka | --onefile + --standalone, NUITKA_ONEFILE_PARENT gestionado |
| Codificación destino | UTF-8 | Con reconfigure() para Windows |
| Tamaño RSA mínimo (por defecto) | 2048 bits | Límite absoluto — ajustable al alza vía constantes_V1R1M1.properties |
| Tamaño RSA para los CSR generados | 4096 bits | Ajustar vía constantes_V1R1M1.properties |
| Tamaño mínimo de clave EC | 224 bits | MIN_EC_KEY_SIZE — P-256/P-384/P-521 todas válidas |
| Profundidad máx. de cadena | 20 | _CHAIN_MAX_DEPTH |
| Umbral de clave débil/desactivada | ≤ 1024 bits | WEAK_KEY_THRESHOLD (fijo en el código, solo RSA/DSA) |
Plateformes ciblesTarget platformsPlataformas objetivo — Unix & Windows
chkcert est conçu pour fonctionner de manière identique sur toutes les plateformes d'infrastructure rencontrées en entreprise. Le binaire Nuitka onefile supprime toute dépendance à Python sur le serveur cible. chkcert is designed to run identically across every infrastructure platform found in the enterprise. The Nuitka onefile binary removes any Python dependency on the target server. chkcert está diseñado para funcionar de forma idéntica en todas las plataformas de infraestructura presentes en la empresa. El binario Nuitka onefile elimina cualquier dependencia de Python en el servidor destino.
🐧 Linux — Distribution principaleLinux — Primary distributionLinux — Distribución principal
Environnement naturel de l'outil. Testé sur RHEL/AlmaLinux, Ubuntu, Debian. Compatible avec les systèmes de fichiers case-sensitive. Supports ANSI natif. The tool's natural environment. Tested on RHEL/AlmaLinux, Ubuntu, Debian. Compatible with case-sensitive filesystems. Native ANSI support. Entorno natural de la herramienta. Probado en RHEL/AlmaLinux, Ubuntu, Debian. Compatible con sistemas de ficheros sensibles a mayúsculas. Soporte ANSI nativo.
Outils externesExternal toolsHerramientas externas : runmqakm (IBM MQ), gsk8capicmd_64 (GSKit), keytool (JDK)
🪟 Windows — Support completWindows — Full supportWindows — Soporte completo
Activation automatique des codes ANSI via GetConsoleMode / SetConsoleMode (ENABLE_VIRTUAL_TERMINAL_PROCESSING). Encodage UTF-8 forcé via reconfigure(). Séparateurs de chemins normalisés.
Automatic ANSI code activation via GetConsoleMode / SetConsoleMode (ENABLE_VIRTUAL_TERMINAL_PROCESSING). UTF-8 encoding forced via reconfigure(). Normalised path separators.
Activación automática de códigos ANSI vía GetConsoleMode / SetConsoleMode (ENABLE_VIRTUAL_TERMINAL_PROCESSING). Codificación UTF-8 forzada vía reconfigure(). Separadores de ruta normalizados.
Compatible PowerShell, cmd.exe, Windows Terminal. Binaire .exe via Nuitka --windows-console-mode=attachCompatible with PowerShell, cmd.exe, Windows Terminal. .exe binary via Nuitka --windows-console-mode=attachCompatible con PowerShell, cmd.exe, Windows Terminal. Binario .exe vía Nuitka --windows-console-mode=attach
🍎 macOS
Tests partiels sur macOS. Pas de runmqakm natif en général (ANSI fonctionnels).
Partial testing on macOS. No native runmqakm in general (ANSI functional).
Pruebas parciales en macOS. Sin runmqakm nativo en general (ANSI funcional).
⚙️ AIX / IBM i
Supporté via le binaire Nuitka compilé sur Linux et copié sur AIX (si compatible ABI). Principal usage : analyse des keystores IBM MQ sur plateformes Unix propriétaires. Python n'est pas requis sur AIX. Supported via the Nuitka binary compiled on Linux and copied to AIX (if ABI-compatible). Main use case: analysing IBM MQ keystores on proprietary Unix platforms. Python is not required on AIX. Soportado mediante el binario Nuitka compilado en Linux y copiado a AIX (si es compatible a nivel ABI). Uso principal: análisis de almacenes IBM MQ en plataformas Unix propietarias. Python no es necesario en AIX.
Gestion des outils externes par OSExternal tools management by OSGestión de herramientas externas por SO
| Format | Linux/AIX | Windows | macOS |
|---|---|---|---|
| .kdb | runmqakm · gsk8capicmd_64 | runmqakm.exe · gsk8capicmd.exe | gsk8capicmd (GSKit macOS rare) |
| .jks .p12 | keytool · runmqktool | keytool.exe · runmqktool.exe | keytool (JDK macOS) |
| .pem .der .p7b .csr | aucun — cryptography purenone — pure cryptographyninguna — cryptography puro | aucun — cryptography purenone — pure cryptographyninguna — cryptography puro | aucun — cryptography purenone — pure cryptographyninguna — cryptography puro |
| cacerts | keytool auto-détectéauto-detectedautodetectado | keytool.exe auto-détectéauto-detectedautodetectado | keytool auto-détectéauto-detectedautodetectado |
💡 Principe fondamental :Core principle:Principio fundamental:
Python et cryptography ne sont jamais requis sur le serveur cible en mode remote. Seul SSH/SFTP est nécessaire. Toute l'analyse s'effectue en local sur la machine de l'opérateur.
Python and cryptography are never required on the target server in remote mode. Only SSH/SFTP is needed. All analysis happens locally on the operator's machine.
Python y cryptography nunca son necesarios en el servidor destino en modo remoto. Solo se necesita SSH/SFTP. Todo el análisis se realiza localmente en la máquina del operador.
ArchitectureArchitectureArquitectura généraleoverviewgeneral
Le script est mono-fichier et se décompose en 12 couches logiques : The script is single-file and breaks down into 12 logical layers: El script es de un solo fichero y se descompone en 12 capas lógicas:
__main__
├─ init couleurs + quiet mode
├─ argparse → args
├─ _ctx.reset_all()
├─ résolution de password (_resolve_password)
├─ construction de files_to_process
│ ├─ --remote → _run_remote_analysis() [SFTP]
│ ├─ --dir → rglob + filtre extensions
│ └─ --file → glob ou chemin direct
└─ for file in files_to_process:
├─ trial preflight (_trial_preflight, si non licencié)
├─ process_one_file()
│ └─ detect_file_type() → _dispatch_file()
│ ├─ process_pem() .cer .pem .crt .arm .der
│ ├─ process_p7b() .p7b
│ ├─ process_kdb() .kdb [runmqakm/gsk]
│ ├─ process_java_keystore() .p12 .pfx .jks .jck .jceks
│ ├─ process_cacerts() cacerts JKS
│ └─ process_csr() .csr
├─ show_chain_summary / show_chain_serial
├─ show_diagnostics_resume()
├─ show_remediation_report() [si --report + mono-fichier]
└─ generate_json_output / generate_html_output [si --output]
Un outil — tous les formats de keystoreOne tool — all keystore formatsUna herramienta — todos los formatos de almacén
C'est la valeur ajoutée centrale de chkcert : une seule commande, quelle que soit la technologie du keystore. L'outil détecte automatiquement le format et appelle l'outil externe approprié ou utilise la librairie Python cryptography directement.
This is chkcert's central value proposition: a single command, regardless of the keystore technology. The tool automatically detects the format and calls the right external tool, or uses the Python cryptography library directly.
Este es el valor añadido central de chkcert: un único comando, sea cual sea la tecnología del almacén. La herramienta detecta automáticamente el formato y llama a la herramienta externa adecuada, o usa directamente la biblioteca Python cryptography.
| Extension(s) | Format | Outil requisRequired toolHerramienta requerida | Encodage autoAuto-detect encodingCodificación auto | CSRs | Usage typiqueTypical useUso típico |
|---|---|---|---|---|---|
| .kdb / .cms | IBM MQ CMS/GSKit | runmqakm · gsk8capicmd_64 | — | ✓ | WebSphere, MQ Channel SSL |
| .jks / .jck / .jceks | Java KeyStore | keytool · runmqktool | — | — | Tomcat, Spring, WAS |
| .p12 / .pfx / .pkcs12 | PKCS#12 | keytool | — | — | IIS, Exchange, Java |
| .pem / .cer / .crt / .arm | X.509 PEM / DER auto-détectéauto-detectedautodetectado | aucunnoneninguna | ✓ | — | Nginx, Apache, HAProxy |
| .der | X.509 DER binairebinarybinario | aucunnoneninguna | ✓ | — | Exports Microsoft, Java |
| .p7b | PKCS#7 bundle | aucunnoneninguna | ✓ | — | Chaînes AC intermédiairesIntermediate CA chainsCadenas de AC intermedias |
| .csr | Certificate Signing Request | aucunnoneninguna | ✓ | N/A | Pipeline de renouvellementRenewal pipelinePipeline de renovación |
| cacerts (JKS) | Java cacerts truststore | keytool (auto-detect JDK) | — | — | Audit du truststore JVMJVM truststore auditAuditoría del almacén JVM |
✅ Auto-détection PEM/DER :PEM/DER auto-detection:Autodetección PEM/DER:
_detect_pem_or_der() utilise une heuristique à 4 règles — marqueurs PEM (-----BEGIN), tag ASN.1 0x30, validité UTF-8, fallback binaire — sans se fier uniquement à l'extension fichier. Un fichier .cer peut être PEM ou DER : chkcert le détecte automatiquement.
_detect_pem_or_der() uses a 4-rule heuristic — PEM markers (-----BEGIN), ASN.1 0x30 tag, UTF-8 validity, binary fallback — rather than trusting the file extension alone. A .cer file can be PEM or DER: chkcert detects it automatically.
_detect_pem_or_der() usa una heurística de 4 reglas — marcadores PEM (-----BEGIN), etiqueta ASN.1 0x30, validez UTF-8, fallback binario — sin fiarse únicamente de la extensión del fichero. Un fichero .cer puede ser PEM o DER: chkcert lo detecta automáticamente.
Fonctions principalesMain functionsFunciones principales
| Fonction | Rôle | Retour |
|---|---|---|
| show_cert(cert, ext, alias, count) | Orchestrateur analyse : extraction, expiration, audit algo/clé/self-signed, affichage, actions, registre | None |
| difference_between_dates(expiry, ref) | Calcule durée restante avec référence date simulée (--date) ou now | tuple[str, str, str] |
| _is_self_signed(cert) | Vérification cryptographique RSA/EC/Ed* — plus robuste qu'une comparaison DN | bool |
| check_cert_strength(cert) | Classifie l'algorithme de signature : OK/Weak/Insecure/disabled/Unknown | tuple[str, str] |
| _extract_certificate_info(cert, alias) | Extrait toutes les métadonnées X.509 en CertificateInfo | CertificateInfo |
| _build_csr_cmd(source, alias, dn, size, algo) | Génère la commande de renouvellement CSR adaptée au format | str |
| _resolve_chain(rec, registry, token_map) | Remonte la chaîne jusqu'à la racine (max 20 niveaux) | list[str] |
| generate_json_output(filename) | Sérialise _ctx en JSON horodaté dans json/YYYYMMDD/<ext>/ | str (chemin) |
| generate_html_output(filename) | Rapport HTML auto-contenu avec tables, badges, remédiation, chaînes | str (chemin) |
| _validate_class_bcolors_source(source) | Contrôle le fichier de personnalisation couleurs avant chargement | tuple[bool, str] |
| _is_licensed() | Vérifie la présence d'une licence valide | bool |
| _output_root() | Résout le répertoire de sortie : W/U_FLD_TARGET_ANA_CER ou répertoire du script | str |
| _parse_reference_date(date_arg) | Parse --date : YYYY-MM-DD, +N ou -N jours depuis today | datetime UTC |
| process_one_file(filename, pw, args) | Valide chemin, détecte format, dispatche vers process_*() | None |
| Function | Role | Return |
|---|---|---|
| show_cert(cert, ext, alias, count) | Analysis orchestrator: extraction, expiry, algo/key/self-signed audit, display, actions, registry | None |
| difference_between_dates(expiry, ref) | Computes remaining time using the simulated reference date (--date) or now | tuple[str, str, str] |
| _is_self_signed(cert) | Cryptographic RSA/EC/Ed* check — more robust than a DN comparison | bool |
| check_cert_strength(cert) | Classifies the signature algorithm: OK/Weak/Insecure/disabled/Unknown | tuple[str, str] |
| _extract_certificate_info(cert, alias) | Extracts all X.509 metadata into CertificateInfo | CertificateInfo |
| _build_csr_cmd(source, alias, dn, size, algo) | Generates the renewal command matching the source format | str |
| _resolve_chain(rec, registry, token_map) | Walks the chain up to the root (max 20 levels) | list[str] |
| generate_json_output(filename) | Serialises _ctx as timestamped JSON under json/YYYYMMDD/<ext>/ | str (path) |
| generate_html_output(filename) | Self-contained HTML report with tables, badges, remediation, chains | str (path) |
| _validate_class_bcolors_source(source) | Checks the colour customisation file before loading | tuple[bool, str] |
| _is_licensed() | Checks whether a valid licence is present | bool |
| _output_root() | Resolves the output directory: W/U_FLD_TARGET_ANA_CER or the script's directory | str |
| _parse_reference_date(date_arg) | Parses --date: YYYY-MM-DD, +N or -N days from today | datetime UTC |
| process_one_file(filename, pw, args) | Validates path, detects format, dispatches to process_*() | None |
| Función | Rol | Retorno |
|---|---|---|
| show_cert(cert, ext, alias, count) | Orquestador del análisis: extracción, expiración, auditoría algo/clave/autofirmado, visualización, acciones, registro | None |
| difference_between_dates(expiry, ref) | Calcula el tiempo restante con la fecha de referencia simulada (--date) o now | tuple[str, str, str] |
| _is_self_signed(cert) | Verificación criptográfica RSA/EC/Ed* — más robusta que una comparación de DN | bool |
| check_cert_strength(cert) | Clasifica el algoritmo de firma: OK/Weak/Insecure/disabled/Unknown | tuple[str, str] |
| _extract_certificate_info(cert, alias) | Extrae todos los metadatos X.509 en CertificateInfo | CertificateInfo |
| _build_csr_cmd(source, alias, dn, size, algo) | Genera el comando de renovación adaptado al formato | str |
| _resolve_chain(rec, registry, token_map) | Recorre la cadena hasta la raíz (máx. 20 niveles) | list[str] |
| generate_json_output(filename) | Serializa _ctx como JSON con marca de tiempo en json/YYYYMMDD/<ext>/ | str (ruta) |
| generate_html_output(filename) | Informe HTML autónomo con tablas, badges, remediación, cadenas | str (ruta) |
| _validate_class_bcolors_source(source) | Verifica el fichero de personalización de colores antes de cargarse | tuple[bool, str] |
| _is_licensed() | Comprueba si existe una licencia válida | bool |
| _output_root() | Resuelve el directorio de salida: W/U_FLD_TARGET_ANA_CER o el directorio del script | str |
| _parse_reference_date(date_arg) | Parsea --date: YYYY-MM-DD, +N o -N días desde today | datetime UTC |
| process_one_file(filename, pw, args) | Valida la ruta, detecta el formato, despacha a process_*() | None |
Interface CLICLI interfaceInterfaz CLI
| Argument | Catégorie | Description |
|---|---|---|
| -h, --help | utilitaire | Aide complète |
| --version | utilitaire | Version de l'outil |
| --examples | utilitaire | Exemples d'usage intégrés |
| --file FILE | input | Fichier unique ou glob (*.kdb, **/*.pem) |
| --dir DIR | input | Répertoire — scan récursif rglob |
| --cacerts [FILE] | input | JKS cacerts Java — auto-detect JDK ou chemin explicite |
| --password PASS | auth | Mot de passe du keystore |
| --stashed | auth | Utiliser le fichier .sth (KDB uniquement) |
| --alias PATTERN | filtre | Filtre case-insensitive sur alias/CN/subject/issuer |
| --ext EXT [EXT...] | filtre | Filtre extension : individuelles ou alias (keystore, certificate, request) |
| --date DATE | simulation | Date de référence YYYY-MM-DD ou +N/-N jours — visible dans HTML/JSON |
| --chaining MODE | PKI | alias | serial | both — construction et affichage des chaînes |
| --output FORMAT | export | json | html | both — défaut piloté par OUTPUT_FORMAT_DFT si --quiet |
| --report | export | Rapport de remédiation prioritisé P1/P2/P3 |
| --cmd | export | Inclure les commandes de renouvellement dans --report |
| --remote HOST | remote | Hostname SSH du serveur distant |
| --remote-user USER | remote | Utilisateur SSH |
| --remote-key KEYFILE | remote | Clé privée SSH (recommandé) |
| --remote-pass PASSWORD | remote | Mot de passe SSH (à éviter au profit de --remote-key) |
| --remote-port PORT | remote | Port SSH (défaut : 22) |
| --remote-timeout SECONDS | remote | Timeout connexion SSH (défaut : 30s) |
| --trust-new-host | remote | Accepte et cache une clé d'hôte SSH inconnue (1re connexion) |
| --quiet | affichage | Supprime la console — conserve JSON/HTML |
| --no-color | affichage | Désactive les codes ANSI (scripts, logs) |
| Argument | Category | Description |
|---|---|---|
| -h, --help | utility | Full help |
| --version | utility | Tool version |
| --examples | utility | Built-in usage examples |
| --file FILE | input | Single file or glob (*.kdb, **/*.pem) |
| --dir DIR | input | Directory — recursive rglob scan |
| --cacerts [FILE] | input | Java JKS cacerts — auto-detect JDK or explicit path |
| --password PASS | auth | Keystore password |
| --stashed | auth | Use the .sth file (KDB only) |
| --alias PATTERN | filter | Case-insensitive filter on alias/CN/subject/issuer |
| --ext EXT [EXT...] | filter | Extension filter: individual or alias (keystore, certificate, request) |
| --date DATE | simulation | Reference date YYYY-MM-DD or +N/-N days — visible in HTML/JSON |
| --chaining MODE | PKI | alias | serial | both — chain construction and display |
| --output FORMAT | export | json | html | both — default driven by OUTPUT_FORMAT_DFT if --quiet |
| --report | export | Prioritised remediation report P1/P2/P3 |
| --cmd | export | Include renewal commands in --report |
| --remote HOST | remote | SSH hostname of the remote server |
| --remote-user USER | remote | SSH username |
| --remote-key KEYFILE | remote | SSH private key (recommended) |
| --remote-pass PASSWORD | remote | SSH password (prefer --remote-key instead) |
| --remote-port PORT | remote | SSH port (default: 22) |
| --remote-timeout SECONDS | remote | SSH connection timeout (default: 30s) |
| --trust-new-host | remote | Accepts and caches an unknown SSH host key (first connection) |
| --quiet | display | Suppresses console — keeps JSON/HTML |
| --no-color | display | Disables ANSI codes (scripts, logs) |
| Argumento | Categoría | Descripción |
|---|---|---|
| -h, --help | utilidad | Ayuda completa |
| --version | utilidad | Versión de la herramienta |
| --examples | utilidad | Ejemplos de uso integrados |
| --file FILE | entrada | Fichero único o glob (*.kdb, **/*.pem) |
| --dir DIR | entrada | Directorio — escaneo recursivo rglob |
| --cacerts [FILE] | entrada | JKS cacerts Java — autodetección JDK o ruta explícita |
| --password PASS | autenticación | Contraseña del almacén |
| --stashed | autenticación | Usar el fichero .sth (solo KDB) |
| --alias PATTERN | filtro | Filtro sin distinguir mayúsculas sobre alias/CN/subject/issuer |
| --ext EXT [EXT...] | filtro | Filtro de extensión: individuales o alias (keystore, certificate, request) |
| --date DATE | simulación | Fecha de referencia YYYY-MM-DD o +N/-N días — visible en HTML/JSON |
| --chaining MODE | PKI | alias | serial | both — construcción y visualización de cadenas |
| --output FORMAT | exportación | json | html | both — por defecto según OUTPUT_FORMAT_DFT si --quiet |
| --report | exportación | Informe de remediación priorizado P1/P2/P3 |
| --cmd | exportación | Incluye los comandos de renovación en --report |
| --remote HOST | remoto | Hostname SSH del servidor remoto |
| --remote-user USER | remoto | Usuario SSH |
| --remote-key KEYFILE | remoto | Clave privada SSH (recomendado) |
| --remote-pass PASSWORD | remoto | Contraseña SSH (mejor usar --remote-key) |
| --remote-port PORT | remoto | Puerto SSH (por defecto: 22) |
| --remote-timeout SECONDS | remoto | Timeout de conexión SSH (por defecto: 30s) |
| --trust-new-host | remoto | Acepta y almacena en caché una clave de host SSH desconocida (1ª conexión) |
| --quiet | visualización | Suprime la consola — conserva JSON/HTML |
| --no-color | visualización | Desactiva los códigos ANSI (scripts, logs) |
Sorties généréesGenerated outputsSalidas generadas
Structure des répertoires de sortieOutput directory structureEstructura de directorios de salida
<output_root>/ ← W/U_FLD_TARGET_ANA_CER ou répertoire script html/<YYYYMMDD>/<ext>/ ← rapports HTML par fichier html/<YYYYMMDD>/summary/ ← résumé multi-fichiers HTML json/<YYYYMMDD>/<ext>/ ← exports JSON par fichier json/<YYYYMMDD>/summary/ ← résumé multi-fichiers JSON
Avec --date 2038-12-31, le répertoire prend la date simulée (20381231/) et un badge rouge 📅 ref 2038-12-31 apparaît dans l'en-tête HTML. Le champ reference_date est présent dans tous les JSON.
With --date 2038-12-31, the directory takes the simulated date (20381231/) and a red 📅 ref 2038-12-31 badge appears in the HTML header. The reference_date field is present in every JSON.
Con --date 2038-12-31, el directorio toma la fecha simulada (20381231/) y aparece un badge rojo 📅 ref 2038-12-31 en la cabecera HTML. El campo reference_date está presente en todos los JSON.
JSON — schéma complet par fichierJSON — full schema per fileJSON — esquema completo por fichero
"source_file": "/home/joker/Tools/certificate/new_sectigo/AuthentificationCAEVR36.cer",
"hostname": "check-certificat",
"generated_at": "2026-06-02T14:49:27.628332+00:00",
"reference_date": "2038-12-31", ← date simulée --date
"certificates": [ { label, subject, issuer, serial, key_size, key_algo, ca_flag,
sig_algo, key_usage, eku, san, basic_constraints, matched } ],
"chain_alias": [ { "chain": [...], "tag": "" } ],
"chain_serial": [ { "chain": [...], "tag": "(root)" } ],
"warnings": [],
"errors": [ "❌ Error: Certificate 1 Serial 6d4f... expired 1014 days ago." ],
"action_items": [{
"priority": 1, "severity": "CRITICAL", "category": "EXPIRY",
"message": "Renew certificate before production use", "cmd": "openssl genrsa -out ..."
}],
"totals": { "errors": 1, "warnings": 0 }
}
Intégration PKI — cas d'usage du JSONPKI integration — JSON use casesIntegración PKI — casos de uso del JSON
| Usage PKI | Champ JSON utilisé | Exemple |
|---|---|---|
| Déclenchement d'alertes expiration | action_items[].severity = "CRITICAL" | Email/Slack si P1 présent |
| Tableau de bord conformité | totals.errors / totals.warnings | Dashboard Grafana / Kibana |
| Inventaire automatique | certificates[].serial_number | Base de données PKI centrale |
| Déclenchement renouvellement | action_items[].cmd | Pipeline CI/CD automatisé |
| Audit algorithmique | certificates[].signature_algorithm | Détection SHA-1/MD5 à éliminer |
| Simulation d'anticipation | reference_date + errors[] | Prévision des expirations à 6/12 mois |
| Suivi des chaînes de confiance | chain_alias[].chain | Détection des CA intermédiaires expirés |
| PKI use | JSON field used | Example |
|---|---|---|
| Expiry alert triggering | action_items[].severity = "CRITICAL" | Email/Slack if P1 present |
| Compliance dashboard | totals.errors / totals.warnings | Grafana / Kibana dashboard |
| Automatic inventory | certificates[].serial_number | Central PKI database |
| Renewal triggering | action_items[].cmd | Automated CI/CD pipeline |
| Algorithm audit | certificates[].signature_algorithm | SHA-1/MD5 detection for elimination |
| Anticipation simulation | reference_date + errors[] | 6/12-month expiry forecast |
| Trust chain monitoring | chain_alias[].chain | Detection of expired intermediate CAs |
| Uso PKI | Campo JSON usado | Ejemplo |
|---|---|---|
| Disparo de alertas de expiración | action_items[].severity = "CRITICAL" | Email/Slack si hay P1 |
| Panel de cumplimiento | totals.errors / totals.warnings | Dashboard Grafana / Kibana |
| Inventario automático | certificates[].serial_number | Base de datos PKI central |
| Disparo de renovación | action_items[].cmd | Pipeline CI/CD automatizado |
| Auditoría de algoritmos | certificates[].signature_algorithm | Detección de SHA-1/MD5 a eliminar |
| Simulación de anticipación | reference_date + errors[] | Previsión de expiraciones a 6/12 meses |
| Seguimiento de cadenas de confianza | chain_alias[].chain | Detección de CA intermedias caducadas |
ArchitectureArchitectureArquitectura d'intégration suggéréesuggested integrationde integración sugerida
Cron / Scheduler (quotidien)
└─ chkcert --dir /path/to/keystores --quiet --output json
└─ json/YYYYMMDD/summary/hostname_summary_*.json
└─ Collecteur PKI central (Python / Node / Go)
├─ Parsing JSON chkcert
├─ Base de données inventaire (PostgreSQL / SQLite)
├─ Alertes (Prometheus Alert / PagerDuty / Teams webhook)
├─ Dashboard (Grafana / Kibana)
└─ Déclencheur renouvellement (Ansible / Terraform / script)
⚠️ Limitation actuelle :Current limitation:Limitación actual: chkcert produit les JSON mais ne dispose pas encore d'un collecteur central intégré. L'intégration PKI maison nécessite un développement complémentaire côté consommateur du JSON. C'est l'étape V1R2M0 envisagée. chkcert produces the JSON but does not yet ship an integrated central collector. In-house PKI integration requires additional development on the JSON-consuming side. This is the planned V1R2M0 step. chkcert produce el JSON pero todavía no dispone de un colector central integrado. La integración PKI propia requiere desarrollo adicional en el lado consumidor del JSON. Es el paso previsto para V1R2M0.
Exemples réels — fichiers jointsReal examples — attached filesEjemplos reales — ficheros adjuntos
Les fichiers JSON joints à ce rapport illustrent chkcert en action sur des certificats réels avec simulation temporelle. The JSON files attached to this report illustrate chkcert in action on real certificates with time simulation. Los ficheros JSON adjuntos a este informe ilustran chkcert en acción sobre certificados reales con simulación temporal.
Cas 1 — Certificats Sectigo avec date future 2038-Case 1 — Sectigo certificates with future date 2038-Caso 1 — Certificados Sectigo con fecha futura 2038-
Commande utiliséeCommand usedComando usado : ./chkcert --dir /home/joker/Tools/certificate/new_sectigo/ --date 2038-12-31 --output json --report
Résultat (summary) : 2 erreurs CRITICAL sur 3 fichiers — les certificats CA EV R36 et CA OV R36 de Sectigo seraient expirés depuis 1014 jours à la date de référence 2038-12-31. Seul le Root R46 reste valide. Result (summary): 2 CRITICAL errors out of 3 files — Sectigo's CA EV R36 and CA OV R36 certificates would be expired for 1014 days at the 2038-12-31 reference date. Only the Root R46 remains valid. Resultado (summary): 2 errores CRITICAL de 3 ficheros — los certificados CA EV R36 y CA OV R36 de Sectigo estarían caducados desde hace 1014 días en la fecha de referencia 2038-12-31. Solo el Root R46 permanece válido.
| Fichier | Certificat | Clé | Algo sig. | Statut à 2038-12-31 |
|---|---|---|---|---|
| AuthentificationCAEVR36.cer | Sectigo Public Server Authentication CA EV R36 | RSA 3072 | sha384WithRSA | ❌ EXPIRÉ +1014 jours |
| AuthentificationCAOVR36.cer | Sectigo Public Server Authentication CA OV R36 | RSA 3072 | sha384WithRSA | ❌ EXPIRÉ +1014 jours |
| AuthentificationRootR46.cer | Sectigo Public Server Authentication Root R46 | RSA 4096 | sha384WithRSA | ✅ OK |
💡 Ce cas illustre l'utilité critique de la vérification des CA intermédiaires — pas seulement des certificats leaf. Un Root valide ne suffit pas si l'intermédiaire est expiré (cas LinkedIn 2021 ci-dessus). This case shows the critical value of checking intermediate CAs — not just leaf certificates. A valid Root isn't enough if the intermediate is expired (LinkedIn 2021 case above). Este caso ilustra la utilidad crítica de verificar las CA intermedias — no solo los certificados leaf. Un Root válido no basta si la intermedia está caducada (caso LinkedIn 2021 arriba).
Cas 2 — Certificat WMQ IBM MQ, date future 2038-07Case 2 — IBM MQ WMQ certificate, future date 2038-07Caso 2 — Certificado WMQ IBM MQ, fecha futura 2038-07
FichierFileFichero : test01.cer — CertificatCertificateCertificado WMQ_HORS_PROD_QMGR_QMU01R (Crédit Agricole Group, PKI privée).
Statut à 2038-07-02 : expiré depuis 4814 jours (~13 ans). Ce certificat RSA 2048 / SHA-256 / clientAuth+serverAuth est ancré dans une PKI privée (CA Credit Agricole Server non trouvée dans le keystore).
Status at 2038-07-02: expired for 4814 days (~13 years). This RSA 2048 / SHA-256 / clientAuth+serverAuth certificate is anchored in a private PKI (CA Credit Agricole Server not found in the keystore).
Estado a 2038-07-02: caducado desde hace 4814 días (~13 años). Este certificado RSA 2048 / SHA-256 / clientAuth+serverAuth está anclado en una PKI privada (CA Credit Agricole Server no encontrada en el almacén).
| Champ | Valeur |
|---|---|
| CN | WMQ_HORS_PROD_QMGR_QMU01R |
| Émetteur | CN=CA Credit Agricole Server,O=Credit Agricole Group,C=FR |
| Numéro de série | b90d11720203952a40635488 |
| Clé / Algo | RSA 2048 / sha256WithRSA |
| Usage | DigitalSignature, KeyEncipherment, clientAuth, serverAuth |
| SAN DNS | wmq_hors_prod_qmgr_qmu01r |
| Statut à 2038-07-02 | ❌ EXPIRÉ depuis 4814 jours |
| Commande de renouvellement générée | openssl genrsa -out "test01.key" 4096 openssl req -new -key "test01.key" -out "test01.csr" |
Cas 3 — Formats DER et CSR (tests multiformat)Case 3 — DER and CSR formats (multiformat tests)Caso 3 — Formatos DER y CSR (pruebas multiformato)
Tests réels sur comodo_inter.der, globalsign_root.der, comodo_inter.csr, sectigo_inter.csr — tous analysés sans erreur à la date courante 2026-06-02. Illustre la polyvalence des formats : DER binaire (Comodo CA Limited Issuing CA G5 / RSA 3072), Root auto-signé (GMO GlobalSign RSA 4096), CSR en attente de signature (Sectigo / Comodo, RSA 3072, sha256WithRSA).
Real tests on comodo_inter.der, globalsign_root.der, comodo_inter.csr, sectigo_inter.csr — all analysed without error at the current date 2026-06-02. Illustrates format versatility: binary DER (Comodo CA Limited Issuing CA G5 / RSA 3072), self-signed Root (GMO GlobalSign RSA 4096), pending CSR (Sectigo / Comodo, RSA 3072, sha256WithRSA).
Pruebas reales sobre comodo_inter.der, globalsign_root.der, comodo_inter.csr, sectigo_inter.csr — todos analizados sin error en la fecha actual 2026-06-02. Ilustra la versatilidad de formatos: DER binario (Comodo CA Limited Issuing CA G5 / RSA 3072), Root autofirmado (GMO GlobalSign RSA 4096), CSR pendiente de firma (Sectigo / Comodo, RSA 3072, sha256WithRSA).
| Fichier | Type | CN | Clé | Statut |
|---|---|---|---|---|
| comodo_inter.der | CERT DER | Comodo CA Limited Issuing CA G5 | RSA 3072 | ✅ OK |
| globalsign_root.der | CERT DER (root) | GMO GlobalSign nv-sa Root CA G5 | RSA 4096 | ✅ OK (root) |
| comodo_inter.csr | CSR | Comodo CA Limited Issuing CA G5 | RSA 3072 | ✅ Non signé (pending) |
| sectigo_inter.csr | CSR | Sectigo Limited Issuing CA G5 | RSA 3072 | ✅ Non signé (pending) |
Vérifications cryptographiquesCryptographic checksVerificaciones criptográficas
Classification des algorithmes de signatureSignature algorithm classificationClasificación de algoritmos de firma
| Algorithme | Statut | Action recommandéeRecommended actionAcción recomendada |
|---|---|---|
| SHA256 / SHA384 / SHA512 / SHA224 | OK | AucuneNoneNinguna |
| SHA3-256 / SHA3-384 / SHA3-512 | OK | AucuneNoneNinguna |
| SHA1withRSA | Weak | Planifier migration SHA256Plan migration to SHA256Planificar migración a SHA256 |
| SHA256withDSA (DSA) | disabled | Remplacer par RSA ou ECReplace with RSA or ECSustituir por RSA o EC |
| MD5 | Insecure | Remplacer immédiatementReplace immediatelySustituir inmediatamente |
| Ed25519 / Ed448 | Unknown | Hash intrinsèque — classification partielle (voir note R5)Intrinsic hash — partial classification (see note R5)Hash intrínseco — clasificación parcial (ver nota R5) |
Classification des tailles de clé RSARSA key size classificationClasificación de tamaños de clave RSA
| ConditionConditionCondición | Statut |
|---|---|
| ≤ 1024 bits | CRITICAL — clé faibleweak keyclave débil |
| < 2048 bits (> 1024) | WARNING |
| ≥ 2048 bits | OK |
| EC (≥ 224 bits — P-256/P-384/P-521) | OK |
| DSA (tout typeany typecualquier tipo) | ERROR — désactivédisableddesactivado |
Niveaux d'expirationExpiry levelsNiveles de expiración
| Jours restantsDays remainingDías restantes | Statut | AffichageDisplayVisualización |
|---|---|---|
| ≤ 0 (expiréexpiredcaducado) | ❌ CRITICAL | rouge — P1 dans le rapportred — P1 in the reportrojo — P1 en el informe |
| 1–8 | ❌ Error | rouge — P1red — P1rojo — P1 |
| 9–30 | ⚠️ Warning | orange — P2orange — P2naranja — P2 |
| > 30 | ✅ OK | vertgreenverde |
Protection des fichiers de personnalisationCustomisation file protectionProtección de ficheros de personalización
✅ Le fichier optionnel properties/class_bcolors.py est contrôlé avant chargement pour empêcher tout contenu non conforme. Détail : bilan de protection.
The optional properties/class_bcolors.py file is checked before loading to prevent any non-compliant content. Detail: protection overview.
El fichero opcional properties/class_bcolors.py se verifica antes de cargarse para impedir cualquier contenido no conforme. Detalle: balance de protección.
Mode RemoteRemote modeModo Remote SSH/SFTP
Le mode remote (--remote HOST) est implémenté et fonctionnel dans le code (connexion Paramiko SSH, téléchargement SFTP, analyse locale, nettoyage des temporaires). Cependant, aucun test end-to-end en conditions réelles n'a encore été réalisé dans cette version : accès SSH vers un serveur IBM MQ distant, téléchargement d'un .kdb avec son .sth companion, analyse remote cross-platform (Windows vers Linux, Linux vers AIX).
Remote mode (--remote HOST) is implemented and functional in the code (Paramiko SSH connection, SFTP download, local analysis, temp-file cleanup). However, no end-to-end real-world test has been performed in this version: SSH access to a remote IBM MQ server, downloading a .kdb with its companion .sth, cross-platform remote analysis (Windows to Linux, Linux to AIX).
El modo remoto (--remote HOST) está implementado y es funcional en el código (conexión Paramiko SSH, descarga SFTP, análisis local, limpieza de temporales). Sin embargo, todavía no se ha realizado ninguna prueba end-to-end en condiciones reales en esta versión: acceso SSH a un servidor IBM MQ remoto, descarga de un .kdb con su .sth asociado, análisis remoto multiplataforma (Windows a Linux, Linux a AIX).
Le mode remote sera validé en priorité dans la version V1R2M0. Les utilisateurs souhaitant l'utiliser dès maintenant sont invités à signaler tout comportement inattendu à licence@jokersoft.com. Remote mode will be validated as a priority in version V1R2M0. Users wishing to use it now are encouraged to report any unexpected behaviour to licence@jokersoft.com. El modo remoto se validará con prioridad en la versión V1R2M0. Los usuarios que deseen usarlo desde ya pueden reportar cualquier comportamiento inesperado a licence@jokersoft.com.
ArchitectureArchitectureArquitectura du mode remote (implémentée)of remote mode (implemented)del modo remoto (implementada)
Principe : Python et cryptography ne sont pas requis sur le serveur distant. Seul SSH/SFTP est nécessaire.
Principle: Python and cryptography are not required on the remote server. Only SSH/SFTP is needed.
Principio: Python y cryptography no son necesarios en el servidor remoto. Solo se necesita SSH/SFTP.
| Scénario | Configuration | Statut test |
|---|---|---|
| Linux → Linux (cas principal) | --remote-key ~/.ssh/id_rsa | Non testé V1R1M1 |
| Windows → Linux | --remote-key %USERPROFILE%\.ssh\id_rsa | Non testé V1R1M1 |
| Linux → AIX / IBM i | --remote-key ~/.ssh/id_ed25519 | Non testé V1R1M1 |
| Windows → Windows (OpenSSH) | OpenSSH activé sur la cible | Non testé V1R1M1 |
| Password auth | --remote-pass | Non testé V1R1M1 |
| Scenario | Configuration | Test status |
|---|---|---|
| Linux → Linux (primary case) | --remote-key ~/.ssh/id_rsa | Not tested V1R1M1 |
| Windows → Linux | --remote-key %USERPROFILE%\.ssh\id_rsa | Not tested V1R1M1 |
| Linux → AIX / IBM i | --remote-key ~/.ssh/id_ed25519 | Not tested V1R1M1 |
| Windows → Windows (OpenSSH) | OpenSSH enabled on target | Not tested V1R1M1 |
| Password auth | --remote-pass | Not tested V1R1M1 |
| Escenario | Configuración | Estado de la prueba |
|---|---|---|
| Linux → Linux (caso principal) | --remote-key ~/.ssh/id_rsa | No probado V1R1M1 |
| Windows → Linux | --remote-key %USERPROFILE%\.ssh\id_rsa | No probado V1R1M1 |
| Linux → AIX / IBM i | --remote-key ~/.ssh/id_ed25519 | No probado V1R1M1 |
| Windows → Windows (OpenSSH) | OpenSSH activado en el destino | No probado V1R1M1 |
| Password auth | --remote-pass | No probado V1R1M1 |
💡 Le fichier .sth companion des keystores .kdb est automatiquement récupéré via SFTP si présent sur le serveur distant. Le hostname remote alimente _ctx._remote_hostname pour nommer les fichiers JSON/HTML de sortie.
The .sth companion file for .kdb keystores is automatically retrieved via SFTP if present on the remote server. The remote hostname feeds _ctx._remote_hostname, used to name the output JSON/HTML files.
El fichero .sth asociado a los almacenes .kdb se recupera automáticamente vía SFTP si está presente en el servidor remoto. El hostname remoto alimenta _ctx._remote_hostname, usado para nombrar los ficheros JSON/HTML de salida.
Cycles de renouvellementRenewal cyclesCiclos de renovación & anticipationanticipationanticipación
Face à la réduction des durées de validité imposée par les AC et les navigateurs, chkcert intègre plusieurs mécanismes d'anticipation : Facing the shortened validity periods imposed by CAs and browsers, chkcert includes several anticipation mechanisms: Frente a la reducción de los períodos de validez impuesta por las AC y los navegadores, chkcert integra varios mecanismos de anticipación:
Simulation temporelle (--date)Time simulation (--date)Simulación temporal (--date)
L'option --date YYYY-MM-DD (ou +N / -N jours) permet de simuler l'état du parc de certificats à une date future. Exemples pratiques :
The --date YYYY-MM-DD option (or +N / -N days) simulates the state of the certificate fleet at a future date. Practical examples:
La opción --date YYYY-MM-DD (o +N / -N días) permite simular el estado del parque de certificados en una fecha futura. Ejemplos prácticos:
./chkcert --dir /opt/mq/ssl/ --date +90 --report # Que sera expiré dans 90 jours ? ./chkcert --dir /opt/mq/ssl/ --date +365 --report # Plan de renouvellement annuel ./chkcert --dir /opt/mq/ssl/ --date 2027-01-01 --output html # Audit au 1er janvier 2027
Génération des commandes de renouvellement (--cmd)Renewal command generation (--cmd)Generación de comandos de renovación (--cmd)
Avec --report --cmd, chkcert génère les commandes exactes de renouvellement adaptées au format du keystore :
With --report --cmd, chkcert generates the exact renewal commands matching the keystore format:
Con --report --cmd, chkcert genera los comandos exactos de renovación adaptados al formato del almacén:
| Format | Commande généréeGenerated commandComando generado |
|---|---|
| .kdb | runmqakm -certreq -create -db ... -label ... -dn ... -size 4096 -sig_alg sha256 |
| .jks / .p12 | keytool -certreq -keystore ... -alias ... -file out.csr -sigalg SHA256withRSA |
| .pem / .cer | openssl genrsa -out key.pem 4096 && openssl req -new -key key.pem -out csr.pem |
Impact des cycles 47 jours (CA/Browser Forum 2027)47-day cycles impact (CA/Browser Forum 2027)Impacto de los ciclos de 47 días (CA/Browser Forum 2027)
Si le CA/Browser Forum adopte la durée de 47 jours maximum (vote prévu 2026–2027), un parc de 100 certificats TLS nécessitera ~780 renouvellements par an. Sans automatisation et sans outil de surveillance centralisé, le risque d'expiration accidentelle est proche de 100%. If the CA/Browser Forum adopts the 47-day maximum (vote expected 2026–2027), a fleet of 100 TLS certificates will need ~780 renewals per year. Without automation and centralised monitoring, the risk of accidental expiry approaches 100%. Si el CA/Browser Forum adopta el máximo de 47 días (votación prevista 2026–2027), un parque de 100 certificados TLS necesitará ~780 renovaciones al año. Sin automatización ni herramienta de supervisión centralizada, el riesgo de expiración accidental se acerca al 100%.
chkcert + export JSON + PKI maison constitue la base de cette automatisation : détection → alerte → commande de renouvellement générée → pipeline CI/CD. chkcert + JSON export + in-house PKI form the basis of this automation: detection → alert → generated renewal command → CI/CD pipeline. chkcert + exportación JSON + PKI propia constituyen la base de esta automatización: detección → alerta → comando de renovación generado → pipeline CI/CD.
ObservationsFindingsObservaciones & Recommandations V1R1M1V1R1M1 RecommendationsRecomendaciones V1R1M1
os.remove(filenameT) ajouté après os.close(_fd) pour les formats KDB — runmqakm refusait d'écrire sur un fichier existant (CTGSK3036W). Corrigé pour cert-extract et certreq-extract.
os.remove(filenameT) added after os.close(_fd) for KDB formats — runmqakm refused to write to an existing file (CTGSK3036W). Fixed for cert-extract and certreq-extract.
os.remove(filenameT) añadido tras os.close(_fd) para los formatos KDB — runmqakm se negaba a escribir en un fichero existente (CTGSK3036W). Corregido para cert-extract y certreq-extract.
Validation ajoutée : toute valeur en dessous de 2048 dans MIN_RSA_KEY_SIZE est rejetée avec un warning et ignorée. Le plancher absolu est incontournable même par le fichier de configuration externe.
Validation added: any value below 2048 in MIN_RSA_KEY_SIZE is rejected with a warning and ignored. The absolute floor cannot be bypassed, even via the external configuration file.
Validación añadida: cualquier valor por debajo de 2048 en MIN_RSA_KEY_SIZE se rechaza con un warning y se ignora. El límite absoluto es infranqueable incluso desde el fichero de configuración externo.
WEAK_KEY_THRESHOLD corrigé de 1048 (coquille) à 1024 bits — la valeur erronée classait par erreur certaines clés 1024 bits comme non critiques.
WEAK_KEY_THRESHOLD corrected from 1048 (typo) to 1024 bits — the wrong value was mistakenly classifying some 1024-bit keys as non-critical.
WEAK_KEY_THRESHOLD corregido de 1048 (errata) a 1024 bits — el valor incorrecto clasificaba erróneamente algunas claves de 1024 bits como no críticas.
Les clés W_FLD_TARGET_ANA_CER (Windows) et U_FLD_TARGET_ANA_CER (Unix) sont maintenant chargées depuis constantes_V1R1M1.properties et utilisées par les 4 fonctions de sortie. Fallback silencieux sur le répertoire du script si absent.
The W_FLD_TARGET_ANA_CER (Windows) and U_FLD_TARGET_ANA_CER (Unix) keys are now loaded from constantes_V1R1M1.properties and used by the 4 output functions. Silent fallback to the script directory if absent.
Las claves W_FLD_TARGET_ANA_CER (Windows) y U_FLD_TARGET_ANA_CER (Unix) ahora se cargan desde constantes_V1R1M1.properties y son usadas por las 4 funciones de salida. Fallback silencioso al directorio del script si están ausentes.
Badge 📅 ref YYYY-MM-DD dans l'en-tête HTML. Champ reference_date dans tous les JSON (per-file et summary). Le répertoire de sortie utilise la date simulée comme YYYYMMDD.
📅 ref YYYY-MM-DD badge in the HTML header. reference_date field in every JSON (per-file and summary). The output directory uses the simulated date as YYYYMMDD.
Badge 📅 ref YYYY-MM-DD en la cabecera HTML. Campo reference_date en todos los JSON (per-file y summary). El directorio de salida usa la fecha simulada como YYYYMMDD.
Le fichier de personnalisation couleurs est désormais contrôlé avant chargement — élimine un vecteur identifié lors de l'audit sécurité. The colour customisation file is now checked before loading — eliminates a vector identified during the security audit. El fichero de personalización de colores ahora se verifica antes de cargarse — elimina un vector identificado durante la auditoría de seguridad.
check_cert_strength() retourne ('Unknown', 'Unknown') pour Ed25519/Ed448 car signature_hash_algorithm est None pour ces algorithmes (hash intrinsèque). Un statut spécifique 'Modern-EdDSA' est prévu en V1R2M0.
check_cert_strength() returns ('Unknown', 'Unknown') for Ed25519/Ed448 because signature_hash_algorithm is None for these algorithms (intrinsic hash). A dedicated 'Modern-EdDSA' status is planned for V1R2M0.
check_cert_strength() devuelve ('Unknown', 'Unknown') para Ed25519/Ed448 porque signature_hash_algorithm es None para estos algoritmos (hash intrínseco). Se prevé un estado específico 'Modern-EdDSA' para V1R2M0.
Voir section dédiée ci-dessus. L'implémentation est complète mais les scénarios cross-platform (Linux → AIX, Windows → Linux + KDB/STH) n'ont pas encore été validés en conditions réelles. Prévu V1R2M0. See dedicated section above. The implementation is complete but cross-platform scenarios (Linux → AIX, Windows → Linux + KDB/STH) have not yet been validated under real conditions. Planned for V1R2M0. Ver sección dedicada arriba. La implementación está completa pero los escenarios multiplataforma (Linux → AIX, Windows → Linux + KDB/STH) todavía no se han validado en condiciones reales. Previsto para V1R2M0.
Prochaines évolutions prévues : (1) validation du mode remote en conditions réelles toutes plateformes, (2) statut EdDSA correct, (3) licence serveur (Option Fort — appel HTTPS api.jokersoft.com), (4) collecteur PKI central consommateur du JSON, (5) support OCSP stapling dans l'analyse. Planned next steps: (1) real-world validation of remote mode across all platforms, (2) correct EdDSA status, (3) server licence (Fort option — HTTPS call to api.jokersoft.com), (4) central PKI collector consuming the JSON, (5) OCSP stapling support in analysis. Próximas evoluciones previstas: (1) validación del modo remoto en condiciones reales en todas las plataformas, (2) estado EdDSA correcto, (3) licencia de servidor (Opción Fort — llamada HTTPS a api.jokersoft.com), (4) colector PKI central consumidor del JSON, (5) soporte de OCSP stapling en el análisis.
chkcert_V1R1M1_Technical_Report.html — JokerSoft © 2026
Version V1R1M1 · 6 950+ ligneslineslíneas · 316 KB · check-certificat.com