Ripristino dopo un attacco informatico: Recupero del certificato non riuscito con protocollo TLS
Summary: Dopo l'aggiornamento a Cyber Recovery 19.17, è disponibile una nuova opzione per verificare il certificato quando si abilita il protocollo TLS (Transport Layer Security). Questo articolo illustra le situazioni in cui il recupero del certificato non è riuscito con il protocollo TLS. ...
Symptoms
Dopo l'aggiornamento a Cyber Recovery 19.17, è disponibile una nuova opzione per verificare il certificato quando si abilita il protocollo TLS (Transport Layer Security). Durante la verifica del certificato, nell'interfaccia utente di Cyber Recovery viene visualizzato il seguente errore:
Mail server certificate is required when enabling TLS.
Cause
Dai registri di Cyber Recovery, vengono stampate le seguenti voci.
Il crcli.log:
[2024-10-03 11:49:03.273] [DEBUG] [crcli] [restapi_client.go:384 HandleRESTAPIResponse()] : Entering
[2024-10-03 11:49:03.273] [DEBUG] [crcli] [restapi_client.go:392 HandleRESTAPIResponse()] : REST status code :500
[2024-10-03 11:49:03.273] [ERROR] [crcli] [restapi_client.go:401 HandleRESTAPIResponse()] : Failed to retrieve mail server certificate : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.273] [DEBUG] [crcli] [restapi_client.go:402 HandleRESTAPIResponse()] : Exiting
[2024-10-03 11:49:03.273] [ERROR] [crcli] [libcli.go:150 CliErrorExit()] : Failed to retrieve mail server certificate : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
Il edge.log:
[2024-10-03 11:48:53.268] [DEBUG] [edge] [restapi_client.go:200 callRestApi()] : Perform request.Post path=https://notifications:9096/irapi/v8/notifications/retrieveEmailCert
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:209 callRestApi()] : status = 500 Internal Server Error
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:410 GetCRResponse()] : Entering
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:417 GetCRResponse()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:210 callRestApi()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:116 CallCRRESTAPI()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:57 CallRESTAPIHeader()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:384 HandleRESTAPIResponse()] : Entering
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:392 HandleRESTAPIResponse()] : REST status code :500
[2024-10-03 11:49:03.272] [ERROR] [edge] [restapi_client.go:401 HandleRESTAPIResponse()] : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.272] [DEBUG] [edge] [restapi_client.go:402 HandleRESTAPIResponse()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [jsonerr.go:27 JSONError()] : Entering
[2024-10-03 11:49:03.272] [ERROR] [edge] [jsonerr.go:40 JSONError()] : 500 : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.272] [DEBUG] [edge] [jsonerr.go:44 JSONError()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [edge] [notifications.go:560 RetrieveEmailCert()] : Exiting
[2024-10-03 11:49:03.272] [INFO] [edge] [restauth.go:111 func1()] : POST /cr/v8/notifications/retrieveEmailCert End RetrieveEmailCert Elapsed=10.005125439s
Il notifications.log:
[2024-10-03 11:48:53.270] [INFO] [notifications] [restauth.go:68 func1()] : POST /irapi/v8/notifications/retrieveEmailCert Start RetrieveEmailCert
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:210 validateToken()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:194 DecryptToken()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [encoding.go:48 DecodeString()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [encoding.go:56 DecodeString()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [crcrypto.go:558 DecryptCFB()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [crcrypto.go:579 DecryptCFB()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [encoding.go:48 DecodeString()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [encoding.go:56 DecodeString()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [crcrypto.go:112 GenHash()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [crcrypto.go:118 GenHash()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:206 DecryptToken()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:268 ValidateTokenTime()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:281 ValidateTokenTime()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [restauth.go:255 validateToken()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:283 RetrieveEmailCert()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:175 ValidateMailServer()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:201 ValidateMailServerURL()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:210 ValidateMailServerURL()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:215 ValidateMailServerPort()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:222 ValidateMailServerPort()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [notifications.go:196 ValidateMailServer()] : Exiting
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [email.go:227 RetrieveEmailCert()] : Entering
[2024-10-03 11:48:53.270] [DEBUG] [notifications] [email.go:272 GetTLSConn()] : Entering
[2024-10-03 11:49:03.271] [DEBUG] [notifications] [email.go:283 GetTLSConn()] : Exiting
[2024-10-03 11:49:03.272] [ERROR] [notifications] [email.go:235 RetrieveEmailCert()] : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.272] [DEBUG] [notifications] [email.go:236 RetrieveEmailCert()] : Exiting
[2024-10-03 11:49:03.272] [ERROR] [notifications] [notifications.go:321 RetrieveEmailCert()] : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.272] [DEBUG] [notifications] [jsonerr.go:27 JSONError()] : Entering
[2024-10-03 11:49:03.272] [ERROR] [notifications] [jsonerr.go:40 JSONError()] : 500 : Failed to connect to mail server: dial tcp: lookup smtp-mail.com: i/o timeout
[2024-10-03 11:49:03.272] [DEBUG] [notifications] [jsonerr.go:44 JSONError()] : Exiting
[2024-10-03 11:49:03.272] [DEBUG] [notifications] [notifications.go:323 RetrieveEmailCert()] : Exiting
Dalla versione 19.17, Cyber Recovery ha avviato la verifica del certificato del server di posta quando si utilizza TLS.
In ambienti non DNS (Domain Name System), l'immissione del server di posta come nome DNS ha esito negativo poiché Cyber Recovery non è in grado di risolvere il nome del nome host in un indirizzo IP a causa della mancanza di DNS all'interno dell'ambiente.
Quando un indirizzo IP viene utilizzato come campo del server di posta/inoltro all'interno di CR e il certificato fornito dal server di posta non contiene l'IP nel certificato, la verifica ha esito negativo poiché il certificato viene verificato rispetto all'IP.
Ci sono un paio di soluzioni alternative per farlo funzionare:
- Aggiungere l'indirizzo IP al certificato fornito dal server di posta in modo che la verifica possa funzionare.
- Aggiungere la voce per il server di posta e l'IP in
/etc/hostsnel contenitore delle notifiche per consentire CR, risolvere correttamente il server di posta ed è possibile eseguire la verifica del certificato.
Resolution
Sono disponibili due opzioni per risolvere questo problema:
- Il server di posta utilizza un nome di dominio completo (FQDN) e Cyber Recovery non riesce a ottenere il certificato.
- Verificare di utilizzare un server DNS nell'ambiente del vault e che funzioni correttamente.
- Se non è presente alcun server DNS nel vault, attenersi alla seguente procedura:
- Immettere i dettagli del server SMTP (Simple Mail Transfer Protocol) nei file host per la finestra mobile notifiche.
- Connettersi a Cyber Recovery utilizzando SSH.
- Eseguire questo comando:
docker exec -it cr_notifications_1 bash - Aprire il file con un editor di testo:
/etc/hosts - Aggiungere le voci per il server SMTP come IP, FQDN e nome breve.
- Salvare il file.
- Eseguire questo comando per uscire dal contenitore docker:
exit
- Per effettuare la voce nel file
/etc/hostsFile persistente durante i riavvii, effettuare le seguenti operazioni:- Aggiunta di una riga in
cr-install-path>/etc/docker-compose-prod-<current-version>.ymlper l'IP che si desidera aggiungere/etc/hostsNotifiche: - La nuova riga evidenziata in grassetto deve contenere l FQDN SMTP e quindi l'IP:
SMTP.server.com:xxx.xxx.xxx.xxx
build: .image: ${registryName}/cr_notifications:${notificationsVersion}container_name: cr_notifications_1security_opt:- no-new-privileges:truehostname: notificationsexpose:- "9096"depends_on:- postgresqlcap_drop:- ALLenvironment:- LD_LIBRARY_PATH=/cr/lockbox/lib- CRHOSTNAME=${dockerHostFQDN}- ENABLE_TLS=${enableTLS}- ENABLE_POSTFIX=${enablePostfix}- GODEBUG=tlskyber=0extra_hosts:- dockerbridge:${dockerBridge}- ${dockerHostFQDN}:${dockerHost}- SMTP.server.com:xxx.xxx.xxx.xxx - Quindi esegui
'crsetup.sh – forcerecreate'QUANDO NON SONO IN ESECUZIONE PROCESSI.
- Aggiunta di una riga in
- Immettere i dettagli del server SMTP (Simple Mail Transfer Protocol) nei file host per la finestra mobile notifiche.
- L'utilizzo di un indirizzo IP per SMTP e Cyber Recovery non riesce a ottenere il certificato.
-
- In questo caso, è necessario generare un nuovo certificato che contenga l'indirizzo IP in uso.
Oppure
-
- Nel caso in cui il certificato sia stato creato utilizzando un FQDN, anziché utilizzare l'IP per connettersi all'SMTP, utilizzare l'FQDN nell'interfaccia utente di Cyber Recovery.