cn:ccr:aai:howto:how_to:rockylinux8-certificati
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| cn:ccr:aai:howto:how_to:rockylinux8-certificati [2024/12/03 11:48] – [Tipologia Certificato] monducci@infn.it | cn:ccr:aai:howto:how_to:rockylinux8-certificati [2024/12/17 17:49] (current) – anzel@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Certificati | ||
| + | |||
| + | ===== Tipologia Certificato ===== | ||
| + | Il certificato deve essere di tipo RSA | ||
| + | |||
| + | Se si usa ACME (rinnovo automatico dei certificati) ricordasi, nella richiesta, di specificare: | ||
| + | –key-type rsa | ||
| + | |||
| + | ===== Aggiornamento Certificato Macchina ===== | ||
| + | |||
| + | E' necessario determinare il nome dell' | ||
| + | |||
| + | Eseguire: | ||
| + | # ls -F / | ||
| + | |||
| + | Esempio | ||
| + | # ls -F / | ||
| + | slapd-ds2 | ||
| + | |||
| + | L' | ||
| + | slapd-ds2 | ||
| + | |||
| + | Definire la variabile $DSUID, se non è già definita: | ||
| + | # export DSUID=ds2 | ||
| + | |||
| + | L' | ||
| + | # echo slapd-$DSUID | ||
| + | |||
| + | Verificare i certificati installati: | ||
| + | dsconf slapd-$DSUID security certificate list | ||
| + | |||
| + | Esempio: | ||
| + | | ||
| + | dsconf slapd-ds2 security certificate list | ||
| + | | ||
| + | Certificate Name: Server-Cert | ||
| + | Subject DN: CN=ds2, | ||
| + | Issuer DN: CN=ssca.389ds.example.com, | ||
| + | Expires: 2024-03-16 15:30:09 | ||
| + | Trust Flags: u,u,u | ||
| + | | ||
| + | Certificate Name: server-cert-ansible-managed | ||
| + | Subject DN: CN=ds.infn.it, | ||
| + | Issuer DN: CN=GEANT OV RSA CA 4,O=GEANT Vereniging, | ||
| + | Expires: 2023-03-23 23:59:59 | ||
| + | Trust Flags: u,u,u | ||
| + | |||
| + | Prendersi nota del " | ||
| + | Il profilo ansibile DS389 per RockyLinux8 il Certificate Name è: " | ||
| + | |||
| + | |||
| + | Cancellare il certificato che si desidera aggiornare: | ||
| + | |||
| + | dsconf slapd-$DSUID security certificate del " | ||
| + | Esempio | ||
| + | dsconf slapd-$DSUID security certificate del server-cert-ansible-managed | ||
| + | |||
| + | **Se avete un certificato con rinnovo automatico seguite questa procedura: | ||
| + | |||
| + | Dopo aver cancellato il certificato " | ||
| + | |||
| + | Eseguire: | ||
| + | |||
| + | dsconf slapd-$DSUID security certificate add --name " | ||
| + | | ||
| + | Esempio | ||
| + | dsconf -v slapd-ds2 security certificate add --name server-cert-ansible-managed --file ds2.infn.it-2.pem --primary-cert | ||
| + | |||
| + | **Se avete un certificato senza automatico seguite questa procedura: | ||
| + | |||
| + | Dopo aver cancellato il certificato " | ||
| + | |||
| + | Convertire il certificato con chiave privata del server in formato pkcs12 in un file temporaneo | ||
| + | |||
| + | openssl pkcs12 -export -inkey ds_server_key.pem -in ds_server_crt.pem -out / | ||
| + | |||
| + | Prendere nota della password del DB dei Certificati: | ||
| + | # cat / | ||
| + | |||
| + | Importare il certificato con chiave privata del server nel DB di 389-ds. | ||
| + | |||
| + | cd / | ||
| + | pk12util -i / | ||
| + | | ||
| + | Esempio | ||
| + | pk12util -i / | ||
| + | Enter Password or Pin for "NSS Certificate DB": " | ||
| + | Enter password for PKCS12 file: " | ||
| + | pk12util: PKCS12 IMPORT SUCCESSFUL | ||
| + | |||
| + | |||
| + | Verrà richiesto di inserire la password per: | ||
| + | |||
| + | * l' | ||
| + | * il certificato pk12 (quella impostata durante la creazione del certificato pk12) | ||
| + | |||
| + | |||
| + | Procedere ora a definire l'uso del nuovo certificato nel DS: | ||
| + | |||
| + | * aprire un browser e collegarsi via cockpit al server LDAP | ||
| + | * andare in "389 Directory Server" | ||
| + | * in basso "Save Settings | ||
| + | |||
| + | Infine, fare il restart del servizio directory server | ||
| + | |||
| + | systemctl restart dirsrv@$DSUID.service | ||
| + | |||
| + | |||
| + | Per avere un output verboso si può usare -v nei comandi: dsconf | ||
| + | dsconf -v .... | ||
| + | |||
| + | **Ricordarsi di aggiornare anche i certificati per cockpit** | ||
| + | |||
| + | [[https:// | ||
| + | ===== Verifica Certificato Server ===== | ||
| + | Eseguire: | ||
| + | openssl s_client -starttls ldap -connect " | ||
| + | |||
| + | Esempio: | ||
| + | openssl s_client -starttls ldap -connect ds1.infn.it: | ||
| + | ===== Verifica Certificati Master ===== | ||
| + | Tramite socket | ||
| + | ldapsearch -Q -LLL -o ldif-wrap=no | ||
| + | Esempio | ||
| + | ldapsearch -Q -LLL -o ldif-wrap=no | ||
| + | | ||
| + | dn: cn=dsm1.infn.it, | ||
| + | infnCertSubjectDN: | ||
| + | infnCertSubjectDN: | ||
| + | | ||
| + | dn: cn=dsm2.infn.it, | ||
| + | infnCertSubjectDN: | ||
| + | infnCertSubjectDN: | ||
| + | | ||
| + | dn: cn=dsm3.infn.it, | ||
| + | infnCertSubjectDN: | ||
| + | infnCertSubjectDN: | ||
| + | |||
| + | L' | ||
| + | |||
| + | **OU=SSNN, | ||
